From OxeyeWiki

Revision as of 13:57, 23 March 2009 by Thewreck (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 nothing.

Daisymoon Video Lib


   -- 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