RenderSpriteStateFixed

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
(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, clipRight, clipBottom]])
+
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|clipRight|Optional integer|Sets the right clipping edge (exclusive).}}
+
{{MethodParam|clipWidth|Optional integer|Sets the width of the clipping.}}
-
{{MethodParam|clipBottom|Optional integer|Sets the lower clipping edge (exclusive).}}
+
{{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 + progressPixels, y + progressHeight)
+
       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.

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