Class Sprite

Sprite

Methods

Sprite:GetAnimationLengthSeconds () Returns the length of the animation in seconds.
Sprite:GetDecodeMovie () Gets whether the Sprite should call the decode function for its texture during updates.
Sprite:GetNumStates () Return the number of states this Sprite has.
Sprite:GetState () Returns the Sprite's current state (frame number in a multi-frame sprite).
Sprite:GetTexture () Returns the Sprite's texture.
Sprite:LinearFrames () Returns a Frames table consisting of iNumFrames frames lasting for a total of fSeconds seconds.
Sprite:Load (string, sPath) If sPath is nil, then unload the texture.
Sprite:LoadBackground (string, sPath) Load the song background texture at sPath.
Sprite:LoadBanner (string, sPath) Load the song banner texture at sPath.
Sprite:LoadFromCached (string, sType, string, sPath) Loads the image of type sType from the cache based on sPath.
Sprite:LoadFromCurrentSongBackground () Loads the background from the current Song or the first Trail entry.
Sprite:LoadFromSongBackground (song) Load the texture for Song background.
Sprite:LoadFromSongBanner (song) Load the texture for Song banner.
Sprite:SetCustomImageRect (float, fLeft, float, fTop, float, fRight, float, fBottom) Sets the custom image rectangle.
Sprite:SetCustomPosCoords (float, ulx, float, uly, float, llx, float, lly, float, lrx, float, lry, float, urx, float, ury) Sets custom offsets for the corners of the Sprite.
Sprite:StopUsingCustomPosCoords () Turns off the custom pos coords for the sprite.
Sprite:SetDecodeMovie (bool, decode) Sets whether the Sprite should call the decode function for its texture during updates.
Sprite:SetEffectMode (EffectMode, mode) Set the to mode.
Sprite:SetSecondsIntoAnimation (float, fSeconds) Sets the number of seconds into the animation to fSeconds.
Sprite:SetStateProperties (table) Sets the properties of the states of the sprite.
Sprite:SetTexture (RageTexture, texture) Set the texture to texture.
Sprite:addimagecoords (float, fX, float, fY) XXX: how does this work?
Sprite:customtexturerect (float, fLeft, float, fTop, float, fRight, float, fBottom) Allows the themer to set a custom texture rectangle that effects the way the texture is drawn.
Sprite:get_use_effect_clock_for_texcoords () Returns true if the sprite is using the effect clock for texcoordvelocity.
Sprite:loop (bLoop) Call loop on the RageTexture
Sprite:position (fPos) Call position on the RageTexture
Sprite:rate (fRate) Call rate on the RageTexture
Sprite:scaletoclipped (float, fWidth, float, fHeight) Scale the Sprite to width fWidth and height fHeight clipping if the dimensions do not match.
Sprite:setstate (iNewState) Set the Sprite's state to iNewState.
Sprite:set_use_effect_clock_for_texcoords (bool, use) If use is true, then the sprite will use the effect clock for texcoordvelocity.
Sprite:stretchtexcoords (float, fX, float, fY) XXX: What does this do?
Sprite:texcoordvelocity (float, fVelX, float, fVelY) Set the texture coordinate velocity which controls how the Sprite changes as it animates.
Sprite:CropTo (float, fWidth, float, fHeight) Crops the Sprite to fWidthxfHeight.
Sprite:cropto (float, fWidth, float, fHeight) Alias for CropTo
Sprite:SetAllStateDelays (float, fRate) Sets all the state delays to fRate.


Methods

Sprite:GetAnimationLengthSeconds ()
Returns the length of the animation in seconds.

Returns:

    float
Sprite:GetDecodeMovie ()
Gets whether the Sprite should call the decode function for its texture during updates.

Returns:

    bool
Sprite:GetNumStates ()
Return the number of states this Sprite has.

Returns:

    int
Sprite:GetState ()
Returns the Sprite's current state (frame number in a multi-frame sprite).

Returns:

    int
Sprite:GetTexture ()
Returns the Sprite's texture.

Returns:

    RageTexture
Sprite:LinearFrames ()
Returns a Frames table consisting of iNumFrames frames lasting for a total of fSeconds seconds. This function is not a member function and should be used as Frames = Sprite.LinearFrames( 5, 2.6 ).

Returns:

    Frames
Sprite:Load (string, sPath)
If sPath is nil, then unload the texture. Otherwise, load the texture at path sPath.

Parameters:

  • string
  • sPath

Returns:

    void
Sprite:LoadBackground (string, sPath)
Load the song background texture at sPath.

Parameters:

  • string
  • sPath

Returns:

    void
Sprite:LoadBanner (string, sPath)
Load the song banner texture at sPath.

Parameters:

  • string
  • sPath

Returns:

    void
Sprite:LoadFromCached (string, sType, string, sPath)

Loads the image of type sType from the cache based on sPath.

    Internal types: "Banner", "Background", "CDTitle", "Jacket", "CDImage" and "Disc".

Parameters:

  • string
  • sType
  • string
  • sPath

Returns:

    void
Sprite:LoadFromCurrentSongBackground ()
Loads the background from the current Song or the first Trail entry.

Returns:

    void
Sprite:LoadFromSongBackground (song)
Load the texture for Song background.

Parameters:

  • song Song

Returns:

    void
Sprite:LoadFromSongBanner (song)
Load the texture for Song banner.

Parameters:

  • song Song

Returns:

    void
Sprite:SetCustomImageRect (float, fLeft, float, fTop, float, fRight, float, fBottom)
Sets the custom image rectangle. (Works in image pixel space.)

Parameters:

  • float
  • fLeft
  • float
  • fTop
  • float
  • fRight
  • float
  • fBottom

Returns:

    void
Sprite:SetCustomPosCoords (float, ulx, float, uly, float, llx, float, lly, float, lrx, float, lry, float, urx, float, ury)

Sets custom offsets for the corners of the Sprite. Coordinates are paired,

    corner order is upper left, lower left, lower right, upper right.

Parameters:

  • float
  • ulx
  • float
  • uly
  • float
  • llx
  • float
  • lly
  • float
  • lrx
  • float
  • lry
  • float
  • urx
  • float
  • ury

Returns:

    void
Sprite:StopUsingCustomPosCoords ()
Turns off the custom pos coords for the sprite.

Returns:

    void
Sprite:SetDecodeMovie (bool, decode)
Sets whether the Sprite should call the decode function for its texture during updates.

Parameters:

  • bool
  • decode

Returns:

Sprite:SetEffectMode (EffectMode, mode)
Set the to mode.

Parameters:

  • EffectMode
  • mode

Returns:

    void
Sprite:SetSecondsIntoAnimation (float, fSeconds)
Sets the number of seconds into the animation to fSeconds.

Parameters:

  • float
  • fSeconds

Returns:

    void
Sprite:SetStateProperties (table)

Sets the properties of the states of the sprite. The properties table is identical to the "Frames" table that can be put in the sprite when calling Def.Sprite.

    Example:<br />
    {{Frame= 0, Delay= .016, {0, 0}, {.25, .25}},<br />
    {Frame= 1, Delay= .016, {0, 0}, {.25, .25}},<br />
    {Frame= 2, Delay= .016, {0, 0}, {.25, .25}},<br />
    {Frame= 3, Delay= .016, {0, 0}, {.25, .25}},<br />
    }<br />
    Frame is optional, defaulting to 0.<br />
    Delay is optional, defaulting to 0.<br />
    The two tables are optional upper left and lower right corners of the fraction of the frame to use.  The example makes the sprite only use the upper left corner of each frame.<br />
    Simpler example:<br />
    {{Frame= 0, Delay= .016}, {Frame= 1, Delay= .016}, {Frame= 2, Delay= .016}, {Frame= 3, Delay= .016}}<br />
    This example makes the sprite use the whole of each frame.

Parameters:

  • table

Returns:

    void
Sprite:SetTexture (RageTexture, texture)
Set the texture to texture.

Parameters:

  • RageTexture
  • texture

Returns:

    void
Sprite:addimagecoords (float, fX, float, fY)
XXX: how does this work?

Parameters:

  • float
  • fX
  • float
  • fY

Returns:

    void
Sprite:customtexturerect (float, fLeft, float, fTop, float, fRight, float, fBottom)
Allows the themer to set a custom texture rectangle that effects the way the texture is drawn.

Parameters:

  • float
  • fLeft
  • float
  • fTop
  • float
  • fRight
  • float
  • fBottom

Returns:

    void
Sprite:get_use_effect_clock_for_texcoords ()
Returns true if the sprite is using the effect clock for texcoordvelocity.

Returns:

    bool
Sprite:loop (bLoop)
Call loop on the RageTexture

Parameters:

  • bLoop

Returns:

    bool
Sprite:position (fPos)
Call position on the RageTexture

Parameters:

  • fPos

Returns:

    bool
Sprite:rate (fRate)
Call rate on the RageTexture

Parameters:

  • fRate

Returns:

    bool
Sprite:scaletoclipped (float, fWidth, float, fHeight)
Scale the Sprite to width fWidth and height fHeight clipping if the dimensions do not match.

Parameters:

  • float
  • fWidth
  • float
  • fHeight

Returns:

    void
Sprite:setstate (iNewState)
Set the Sprite's state to iNewState.

Parameters:

  • iNewState

Returns:

    void
Sprite:set_use_effect_clock_for_texcoords (bool, use)
If use is true, then the sprite will use the effect clock for texcoordvelocity.

Parameters:

  • bool
  • use

Returns:

Sprite:stretchtexcoords (float, fX, float, fY)
XXX: What does this do?

Parameters:

  • float
  • fX
  • float
  • fY

Returns:

    void
Sprite:texcoordvelocity (float, fVelX, float, fVelY)
Set the texture coordinate velocity which controls how the Sprite changes as it animates. A velocity of 1 makes the texture scroll all the way once per second.

Parameters:

  • float
  • fVelX
  • float
  • fVelY

Returns:

    void
Sprite:CropTo (float, fWidth, float, fHeight)
Crops the Sprite to fWidthxfHeight.

Parameters:

  • float
  • fWidth
  • float
  • fHeight

Returns:

    void
Sprite:cropto (float, fWidth, float, fHeight)
Alias for CropTo

Parameters:

  • float
  • fWidth
  • float
  • fHeight
Sprite:SetAllStateDelays (float, fRate)
Sets all the state delays to fRate. Useful for Sprites that need to change by BPM (e.g. Tran from DDR 5th Mix, the cube from DS EuroMix 2).

Parameters:

  • float
  • fRate

Returns:

    void
generated by LDoc 1.4.6 Last updated 2023-01-15 03:25:11