RenderSpriteState

From OxeyeWiki

Revision as of 09:00, 9 March 2009 by Jeb (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Daisymoon Video Lib

Example


   if player.isHurt then
      -- tint the player with red color
      video.renderSprite(player.sprite, player.x, player.y, 1.0, 0, 255, 255, 64, 64)
   else
      video.renderSprite(player.sprite, player.x, player.y)
   end

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox