Actor
An Actor represents every item you see within the game, and is arguably the most important Kyd class,
Even static scenery are Actors.
You may argue that Actor
is a bad name for scenery, but it makes me smile as it reminds me of a scene in "A Midsummer Night's Dream". There is a play within a play, and one of the actors takes on the role of a wall. In the original :
_Bottom_ : let him hold his fingers thus, and through that cranny shall _Pyramus_ and _Thisbe_ whisper.
However, in the version I saw, Wall was played by a petite young actress in a leotard, and an entirely different cranny was chosen. While kneeling down Pyramus couldn't be heard by Thisbe, so Wall suggests Pyramus widen the cranny with his fingers. The look on Pyramus' face was priceless. Shakespeare plays are often smutty, but they took it to another level. If you are ever in London, take in a comedy at The Globe - cheap a chips and funny as hell.
Properties
The angle of rotation about position point (measured in degrees). Positive angles are anticlockwise, i.e. PI/2 radians will rotate a quart-turn anticlockwise.
The angle of rotation about position point (measured in radians). Positive angles are anticlockwise, i.e. PI/2 radians will rotate a quart-turn anticlockwise.
TODO This won't be needed when the editor dynamically loads the game's jar files. Without this, behaviours will reset to NoRole when an act is saved.
A transformation matrix used while drawing.
The position of the actor relative to its parent. For a top-level actor (whose parent is a Stage), this uses CoordinateSystem.world. But if this is a child of another Actor, the position is relative to the parent Actor (See CoordinateSystem.child).
Hides the actor without changing its appearance.
Only used when placed on a ZOrderStage. It is often better to create separate Stages, rather than using zOrder. For example, if you have terrain
, walking
and flying
objects, create 3 stages. When you do this, the zOrder is often not relevant.
Functions
Returns our color at a given worldPoint. If the point is outside our bounds, it will always be Color.TRANSPARENT. This is used to test if a mouse event is touching this actor, by comparing the color's alpha with a threshold value.