ISpriteLayer.addSprite

Creates a sprite from a bitmap with the given data, then places it to the display list. (New architecture)

interface ISpriteLayer
@trusted nothrow
Box
addSprite
(
ABitmap sprt
,
int n
,
int x
,
int y
,
ushort paletteSel = 0
,
ubyte paletteSh = 0
,
ubyte alpha = ubyte.max
,
int scaleHoriz = 1024
,
int scaleVert = 1024
,)

Parameters

sprt ABitmap

The bitmap to be used as the sprite.

n int

Priority ID of the sprite. Both identifies the sprite and decides it's display priority. Larger numbers will be drawn first, and thus will appear behind of smaller numbers, which also include negatives.

x int

X position of the sprite (top-left corner).

y int

Y position of the sprite (top-left corner).

paletteSel ushort

Selects a given palette.

paletteSh ubyte

Determines how many bits are being used, and thus the palette size for selection.

alpha ubyte

The transparency of the sprite.

scaleHoriz int

Horizontal scaling of the sprite. 1024 is the base value, anything less will stretch, greater will shrink the sprite.

scaleVert int

Ditto for vertical.

renderMode RenderingMode

Determines the rendering mode of the sprite. By default, it's determined by the layer itself. Any of the default other methods can be selected here, or a specially written rendering function can be specified with a different function.

Return Value

Type: Box

The current area of the sprite.

Meta