Libraries.Game.Graphics.TextureRegion Documentation

The TextureRegion class is made up of two features: a Texture, and a rectangular space on the screen. This class is primarily for internal use in the game engine. For a class with the same functionality, users are recommended to use the Drawable class. Any texture defined by this class will be located on the screen by a coordinate system. A coordinate of (0,0) is the very botom left corner of the screen. Increasing the first value will make the texture move to the right. Increasing the second value will make the texture move up the scree

Inherits from: Libraries.Language.Object, Libraries.Game.Disposable

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
CopyTextureRegion(Libraries.Game.Graphics.TextureRegion region)This action copies the information from the given TextureRegion into this TextureRegio
CopyTextureRegion(Libraries.Game.Graphics.TextureRegion region, integer x, integer y, integer width, integer height)This action copies the information from a given TextureRegion at the given coordinates to the given width and height onto this TextureRegio
Dispose()This action will dispose of the Texture stored in this TextureRegio
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
FlipX()This action flips the TextureRegion along the x-axi
FlipY()This action flips the TextureRegion along the y-axi
GetBottomSide()This action returns where the TextureRegion begins the bottom edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur
GetHashCode()This action gets the hash code for an object.
GetLeftSide()This action returns where the TextureRegion begins the left edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur
GetRegionHeight()This action returns the height of the regio
GetRegionWidth()This action returns the width of the TextureRegio
GetRegionX()This action returns the x coordinate where the region begins on the Textur
GetRegionY()This action returns the y coordinate where the region begins on the Textur
GetRightSide()This action returns where the TextureRegion begins the right edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur
GetTextureField()This action returns the texture held by this TextureRegio
GetTopSide()This action returns where the TextureRegion begins the top edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur
IsFlippedX()This action returns whether or not the TextureRegion has been flipped along the x-axi
IsFlippedY()This action returns whether or not the TextureRegion has been flipped along the y-axi
LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture, number left, number right, number top, number bottom)This action loads part of a texture into this TextureRegion, using the given percentage coordinates from 0 to 1 of the texture to loa
LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture, integer width, integer height)This action loads part of a texture into the TextureRegion, starting from the bottom left corner to the given width and heigh
LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture)This action loads an entire texture into the TextureRegio
LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture, integer x, integer y, integer width, integer height)This action loads part of a texture into this TextureRegion, starting from the given x,y coordinates of the Texture to the given width and heigh
SetBottomSide(number bottom)This action sets where the TextureRegion begins the bottom edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur
SetLeftSide(number left)This action sets where the TextureRegion begins the left edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur
SetRegion(Libraries.Game.Graphics.TextureRegion region)Sets the region of this TextureRegion to be the same as the region of a different TextureRegio
SetRegion(integer x, integer y, integer width, integer height)Sets the region of this TextureRegion to start at the given x,y coordinates and go to the given width and heigh
SetRegion(number left, number top, number right, number bottom)This action will set the region of this TextureRegion to begin at the bottom left of the Texture to the top right, where 0 represents the far left or bottom, and 1 represents the far right or to
SetRegion(Libraries.Game.Graphics.TextureRegion region, integer x, integer y, integer width, integer height)Sets the region of this TextureRegion to begin at the start of the given TextureRegion's plus an offset by the given x,y values, and stretching to the given width and heigh
SetRegionHeight(integer height)This action sets the height of the regio
SetRegionWidth(integer width)This action sets the width of the TextureRegio
SetRegionX(integer x)This action sets the x coordinate where the region begins on the Textur
SetRegionY(integer y)This action sets the y coordinate where the region begins on the Textur
SetRightSide(number right)This action sets where the TextureRegion begins the left edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur
SetTexture(Libraries.Game.Graphics.Texture newTexture)This action sets the texture used by this TextureRegion to the given textur
SetTopSide(number top)This action sets where the TextureRegion begins the top edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smalle

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

CopyTextureRegion(Libraries.Game.Graphics.TextureRegion region)

This action copies the information from the given TextureRegion into this TextureRegio

Parameters

CopyTextureRegion(Libraries.Game.Graphics.TextureRegion region, integer x, integer y, integer width, integer height)

This action copies the information from a given TextureRegion at the given coordinates to the given width and height onto this TextureRegio

Parameters

Dispose()

This action will dispose of the Texture stored in this TextureRegio

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

FlipX()

This action flips the TextureRegion along the x-axi

FlipY()

This action flips the TextureRegion along the y-axi

GetBottomSide()

This action returns where the TextureRegion begins the bottom edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur

Return

number:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode

Return

integer: The integer hash code of the object.

GetLeftSide()

This action returns where the TextureRegion begins the left edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur

Return

number:

GetRegionHeight()

This action returns the height of the regio

Return

integer:

GetRegionWidth()

This action returns the width of the TextureRegio

Return

integer:

GetRegionX()

This action returns the x coordinate where the region begins on the Textur

Return

integer:

GetRegionY()

This action returns the y coordinate where the region begins on the Textur

Return

integer:

GetRightSide()

This action returns where the TextureRegion begins the right edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur

Return

number:

GetTextureField()

This action returns the texture held by this TextureRegio

Return

Libraries.Game.Graphics.Texture:

GetTopSide()

This action returns where the TextureRegion begins the top edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur

Return

number:

IsFlippedX()

This action returns whether or not the TextureRegion has been flipped along the x-axi

Return

boolean:

IsFlippedY()

This action returns whether or not the TextureRegion has been flipped along the y-axi

Return

boolean:

LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture, number left, number right, number top, number bottom)

This action loads part of a texture into this TextureRegion, using the given percentage coordinates from 0 to 1 of the texture to loa

Parameters

LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture, integer width, integer height)

This action loads part of a texture into the TextureRegion, starting from the bottom left corner to the given width and heigh

Parameters

LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture)

This action loads an entire texture into the TextureRegio

Parameters

LoadTextureRegion(Libraries.Game.Graphics.Texture newTexture, integer x, integer y, integer width, integer height)

This action loads part of a texture into this TextureRegion, starting from the given x,y coordinates of the Texture to the given width and heigh

Parameters

SetBottomSide(number bottom)

This action sets where the TextureRegion begins the bottom edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur

Parameters

SetLeftSide(number left)

This action sets where the TextureRegion begins the left edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur

Parameters

SetRegion(Libraries.Game.Graphics.TextureRegion region)

Sets the region of this TextureRegion to be the same as the region of a different TextureRegio

Parameters

SetRegion(integer x, integer y, integer width, integer height)

Sets the region of this TextureRegion to start at the given x,y coordinates and go to the given width and heigh

Parameters

SetRegion(number left, number top, number right, number bottom)

This action will set the region of this TextureRegion to begin at the bottom left of the Texture to the top right, where 0 represents the far left or bottom, and 1 represents the far right or to

Parameters

SetRegion(Libraries.Game.Graphics.TextureRegion region, integer x, integer y, integer width, integer height)

Sets the region of this TextureRegion to begin at the start of the given TextureRegion's plus an offset by the given x,y values, and stretching to the given width and heigh

Parameters

SetRegionHeight(integer height)

This action sets the height of the regio

Parameters

SetRegionWidth(integer width)

This action sets the width of the TextureRegio

Parameters

SetRegionX(integer x)

This action sets the x coordinate where the region begins on the Textur

Parameters

SetRegionY(integer y)

This action sets the y coordinate where the region begins on the Textur

Parameters

SetRightSide(number right)

This action sets where the TextureRegion begins the left edge of its region on the stored texture, where 0 is the far left of the texture and 1 is the far right side of the textur

Parameters

SetTexture(Libraries.Game.Graphics.Texture newTexture)

This action sets the texture used by this TextureRegion to the given textur

Parameters

SetTopSide(number top)

This action sets where the TextureRegion begins the top edge of its region on the stored texture, where 0 is the far bottom of the texture and 1 is the far top side of the textur

Parameters