Description of Methods
MoveTo(x as Integer, y as Integer) as Void
Move the sprite to coordinate x,y.
MoveOffset(xOffset as Integer, yOffset as Integer) as Void
Move the sprite to the current position plus the xOffset and yOffset.
GetX() as Integer
Returns the x coordinate of the sprite.
GetY() as Integer
Returns the y coordinate of the sprite.
SetZ(z as Integer) as Void
Sets the z value of the sprite. The z value defines the order in which sprites are drawn. Sprites with higher z values are drawn after (in front of) sprites with lower z values. The default z value is 0.
GetZ() as Integer
Returns the z value of the sprite.
SetDrawableFlag(enable as Boolean) as Void
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. The default value is true.
GetDrawableFlag() as Boolean
Returns the value of the Drawable Flag.
SetMemberFlags(flags as Integer) as Void
Sets flags to define the sprite membership.These flags are used with CollidableFlags to define what sprites are allowed to collide. The default value is 1.
Enables "levels" of collision detection, as only sprites with a member flag bit that matches a collidable flag bit will be checked for collisions.
GetMemberFlags() as Integer
Returns the value of member flags variable.
SetCollidableFlags(flags as Integer) as Void
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. The default value is 1.
GetCollidableFlags() as Integer
Returns the value of collidable flags variable.
SetRegion(region as Object) as Void
Set the region of the sprite to the passed in region roRegion object. If one already is set, it is replaced.
GetRegion() as Object
Returns an roRegion object that specifies the region of a bitmap that is the sprite's display graphic.
OffsetRegion(x as Integer, y as Integer, width as Integer, height as Integer) as Void
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.
SetData(data as Dynamic) as Void
Associate user defined data with the sprite. The data can be any type including intrinsic types or objects.
GetData() as Dynamic
Returns any user data associated with the sprite previously set via SetData().
Returns invalid if there is no user data associated with this sprite.
CheckCollision() as Object
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 without actually overlapping when this call is made, no collision is detected.
CheckMultipleCollisions() as Object
Like CheckCollision but returns an array of all colliding sprites. If there are no collisions return invalid.
Remove() as Void
Remove the sprite from the managing roComposite object and delete the sprite.