Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Supported Methods 

Description of Methods

Integer GetX()

Returns the x coordinate of the sprite.

Integer GetY()

Returns the y coordinate of the sprite.

Integer GetZ()

Returns the z value of the sprite.

The default z value is 0.

Boolean GetDrawableFlag()

Returns the value of the Drawable Flag.

The default value is true.

Integer GetMemberFlags()

Returns the value of member flags variable.

The default value is 1.

Integer GetCollidableFlags()

Returns the value of collidable flags variable.

The default value is 1.

Object GetRegion()

Returns an roRegion object that specifies the region of a bitmap that is the sprite's display graphic.

Void SetZ(Integer z)

Sets the z value of the sprite. This will place the sprite in the list such that it will be drawing in front of any other sprite of lesser or equal z value.

Void SetDrawableFlag(bool enable)

Sets whether this sprite is drawable or just used for collision tests. An undrawable sprite can be used to define a region in the background that needs collision testing. It can also be used as an auxiliary collision region for a more complex sprite defined in another sprite. The default value of true is set when a sprite is created.

Void MoveTo(Integer x, Integer y)

Move the sprite to coordinate x,y.

Void MoveOffset(Integer xOffset, yOffset)

Move the sprite to the current position plus the xOffset and yOffset.

Void SetRegion(Object region)

Set the region of the sprite to the passed in region roRegion object. If one already is set, it is replaced.

Void SetData(TVAL data)

Associate user defined data with the sprite. The TVAL (typed value) can be any type including intrinsic types or objects.

TVAL GetData()

Returns any user data associated with the sprite. Set via SetData().

Returns invalid if there is no user data associated with this sprite.

Void Remove()

Remove the sprite from the managing roComposite object and delete the sprite.

Object CheckCollision()

Returns the first roSprite that this sprite collides with. The collision area is the entire sprite's bounding box, and the sprites must actually be overlapped to detect a collision. That is, if a fast moving sprite moves "through" another sprite w/o actually overlapping when this call is made, no collision is detected.

Object CheckMultipleCollisions()

Like CheckCollision but returns an array of all colliding sprites. If there are no collisions return invalid.

Void SetMemberFlags(Integer flags)

Sets flags to define the sprite membership.These flags are used with CollidableFlags to define what sprites are allowed to collide.

Enables "levels" of collision detection, as only sprites with a member flag bit that matches a collidable flag bit will be checked for collisions.

Void SetCollidableFlags(Integer flags)

Sets bits to determine what sprites will be checked for collisions. The sprites that are checked must have the corresponding bits sets in their MemberFlags.

Void OffsetRegion(Integer x, Integer y, Integer width, Integer height)

Calls Region.Offset() on this Sprite's region. Adjusts the part of an roRegion's bitmap that is being displayed as the sprite. Wrap is taken into consideration.

 

  • No labels