Index
SuperSpriteSurface
SuperSprite
SuperSpriteGroup
SuperSpriteTile
SuperSpritePicture
SuperSpriteCollisionChecker
SuperSpriteBounds
SuperSpriteBoundsPoint
SuperSpriteBoundsCircle
SuperSpriteBoundsLine
SuperSpriteBoundsRect
SuperSpriteBoundsConvexPoly
TinrocketVector2D




SuperSpriteSurface
Inherits from: Rectangle

SuperSpriteSurface is a window control for displaying advanced 2D sprite animation.


Events

Name Parameters Result Description
FrameworkMessage messageCode as Integer, message as String This event is used to pass messages back to the developer that pertian to the state of the SuperSpriteSurface control or framework. Below are the current messageCode and their messages:

messageCode = 0, message = "Registration successful"
messageCode = 1, message = "Unregisted demo mode"
messageCode = 2, message = "Demo time limit reached"
messageCode = 3, message = "Alpha/Beta version expired"
NextFrame elapsedTime as Double SuperSpriteSurface fires this event for each frame animated. This is a place to change the Position, Rotation & Scale values of any attached SuperSprite objects. This event occurs before any attached SuperSprite.Sprites.NextFrame events.

Register ByRef UserName as String, ByRef ActivationCode as String The SuperSpriteSurface requires registration to remove the demo limitations. Assign the appropriate values to userName and activationCode that you received via the registration process.

This event fires before the control's Open event.

Important: It is your responsibility to keep your SuperSpriteSurface registration data private. Follow these helpful tips to prevent accidental release of your personal information:

1) Be sure not to include your User Name or Activation Code in any project, data files or code that you distribute. Tip: During the development process, rather than include your activation code in your source code, store it in a file on disk and load it during the register method:

activationCode = PreferencesFolder.Child("SSS Activation Code.txt").OpenAsTextFile.ReadAll

Now, when you distribute your project or code, you will not have to worry about having accidentaly released your Activation Code. Be sure the file that contains your registration data is located in place where it cannot be accidentally included with any files that you release with your project or code.

2) Take measures to hide or obfuscate your User Name and Activation Code in any built applications you distribute. This is because it may be possible for a hacker to find and extract your registration data. Example: Do not code your Activation Code as a plain string in your code:

activationCode = "D8CBE224"

Rather, try to hide the data, perhaps like this:

activationCode = "D" + Str(4+4) + "C" + "BE" + Str(224)

Unfortunately, any leaked registration data, whether intentional or accidental, found by SuperSpriteSurface's developer will have to be invalidated in future releases of SuperSpriteSurface. Replacement codes will not be given out. Registration codes found to be used in any application released by a company or individual other than the company or individual who is licensed to use the code will also have to be invalidated.

It is to your advantage to prevent accidental release of your registration data, and to take measures to prevent hackers from stealing that data.


Methods

Name Parameters Result Description
DoNextFrame Advances the SuperSpriteSurface by one frame.
IsRunning Boolean Returns TRUE if the SuperSpriteSurface is currently running.
Reset Resets the SuperSpriteSurface back to its opened state.
Run Tells the SuperSpriteSurface to begin animating. Animation is controlled by SuperSpriteSurface's internal animation controller, which runs in two modes: CPU hog or threaded mode. Threaded mode is enabled via the SuperSpriteSurface.Threaded property.
Stop Tells the SuperSprite Surface to stop animating after the current frame is finished.


Properties

Name Result Description
BackColor Color The color of the background (black by default).
Backdrop SuperSpritePicture If SuperSpriteSurface.ClearBackground is TRUE: SSS will draw the SuperSpritePicture referenced by this property before rendering each frame. The backdrop picture will be scaled to fill the entire SuperSpriteSurface area.

If this property is nil, SSS will draw the BackColor instead.
ClearBackground Boolean This property controls whether or not the SuperSpriteSurface graphics area is cleared of the previous contents before rendering the next frame.

Example: If your program is filling the entire SSS graphics area each frame (as with a SuperSpriteTile object) it is unecessary to clear the graphics area every frame. Turning off the clearing of the graphics area may results in a higher frame rate.
ClickToStop Boolean If TRUE, clicking the mouse will stop the SuperSpriteSurface animation.
CollisionChecker(0...n) SuperSpriteCollisionChecker Holds the active SuperSpriteCollisionChecker objects.
Depth Integer Color depth of the control.
MaxLagTime Double Sets the maximum allowed ellapsed time that is passed to the SuperSpriteSurface.NextFrame and SuperSprite.NextFrame events. For example, if this value is set to 0.5 (half a second) and the ellapsed time between the SuperSpriteSurface's current and last frame is 1.0 (one second), the NextFrame events will receive an ellapsed time value of 0.5.

This property is used to ensure that the SuperSpriteSurface will not "jump" too far ahead if is interupted by system events, such as the those caused by the user operating the application's menubar.

Not recommend for use with networked games.

The default value is 1.0.
Sprites SuperSpriteGroup This is a SuperSpriteGroup object that holds the active SuperSprite objects.
Threaded Boolean If TRUE, the animation controller will run in a thread. When SuperSpriteSurface is not running in a thread, it runs in a "tight-loop".
UserCancelToStop Boolean If TRUE, the user can press Command-period to stop the animation.

Notes:
Requires OpenGL to be installed on the computer.

For each frame, the sequence of events is as follows:
1) SupeSpriteSurface.NextFrame event
2) SupeSpriteSurface.Sprites.NextFrame events (in order of hiearchy)
3) SupeSpriteSurface.Sprites.Collision events
4) SuperSpriteSurface updates the screen

Known Issues:
Currently supported on Macintosh (Classic & OSX) only, not including Mach-O OS X applications (yet!).

If SSS is running in non-threaded mode, the SSS animation will pause when the application looses focus. This is to prevent the application from being "locked out", because the animation controller is running in a hard loop. This behavior will be addressed when REALbasic 5.5 becomes the minimum Rb version required to run SSS: Rb 5.5 introduces a DoEvents function to work around this issue.





SuperSpriteSurface

Inherits from: Rectangle

SuperSpriteSurface is a window control for displaying advanced 2D sprite animation.

Notes:
Requires OpenGL to be installed on the computer.

For each frame, the sequence of events is as follows:
1) SupeSpriteSurface.NextFrame event
2) SupeSpriteSurface.Sprites.NextFrame events (in order of hiearchy)
3) SupeSpriteSurface.Sprites.Collision events
4) SuperSpriteSurface updates the screen

Known Issues:
Currently supported on Macintosh (Classic & OSX) only, not including Mach-O OS X applications (yet!).

If SSS is running in non-threaded mode, the SSS animation will pause when the application looses focus. This is to prevent the application from being "locked out", because the animation controller is running in a hard loop. This behavior will be addressed when REALbasic 5.5 becomes the minimum Rb version required to run SSS: Rb 5.5 introduces a DoEvents function to work around this issue.





SuperSprite
SuperSprite is the object type that is animated by SuperSpriteSurface.


Events

Name Parameters Result Description
Collision otherSpriteBounds as SuperSpriteBounds, mySpriteBounds as SuperSpriteBounds This event fires when a collision has occured between the SuperSpriteBounds objects attached to their parent SuperSprite objects.
Constructor This event fires after a SuperSprite object has been instantiated and executed its class constructor. When the Constructor event is called, all the properties of SuperSprite that you might want to access (such as Position) have already been safely initialized.

The SuperSprite class has a constructor method that must fire upon object instantiation. This event is primarily for error protection and convience: REALbasic will not balk if you subclass a class and forget to call the super class's constructor.* By using this event for the majority of situations, you do not have to create a constructor for your SuperSprite subclass and remember to call the super class's constructor.

*the exception is with Window subclasses. REALbasic smartly adds code in subclassed Window constructors to call the constructor of the parent class.
NextFrame surface as SuperSpriteSurface, elapsedTime as Double Boolean This event fires for each frame SuperSpriteSurface animate. This is the best place to change your Position, Rotation & Scale values.

Note: the elapsedTime value will change from frame to frame. To create smooth, consistent motion as the frame rate varies, multiply your changes by the elapsedTime value. See the SuperSpriteSurface demos for actual examples.

Returning TRUE from this event informs the SuperSpriteSurface that the cache containing the absolute (i.e., relative to the ÒworldÓ) Position, Scale & Rotation of this object is up-to-date and does not need updating.

Example 1: This cache is used by SuperSpriteSurface's collision detection routines. You will save computation time by returning TRUE if your SuperSprite object does not move during the current SuperSprite.NextFrame event. Be careful: If your SuperSprite object is contained in a SuperSpriteGroup which has just been moved, scaled or rotated, you should return FALSE to update the absolute Position, Scale & Rotation values for the current object.

Example 2 (Advanced): Return TRUE if you have changed the position of your SuperSprite object but want other SuperSprite objects to use the previous AbsolutePosition during their NextFrame events. Be careful: do not use this technique if the current SuperSprite has any SuperSpritePicture objects registered with the collision detection system. (See explaination in Example 1.)


Methods

Name Parameters Result Description
AbsolutePosition TinrocketVector2D Returns the position of the SuperSprite relative to its position in the control's screen space.
AbsoluteRotation Double Returns the rotation of the SuperSprite relative to its position in the control's screen space.
AbsoluteScale TinrocketVector2D Returns the rotation of the SuperSprite relative to its position in the control's screen space.
GetBounds groupName as String SuperSpriteBounds Returns the SuperSpriteBounds object contained in the SuperSprite.Bounds() property whose SuperSpriteBounds.Name property matches the GroupName Parameter.
MakeBoundsForImage groupName as String This method will create a SuperSpriteBoundsRect object for the current sprite's SuperSprite.Image property. The created SuperSpriteBoundsRect will be appended the SuperSprite object's SuperSprite.Bounds() array.

The created SuperSpriteBoundsRect will be positioned to "cover" the sprite's image, based on the current sprite's image size and current value of the SuperSprite.Center property.

This is a fast & easy way to add a bounding shape to a sprite, without having to spend a lot of time sizing and positioning it.
MakeBoundsForImage img as SuperSpritePicture, groupName as String SuperSpriteBounds This method will create a SuperSpriteBoundsRect object for the passed SuperSpritePicture object and return the SuperSpriteBoundsRect.

The created SuperSpriteBoundsRect will be positioned to "cover" the SuperSpritePicture object, based on the SuperSpritePicture object's size and current value of the SuperSprite.Center property
Parent SuperSpriteGroup Returns the SuperSpriteGroup that currently "owns" the SuperSprite.
SetCenterToImageCenter Sets the SuperSprite's Center property to appear visually centered on the SuperSpritePicture referenced in the SuperSprite's Image property.
SetCenterToImageCenter img as SuperSpritePicture Sets the SuperSprite's Center property to appear visually centered on the passed SuperSpritePicture.
SuperSprite Constructor. This method must be called from the overriding constructor method of any subclassed SuperSprite. (See note under the Constructor event.)
SuperSpriteSurfaceControl SuperSpriteSurface Returns the SuperSpriteSurface control that the SuperSprite is operating in.


Properties

Name Result Description
Bounds(0...n) SuperSpriteBounds This array stores the SuperSpriteBounds objects used by SuperSpriteSurface to determine collision.
Center TinrocketVector2D This property determines the amount of offset to apply to the SuperSprite rotated and drawn. This value in effect becomes the "center of rotation" for the SuperSprite. This value is applied after the SuperSprite's parent group has been positioned, rotated & scaled so this value is effected by these transformations.
DrawDebugBounds Boolean SuperSpriteSurface has a special feature to help you visualize the SuperSpriteBounds objects that are assigned to your SuperSprite objects: If this property is set to TRUE, the SuperSpriteBounds objects assigned to the current sprite are drawn on top of the sprite with partial transparency, aiding in the development and debugging of your SuperSpriteSurface application.
FillColor Color Controls the overall color/hue of the SuperSprite.Image object.

Example usage: To create variations of a single SuperSpritePicture object, you might use this property to customize the overall color of the shared SuperSpritePicture object between many SuperSprite objects. Or, you could use this property to temporarily change the color of a SuperSprite.Image object as an indication of a SuperSprite object's current state, such as damage.
Image SuperSpritePicture This property contains the current image that SuperSpriteSurface use to draw.
ImageFrame(0...n) SuperSpritePicture This array propery is present for convenience: It is a handy place to store animation frames. To make an item in the array the current SuperSprite image, assign it to SuperSprite.Image property.
Opacity Double Controls the overall opacity of the SuperSprite.Image object, including its alpha mask: 1.0 = 100% visible, 0.0 = 0% visible.

Example Usage: This property can be used to make a SuperSprite appear ghosted or fade in or fade out over time,
Position TinrocketVector2D The position of the SuperSprite, relative to it's parent SuperSpriteGroup.
Rotation Double The rotation, in degrees, of the SuperSprite. Rotation is relative to it's parent SuperSpriteGroup's rotation.
Scale Double The scale of the SuperSprite, relative to it's parent SuperSpriteGroup.

Notes:
SuperSprite objects can be instantiated directly or subclassed. The SuperSprite class is most powerful when subclassed because behavior specific to your game or application can be encapsulated.

To use a SuperSprite object, attach it to SuperSpriteSurface.Sprites object.





SuperSpriteGroup
Inherits from: SuperSprite

This is a SuperSprite subclass that allows you to hierarchically group SuperSprite objects.


Methods

Name Parameters Result Description
Append sprite as SuperSprite Append the passed SuperSprite object as a child of this object
Count Integer Return the number of child SuperSprite objects.
Item index as Integer SuperSprite Returns the child SuperSprite object at the passed index.
Remove index as Integer Removes the child SuperSprite object at the passed index.
Remove sprite as SuperSprite Removes the first child SuperSprite object who's reference matches that of the passed SuperSprite object.
RemoveAll sprite as SuperSprite Removes all child SuperSprite objects from the SuperSpriteGroup object.
Swap childIndexA as Integer, childIndexB as Integer Swaps the draw order of the two SuperSprite objects corresponding to the index numbers passed.

Notes:
SuperSpriteGroup is a very powerful SuperSprite subclass. This class allows you to nest a hierarchy of SuperSprite objects; these may be SuperSprite, SuperSpriteTile, or SuperSpriteGroup objects. The SuperSpriteGroup object's Position, Rotation & Scale properties effect the corresponding properties of any child objects.





SuperSpriteTile
Inherits from: SuperSprite

This is a SuperSprite subclass designed to tile & draw SuperSpritePicture objects.


Events

Name Parameters Result Description
GetTile X as integer, Y as integer, ByRef PictureOrientation as Integer SuperSpritePicture When the SuperSpriteTile determines that a particular tile location may be visible on screen, it fires the GetTile event. The SuperSpriteTile class will then cache the returned SuperSpritePicture object and use it for future drawing.

PictureOrientation determines which direction the top of the image faces when it is drawn and may be one of the following values:

0 = Up (Default)
1 = Right
2 = Bottom
3 = Left


Methods

Name Parameters Result Description
HorizontalCount Integer Returns the number of horizontal tiles.
SetTile TileX as Integer, TileY as integer, TilePicture as SuperSpritePicture, pictureOrientation as integer Set the image for the tile location passed.

PictureOrientation determines which direction the top of the image faces when it is drawn and may be one of the following values:

0 = Up (Default)
1 = Right
2 = Bottom
3 = Left
SuperSpriteTile hCount as Integer, vCount as Integer, hPixelSize as Integer, vPixelSize as Integer Constructor. The size of the SuperSpriteTile object is determined at instantiation. The first two parameters are the horizontal and vertical tile count; the second two parameters are the X & Y size of an individual tile, specified in pixels.
SuperSpriteTile Constructor. Creates a default SuperSpriteTile object with 1 64x64 pixel tile. Not very useful -- so don't forget to call the other SuperSpriteTile constructor method.
VerticalCount Integer Returns the number of vertical tiles.


Properties

Name Result Description
TileSize TinrocketVector2D Contains the X & Y dimensions, in pixels, of a tile. This property may be changed at runtime.
VisibleBottomTile Integer After culling, this is the Y location of the bottom-most visible tile.
VisibleLeftTile Integer After culling, this is the X location of the left-most visible tile.
VisibleRightTile Integer After culling, this is the X location of the right-most visible tile.
VisibleTopTile Integer After culling, this is the Y location of the top-most visible tile.

Notes:
SuperSpriteTile objects may be positioned, scaled & rotated like any other sprite. Collision detection is not supported.

SuperSpriteTile implements a culling & caching scheme. The culling scheme will not draw tile images that are out of view. The caching scheme stores previously drawn tile images. Culling occurs prior to rendering.

Known Issues:
The TileScreenPosition method is not yet implemented.





SuperSpritePicture
This class holds picture data for use with the SuperSpriteSurface control.


Methods

Name Parameters Result Description
SuperSpritePicture p as Picture, smooth as Boolean Constructor. Creates non-transparent picture data from the passed picture. The smooth parameter dertermines how the picture data is drawn when scaled or rotated: passing TRUE will result in linear interpolation, passing FALSE will result in nearest neighbor interpolation.
SuperSpritePicture p as Picture, m as Picture, smooth as Boolean Constructor. Creates picture data with transparency from the passed picture and mask. The smooth parameter dertermines how the picture data is drawn when scaled or rotated: passing TRUE will result in linear interpolation, passing FALSE will result in nearest neighbor interpolation.
SuperSpritePicture p as Picture, m as Picture Constructor. Creates picture data with transparency from the passed picture and mask. The default interpolation when the picture is scaled or rotated is nearest neighbor.
SuperSpritePicture p as Picture Constructor. Creates non-transparent picture data from the passed picture. The default interpolation when the picture is scaled or rotated is nearest neighbor.
SuperSpritePicture p as FolderItem Constructor. Creates non-transparent picture data from the passed folderItem, if that folder item points to a valid QuickTime image file. The default interpolation when the picture is scaled or rotated is nearest neighbor.
SuperSpritePicture p as FolderItem, m as FolderItem Constructor. Creates picture data with transparency from the passed folderItems, if that folder item points to a valid QuickTime image file. The default interpolation when the picture is scaled or rotated is nearest neighbor.
SuperSpritePicture p as FolderItem, smooth as Boolean Constructor. Creates non-transparent picture data from the passed folderItems, if that folder item points to a valid QuickTime image file. The smooth parameter dertermines how the picture data is drawn when scaled or rotated: passing TRUE will result in linear interpolation, passing FALSE will result in nearest neighbor interpolation.
SuperSpritePicture p as FolderItem, m as FolderItem, smooth as Boolean Constructor. Creates picture data with transparency from the passed folderItems, if that folder item points to a valid QuickTime image file. The smooth parameter dertermines how the picture data is drawn when scaled or rotated: passing TRUE will result in linear interpolation, passing FALSE will result in nearest neighbor interpolation.
SuperSpritePicture mb as MemoryBlock, imageWidth as integer, imageheight as integer, smooth as boolean Constructor. Creates picture data with optional transparency from the memoryBlock.

The entire image needs to be stored as a sequence of horizontal rows of pixels, starting from the upper left of the image continuing to the lower right of the image, Each pixel MUST be stored in the following way: each RGB image pixel = 3 bytes or each RGBA image pixel = 4 bytes.

The imageWidth and imageHeight parameters MUST be powers of two (i.e., 2, 4, 8, 16, 32, etc.). and the Length of the BinaryStream MUST be, (imageWidth*imageHeight*3) for non-transparent pictures or (imageWidth*imageHeight*4) for pictures with transparency.

This is the fastest way to create a SuperSpritePicture object: the MemoryBlock data is passed directly directly to OpenGL.

The smooth parameter dertermines how the picture data is drawn when scaled or rotated: passing TRUE will result in linear interpolation, passing FALSE will result in nearest neighbor interpolation.
SuperSpritePicture bs as BinaryStream, imageWidth as integer, imageheight as integer, smooth as boolean Constructor. Creates picture data with optional transparency from the passed BinaryStream object.

The entire image needs to be stored as a sequence of horizontal rows of pixels, starting from the upper left of the image continuing to the lower right of the image, Each pixel MUST be stored in the following way: each RGB image pixel = 3 bytes or each RGBA image pixel = 4 bytes.

The imageWidth and imageHeight parameters MUST be powers of two (i.e., 2, 4, 8, 16, 32, etc.). and the Length of the BinaryStream MUST be, (imageWidth*imageHeight*3) for non-transparent pictures or (imageWidth*imageHeight*4) for pictures with transparency.

This is the second fastest way to create a SuperSpritePicture object: the BinaryStream data is loaded from disk and passed directly directly to OpenGL.

The smooth parameter dertermines how the picture data is drawn when scaled or rotated: passing TRUE will result in linear interpolation, passing FALSE will result in nearest neighbor interpolation.


Properties

Name Result Description
Height Integer Height of the picture data.
Width Integer Width of the picture data.

Notes:
SuperSpriteSurface is based on OpenGL. In order for it to draw picture data, that picture must be in a format that is compatible with OpenGL. SuperSpritePicture objects hold picture data that is compatible with OpenGL. This picture data may either be 24 bit (RGB) or 32 bit (RGB+Alpha). Picture data must be provided to the SuperSpritePicture object when it is instantiated by passing a picture (and optional mask) source to its constructor.





SuperSpriteCollisionChecker
This class is used to check for collisions between groups of SuperSpriteBounds objects.


Methods

Name Parameters Result Description
AddGroup groupName as String Pass the GroupName of a SuperSpriteBounds object. The SuperSpriteCollisionChecker object will create a private object of the type SuperSpriteCollisionGroup and append it to its Group array property.
SuperSpriteCollisionChecker surface as SuperSpriteSurface Constructor. Pass in a reference to SuperSpriteSurface control where this object will be used.

Notes:
SuperSpriteSurface limits the number of collision detection calculations that are performed by using SuperSpriteCollisionChecker objects. These objects are created by you, the framework user, to define pairs or sets of SuperSpriteBounds objects that will participate in collision detection at runtime.

SuperSpriteCollisionChecker objects can be created at, before or even during runtime.

First, create a SuperSpriteCollisionChecker object, then give the object a list of collision group names (as strings) via the AddGroup method. A special object is created by SuperSpriteCollisionChecker and appended to its Group() property.

When your SuperSpriteCollisionChecker object is fully populated with the GroupNames that will be in your collision set, append this object to the SuperSpriteSurface.CollisionChecker() property.

While the SuperSpriteSurface is running, each SuperSpriteCollisionChecker object will find (on-the-fly!) the appropriate SuperSpriteBounds objects (based on their GroupName) belonging to the SuperSprite objects contained within the SuperSpriteSurface.Sprites hierarchy. When a collision is found, a Collision event is dispatched to the appropriate SuperSprite objects.

If the Group() property contains one element (i.e. AddGroup was called only once) then collision detection is performed between the members of that one group.

When the Group list contains more than one item, collision detection is performed between members of each group and the members of the other groups, but not between members of the same group.

(See the read me file: "Collision Detection READ ME.txt" for a description of how the collision detection system works.)





SuperSpriteBounds
Abstract. Classes inheriting from this class implement specific shape types used by the collision detection system.


Methods

Name Parameters Result Description
Owner SuperSprite Returns the SuperSprite object that owns this object.
SuperSpriteBounds s as SuperSprite Constructor. Applies to all subclasses.
Update Abstract. Functionality overriden by subclassed objects.


Properties

Name Result Description
DebugColor Color The color that the SuperSpriteBounds will use to draw itself if the owning SuperSprite object's .DrawDebugBounds property is set to TRUE. A default transparency of 0.5 is used.
GroupName String This property is used by the collision detection system and SuperSpriteCollisionChecker objects to determine which set of SuperSpriteBounds objects are checked for collision.





SuperSpriteBoundsPoint
Inherits from: SuperSpriteBounds

A point in 2D space. This is the simplest type of SuperSpriteBounds object.


Methods

Name Parameters Result Description
Update Call this method after changing the following properties: Center.


Properties

Name Result Description
Center TinrocketVector2D Position of the SuperSpriteBoundsPoint, relative the owning SuperSprite object's coordinate system (Position, Rotation & Scale).

Notes:
When detecting collision with another SuperSpriteBoundsPoint object, a default width and height of 1.0 is assumed.





SuperSpriteBoundsCircle
Inherits from: SuperSpriteBounds

A circular area in 2D space.


Methods

Name Parameters Result Description
Update Call this method after changing the following properties: Center, Radius.


Properties

Name Result Description
Center TinrocketVector2D Position of the SuperSpriteBoundsCircle, relative the owning SuperSprite object's coordinate system (Position, Rotation & Scale).
Radius Double The radius of the SuperSpriteBoundsCircle, relative the owning SuperSprite object's coordinate system (Scale).





SuperSpriteBoundsLine
Inherits from: SuperSpriteBounds

A line segment in 2D space.


Methods

Name Parameters Result Description
Update Call this method after changing the following properties: Vertex(1).


Properties

Name Result Description
Vertex(1) TinrocketVector2D Defines the two points that define the SuperSpriteBoundsLine, relative the owning SuperSprite object's coordinate system (Position, Rotation & Scale).





SuperSpriteBoundsRect
Inherits from: SuperSpriteBounds

A rectangular area in 2D space.


Methods

Name Parameters Result Description
Update Call this method after changing the following properties: Center, Height, Width.


Properties

Name Result Description
Center TinrocketVector2D Position of the SuperSpriteBoundsRect, relative the owning SuperSprite object's coordinate system (Position, Rotation & Scale).
Height Double Height of the SuperSpriteBoundsRect, relative the owning SuperSprite object's coordinate system (Scale).
Width Double Width of the SuperSpriteBoundsRect, relative the owning SuperSprite object's coordinate system (Scale).





SuperSpriteBoundsConvexPoly
Inherits from: SuperSpriteBounds

A convex polygon.


Methods

Name Parameters Result Description
Update Call this method after changing the following properties: Vertex.


Properties

Name Result Description
Vertex(0...n) TinrocketVector2D Defines the two points that define the SuperSpriteBoundsConvexPoly, relative the owning SuperSprite object's coordinate system (Position, Rotation & Scale).

A minimum of 3 points, appended in clockwise order, are required for a valid SuperSpriteBoundsConvexPoly object.

Notes:
Points that make up the Vetex() property must be defined in clockwise order. "Clockwise" is defined as follows:
Imagine your convex polygon as having a center point within itself. The points that comprise the vertices of your convex polygon must be in the clockwise order that they would appear around the center point.

Future versions of SSS will include a function to auto-order the vertices.





TinrocketVector2D
2D vector class. This class is used in the SuperSpriteSurface framework for various 2D vector & point duties.


Methods

Name Parameters Result Description
Add v as TinrocketVector2D Adds the parameter to the current TinrocketVector2D object.
Add v1 as TinrocketVector2D, v2 as TinrocketVector2D Sets the current TinrocketVector2D to the sume of the two parameters.
Add vx as Double, vy as Double Adds the parameters to the current TinrocketVector2D object.
AngleAsDegrees Double Returns the angle of the current TinrocketVector2D in degrees. Slower than the method, AngleAsRadians.
AngleAsRadians Returns the angle of the current TinrocketVector2D in radians. Faster than the method, AngleAsDegrees.
DotProduct v as TinrocketVector2D Returns the dot product of the current object and the parameter.
Length Double Returns the length of the current TinrocketVector2D.
LengthSquared Returns the length of the current TinrocketVector2D. LengthSquared is faster then Length.
Negate negates the current X and Y properties.
Normalize Sets the length of the current TinrocketVector2D to 1.0.
Perp TinrocketVector2D Returns as TinrocketVector2D object that is perpendicular to the current TinrocketVector2D.
RotateByDegrees degrees as Double Rotates the current TinrocketVector2D by the number of degrees passed. Slower than the method, RotateByRadians.
RotateByRadians radians as Double Rotates the current TinrocketVector2D by the number of radians passed. Faster than the method, RotateByDegrees.
Scale scale as Double Multiples the X and Y properties by the value passed.
Set vx as Double, vy as Double Sets the X and Y properties by the values passed.
Set v as TinrocketVector2D Sets the X and Y properties to the X and Y properties of the passed TinrocketVector2D object.
Subtract v as TinrocketVector2D Subtracts the passed TinrocketVector2D object from the current TinrocketVector2D object.
Subtract vx as Double, vy as Double Subtracts the passed scalar values from the current TinrocketVector2D object.
TinrocketVector2D Constructor.
TinrocketVector2D v as TinrocketVector2D Constructor.
TinrocketVector2D vx as Double, vy as Double Constructor.


Properties

Name Result Description
X Double The scalar value for the X dimension.
Y Double The scalar value for the Y dimension.

Notes:
This class is part of the general Tinrocket graphics library; designated as such by the Tinrocket namespace. This is the only class from the Tinrocket graphics library that has been released to date.