Skip to main content
Module

x/oid/mod.ts>SpriteProps

oidoid 2D game engine.
Go to Latest
interface SpriteProps
Re-export
import { type SpriteProps } from "https://deno.land/x/oid@v0.0.6/mod.ts";

Properties

readonly
optional
xy: Partial<XY<number>> | undefined

The origin of the sprite in level coordinates. Defaults to (0, 0).

Ents that are repositioned by other systems like FollowCam don't care.

optional
x: number | undefined
optional
y: number | undefined
readonly
optional
wh: Partial<XY<number>> | undefined

The dimensions of the sprite. Defaults to animation size.

optional
w: number | undefined
optional
h: number | undefined
readonly
optional
layerByHeight: boolean | undefined

How to resolve render order for sprites on same layer. When false (the default), this sprite compares with y. When true, this sprite compares with y + h.

readonly
optional
wrap: Partial<XY<number>> | undefined

Offset sprite. Capped to I4.

readonly
optional
flip: SpriteFlip | undefined

Mirror sprite. Defaults to unflipped. to-do: add intersection support.