SpriteLayer.DisplayListItem

Helps to determine the displaying properties and order of sprites.

Constructors

this
this(int x, int y, ABitmap sprite, int priority, ushort paletteSel, ubyte paletteSh, ubyte alpha, int scaleHoriz, int scaleVert)

Creates a display list item according to the newer architecture.

Members

Functions

opCmp
int opCmp(DisplayListItem d)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(int pri)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(DisplayListItem d)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(int pri)
Undocumented in source. Be warned that the author may not have intended to support it.
replaceSprite
void replaceSprite(ABitmap sprite)

Replaces the sprite with a new one. If the sizes are mismatching, the top-left coordinates are left as is, but the slicing is reset.

resetSlice
void resetSlice()

Resets the slice to its original position.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

height
int height;

Height of the sprite

masterAlpha
ubyte masterAlpha;

Sets the master alpha value of the sprite, e.g. opacity

paletteSel
ushort paletteSel;

Selects the palette of the sprite. Amount of accessable color depends on the palette access shifting value. A value of 8 enables 256 * 256 color palettes, and a value of 4 enables 4096 * 16 color palettes. paletteSh can be set lower than what the bitmap is capable of storing at its maximum, this can enable the packing of more palettes within the main one, e.g. a paletteSh value of 7 means 512 * 128 color palettes, while the bitmaps are still stored in the 8 bit "chunky" mode instead of 7 bit planar that would require way more processing power. However this doesn't limit the bitmap's ability to access 256 colors, and this can result in memory leakage if the developer isn't careful enough.

pixelData
void* pixelData;

Points to the pixel data.

position
Box position;

Stores the position relative to the origin point. Actual display position is determined by the scroll positions.

priority
int priority;

Used for automatic sorting and identification.

renderFunc
void function(uint* src, uint* dest, size_t length, ubyte value) renderFunc;

From version 0.10.0 onwards, each sprites can have their own rendering function set up to allow different effect on a single layer. If not specified otherwise, the layer's main rendering function will be used instead. Custom rendering functions can be written by the user, it requires knowledge of writing pixel shader-like functions using fixed-point arithmetics. Use of vector optimizatons techniques (SSE2, AVX, NEON, etc) are needed for optimal performance.

scaleHoriz
int scaleHoriz;

Horizontal scaling

scaleVert
int scaleVert;

Vertical scaling

slice
Box slice;

To compensate for the lack of scanline interrupt capabilities, this enables chopping off parts of a sprite.

width
int width;

Width of the sprite

Meta