RenderSpriteStateFixed
From OxeyeWiki
(Difference between revisions)
Jeb (Talk | contribs)
(Created page with '{{VideoMethod | video.renderSpriteStateFixed(spriteId, x, y[, a, r, g, b[, clipLeft, clipTop, clipRight, clipBottom]]) | This is a special rendering method that is able to clip t...')
Newer edit →
(Created page with '{{VideoMethod | video.renderSpriteStateFixed(spriteId, x, y[, a, r, g, b[, clipLeft, clipTop, clipRight, clipBottom]]) | This is a special rendering method that is able to clip t...')
Newer edit →
Revision as of 09:07, 9 March 2009
|
video.renderSpriteStateFixed(spriteId, x, y[, a, r, g, b[, clipLeft, clipTop, clipRight, clipBottom]]) | ||
|
This is a special rendering method that is able to clip the sprite according to a clipping rectangle. In addition, this method will use point sampling instead of bilinear sampling of the source image. | ||
| Parameter | Expected Type | Description |
| spriteId | An integer | The sprite ID. |
| x | An integer | The x coordinate for the sprite's hotspot. |
| y | An integer | The y coordinate for the sprite's hotspot. |
| a | Optional integer | The alpha component of the diffuse color. Use this to blend the sprite with the background. |
| r | Optional integer | The red pigment of the diffuse color, defaults to 255. |
| g | Optional integer | The green pigment of the diffuse color, defaults to 255. |
| b | Optional integer | The blue pigment of the diffuse color, defaults to 255. |
| clipLeft | Optional integer | Sets the left clipping edge (inclusive). |
| clipTop | Optional integer | Sets the upper clipping edge (inclusive). |
| clipRight | Optional integer | Sets the right clipping edge (exclusive). |
| clipBottom | Optional integer | Sets the lower clipping edge (exclusive). |
| Returns | ||
|
Returns nothing. | ||
Example
-- render progress bar
local progress = timeSoFar / maxTime
local progressPixels = math.floor(progress * progressWidth)
video.renderSpriteStateFixed(progressSprite, x, y,
255, 255, 255, 255,
x, y, x + progressPixels, y + progressHeight)