Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/caviar/src/entities/mod.ts>Sprite

⚡ Blazing fast, modern, Game Engine powered by WebGPU for Deno and the browser
Go to Latest
class Sprite
extends Entity
import { Sprite } from "https://deno.land/x/caviar@2.4.11/src/entities/mod.ts";

Constructors

new
Sprite(
url: string,
x: number,
y: number,
unnamed 3: spriteConfig,
_frame?: number,
)

Properties

cols: number
frame: Frame
frames: Array<Frame>
height: number
image: HTMLImage
rows: number
url: string
width: number

Methods

load(): Promise<Sprite>
nextFrame(): void
setFrame(frame: number): void