Understanding the 'handle'

BlitzMax Forums/BlitzMax Beginners Area/Understanding the 'handle'

mgorsuch(Posted 2005) [#1]
I want to make sure I have this concept down before moving on.

Where is the default location for a 'handle'? I'm assuming it is reletive to the object that is to be drawn, correct?

I understand that an image handle is in the top left corner by default.

What about a poly? Is the handle located at the first plotted pixel?

Next question: setHandle. This translates the handle relative to it's default location, correct? So if the handle defautls to the top left of the rect, set handle X,Y move it X pixes left or right and Y pixels up or down. Does that sound right?

Thank you all,

Michael


Will(Posted 2005) [#2]
Sounds right to me - except that Im not sure a Poly has a handle. After-all, it is just a series of xy point values that you pass to the function, I wasnt aware there was any prebuilt type to store them, so you might as well do any manipulation before calling DrawPoly().


JazzieB(Posted 2005) [#3]
A poly does have a set list of co-ordinates, as Will rightly says. The handle is always at 0,0 and you can move the poly around the screen by utilising the SetOrigin command. You will need to reset it afterwards, so that everything else isn't drawn to the wrong co-ordinates.

In terms of the normal handle and the SetHandle command, positive values will move the handle to the right or down and negative to the left or up.


mgorsuch(Posted 2005) [#4]
Thank you both very much - this makes everything much more clear.

--Michael