import static com.threerings.cast.Log.log;
A character sprite is a sprite that animates itself while walking about in a scene.
Initializes this character sprite with the specified character descriptor and character
manager. It will obtain animation data from the supplied character manager.
Called after this sprite has been initialized with its character descriptor and character
manager. Derived classes can do post-init business here.
Reconfigures this sprite to use the specified character descriptor.
Specifies the action to use when the sprite is at rest. The default is
Returns the action to be used when the sprite is at rest. Derived classes may wish to
override this method and vary the action based on external parameters (or randomly).
Specifies the action to use when the sprite is following a path. The default is
Returns the action to be used when the sprite is following a path. Derived classes may wish
to override this method and vary the action based on external parameters (or randomly).
Sets the action sequence used when rendering the character, from the set of available
log.info("Refusing to set invalid orientation",
"sprite", this, "orient", orient, new Exception());
public boolean hitTest (int x, int y)
public void tick (long tickStamp)
Called to paint any decorations that should appear behind the character sprite image.
Called to paint any decorations that should appear in front of the character sprite image.
Rebuilds our action frames given our current character descriptor and action sequence. This
is called when either of those two things changes.
log.warning("Character sprite references non-existent component",
"sprite", this, "err", nsce);
Called to recomposite our action frames if needed.
Makes it easier to track down problems with bogus character descriptors.
log.warning("Invalid character descriptor [sprite=" + this +
protected boolean tickPath (long tickStamp)
boolean moved = super.tickPath(tickStamp);
Updates the sprite animation frame to reflect the cessation of movement and disables any
The action to use when at rest.
The action to use when following a path.
A reference to the descriptor for the character that we're visualizing.
A reference to the character manager that created us.
The action we are currently displaying.
The animation frames for the active action sequence in each orientation.
The offset from the upper-left of the total sprite bounds to the upper-left of the image
within those bounds.
The bounds of the current sprite image.