Now that the Actor
draws an interesting pattern it deserves to be represented on Stage
by an interesting shape. This Actor
uses
the image defined in the file
theaterEx/drawSquares/res/hand.png:
.
An ImageShape's
hotSpot
is a point defined relative to the images lower left corner. The hot spot is the point within the image that is aligned with the actor's current position on the Stage
.
This program defines the hot spot to be (8,0)
, that is the point 8 pixels to the right and 0 pixels up from the images lower left corner.
Note that the actor calls setRotatesShape(false);
to indicate
that its shape should not be rotated according to its movement direction.
Click on Rotating Image to see the actor with image rotation turned on.