03-01-2010 10:41 AM
I can use drawPathOutline, drawFilledPath to draw simple shapes. It works well for rotating a shape, once you work out the points by hand. But what are the offsets used for?
03-01-2010 03:49 PM - edited 03-01-2010 03:51 PM
The explanation in the documentation seems clear enough:
offsets - List defining the beginnings of each path in the xPts/yPts data arrays, or null to indicate a single path. A path that begins at point (xPts[offsets[i]],yPts[offsets[i]]) will end at point (xPts[offsets[i+1]]-1,yPts[offsets[i+1]]-1).
I suspect though the last point should be (xPts[offsets[i+1]-1], yPts[offsets[i+1]-1]) however.
03-01-2010 05:09 PM
At the risk of being non-PC, "its all Greek to me" ;-) FWIW, I did read the documentation before I posted.
My current understanding - xPts and yPts define a set of points, and the function draws some sort of curve between each point, based on the pointTypes.
Maybe you can give me a simple example using the offsets to help me understand.
03-01-2010 05:22 PM
Okay, let's approach this from another angle.
You can draw multiple, potentially unconnected paths with drawPathOutline. You only have your two arguments for the point list. How do you distinguish which points belong to which path?
03-01-2010 09:15 PM
It still isn't totally clear, but getting better. Help me with an example.
xpts = [10,20,30,40]
ypts = [50,60,70,80]
These are my points
Say I want a path to be 10,50 to 20,60 and then another, unconnected path to be 30,70 to 40,80, what would I put in offsets?
Now I want 10,50 connected to 30,70 and 20, 60 connected to 40 80, what would be in offsets?
Is it something like that?