Table of Contents

Struct SpriteRef

Namespace
GB
Assembly
GBSharp.Framework.dll

A reference to one hardware sprite by index.

public struct SpriteRef
Inherited Members

Remarks

This struct holds no state. Each property reads or writes OAM directly for the sprite it names, so assigning X and Y separately costs two OAM writes where Move(byte, byte, byte) costs one.

Properties

BehindBackground

Draws this sprite behind background colours 1-3.

public bool BehindBackground { readonly get; set; }

Property Value

bool

Flags

All of this sprite's attribute bits.

public SpriteFlags Flags { readonly get; set; }

Property Value

SpriteFlags

FlipX

Mirrors this sprite horizontally.

public bool FlipX { readonly get; set; }

Property Value

bool

FlipY

Mirrors this sprite vertically.

public bool FlipY { readonly get; set; }

Property Value

bool

Palette

Which of the eight Game Boy Color sprite palettes this sprite uses.

public byte Palette { readonly get; set; }

Property Value

byte

Remarks

Game Boy Color only. On an original Game Boy the choice is between two palettes and is made with UseSecondPalette, a different bit, which is why these are two properties rather than one that would mean something different on each machine.

Tile

The tile this sprite draws.

public byte Tile { readonly get; set; }

Property Value

byte

UseSecondPalette

Original Game Boy: use sprite palette 1 rather than 0.

public bool UseSecondPalette { readonly get; set; }

Property Value

bool

Remarks

See Palette for the Game Boy Color equivalent.

X

Screen X plus 8. A sprite at X = 0 is fully off the left edge.

public byte X { readonly get; set; }

Property Value

byte

Y

Screen Y plus 16. A sprite at Y = 0 is fully off the top edge.

public byte Y { readonly get; set; }

Property Value

byte