Doc: SpriteDrawMode

SpriteDrawMode - set the sprite draw mode

Syntax

SpriteDrawMode SpriteIndex, DrawMode)

  • SpriteIndex - index of sprite
  • DrawMode - draw mode(s) to set for the sprite

Explanation

SpriteDrawMode sets the drawing mode for sprites. The draw mode must be set before certain sprite effect functions can be used such as RotateSprite.

There are several draw modes that can be set. More than one can be set using a bitmask. The long bitmask given below is to illustrate the entire bitmask and which digits flag what draw mode. You can use all three to set the draw mode.

Draw Mode Long Bitmask Short Bitmask Decimal Number
Blit Mode (Default) %000000000000000000 %0 0
Scaling %000000000000000001 %1 1
Rotation %000000000000000010 %10 2
Alpha %000000000000000100 %100 4
AlphaBlend 50/50 %000000000000001000 %1000 8
AlphaAddition %000000000000010000 %10000 16
AlphaSubtraction %000000000000100000 %100000 32
Fade %000000000001000000 %1000000 64
Gouraud Fade %000000000010000000 %10000000 128
RGB Gouraud 50/50 Alpha Blend %000000000100000000 %100000000 256
RGB Gouraud Alpha Addition %000000001000000000 %1000000000 512
Color Flash %000000010000000000 %10000000000 1024
Color Alpha %000000100000000000 %100000000000 2048
Color Alpha ADD %000001000000000000 %1000000000000 4096
Color Alpha SUB %000010000000000000 %10000000000000 8192
Color Replace %000100000000000000 %100000000000000 16384
Raster Bar Color Replace %001000000000000000 %1000000000000000 32768
Color Mask Logical AND %010000000000000000 %10000000000000000 65536
Color Mask Logical OR %100000000000000000 %100000000000000000 131072

Examples

Set Rotation Mode

BitMask

SpriteDrawMode mySpr, @10

Decimal

SpriteDrawMode mySpr, 2

Set Scaling and Rotation Mode

BitMask

SpriteDrawMode mySpr, %11

or

SpriteDrawMode mySpr, %10 + %1

Decimal

SpriteDrawMode mySpr, 3

or

SpriteDrawMode mySpr, 2 + 1

Related Pages

How To

Reference

Categories: Functions : Graphics : Sprites