RenderSpriteStateFixed

From OxeyeWiki

Jump to: navigation, search

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.

Daisymoon Video Lib

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)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox