RenderSpriteState
From OxeyeWiki
(Difference between revisions)
(Created page with '{{VideoMethod | video.renderSpriteState(spriteId, x, y[, scale[, angle[, a, r, g, b]]]) | Renders a sprite at the given screen position. | {{MethodParam|spriteId|An integer|The s...') |
m |
||
| Line 22: | Line 22: | ||
if player.isHurt then | if player.isHurt then | ||
-- tint the player with red color | -- tint the player with red color | ||
| - | video. | + | video.renderSpriteState(player.sprite, player.x, player.y, 1.0, 0, 255, 255, 64, 64) |
else | else | ||
| - | video. | + | video.renderSpriteState(player.sprite, player.x, player.y) |
end | end | ||
</pre> | </pre> | ||
Revision as of 09:07, 9 March 2009
|
video.renderSpriteState(spriteId, x, y[, scale[, angle[, a, r, g, b]]]) | ||
|
Renders a sprite at the given screen position. | ||
| Parameter | Expected Type | Description |
| spriteId | An integer | The sprite ID. |
| x | A number | The x coordinate for the sprite's hotspot. |
| y | A number | The y coordinate for the sprite's hotspot. |
| scale | Optional number | The scale of the sprite, defaults to 1.0. |
| angle | Optional number | The angle (rotation) of the sprite, measured in radians. The sprite will rotate around its 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. |
| Returns | ||
|
Returns nothing. | ||
Example
if player.isHurt then
-- tint the player with red color
video.renderSpriteState(player.sprite, player.x, player.y, 1.0, 0, 255, 255, 64, 64)
else
video.renderSpriteState(player.sprite, player.x, player.y)
end