RenderSpriteStateFixed
From OxeyeWiki
(Difference between revisions)
(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...') |
|||
Line 1: | Line 1: | ||
{{VideoMethod | {{VideoMethod | ||
| | | | ||
- | video.renderSpriteStateFixed(spriteId, x, y[, a, r, g, b[, clipLeft, clipTop, | + | video.renderSpriteStateFixed(spriteId, x, y[, a, r, g, b[, clipLeft, clipTop, clipWidth, clipHeight]]) |
| | | | ||
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. | 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. | ||
Line 14: | Line 14: | ||
{{MethodParam|clipLeft|Optional integer|Sets the left clipping edge (inclusive).}} | {{MethodParam|clipLeft|Optional integer|Sets the left clipping edge (inclusive).}} | ||
{{MethodParam|clipTop|Optional integer|Sets the upper clipping edge (inclusive).}} | {{MethodParam|clipTop|Optional integer|Sets the upper clipping edge (inclusive).}} | ||
- | {{MethodParam| | + | {{MethodParam|clipWidth|Optional integer|Sets the width of the clipping.}} |
- | {{MethodParam| | + | {{MethodParam|clipHeight|Optional integer|Sets the height of the clipping.}} |
| | | | ||
Returns nothing. | Returns nothing. | ||
Line 27: | Line 27: | ||
video.renderSpriteStateFixed(progressSprite, x, y, | video.renderSpriteStateFixed(progressSprite, x, y, | ||
255, 255, 255, 255, | 255, 255, 255, 255, | ||
- | x, y, | + | x, y, progressPixels, progressHeight) |
</pre> | </pre> |
Latest revision as of 13:57, 23 March 2009
video.renderSpriteStateFixed(spriteId, x, y[, a, r, g, b[, clipLeft, clipTop, clipWidth, clipHeight]]) | ||
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). |
clipWidth | Optional integer | Sets the width of the clipping. |
clipHeight | Optional integer | Sets the height of the clipping. |
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, progressPixels, progressHeight)