Test sprite from script

This commit is contained in:
2026-06-02 09:32:07 -05:00
parent 57766a9104
commit a25871a849
38 changed files with 1913 additions and 377 deletions
+41
View File
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
/** An RGBA color with channels in the range 0255. */
declare class Color {
/** @param r Red 0255 (default 0) */
/** @param g Green 0255 (default 0) */
/** @param b Blue 0255 (default 0) */
/** @param a Alpha 0255 (default 255) */
constructor(r?: number, g?: number, b?: number, a?: number);
r: number;
g: number;
b: number;
a: number;
toString(): string;
// Named color constants
static readonly WHITE: Color;
static readonly BLACK: Color;
static readonly RED: Color;
static readonly GREEN: Color;
static readonly BLUE: Color;
static readonly YELLOW: Color;
static readonly CYAN: Color;
static readonly MAGENTA: Color;
static readonly TRANSPARENT: Color;
static readonly GRAY: Color;
static readonly LIGHT_GRAY: Color;
static readonly DARK_GRAY: Color;
static readonly ORANGE: Color;
static readonly PURPLE: Color;
static readonly PINK: Color;
static readonly TEAL: Color;
static readonly CORNFLOWER_BLUE: Color;
}
+19
View File
@@ -0,0 +1,19 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
/** Read-only information about the current display surface. */
interface ScreenNamespace {
/** Current render-target width in pixels. */
readonly width: number;
/** Current render-target height in pixels. */
readonly height: number;
/** Aspect ratio: `width / height`. */
readonly aspect: number;
}
/** Current display / render-target dimensions. */
declare var Screen: ScreenNamespace;
+28
View File
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
/**
* A loaded texture asset. Holds a lock on the underlying asset entry —
* the lock is released automatically when the object is garbage collected.
*/
interface Texture {
/** Pixel width of the texture. */
readonly width: number;
/** Pixel height of the texture. */
readonly height: number;
toString(): string;
}
interface TextureConstructor {
/** RGBA 32-bit format (4 channels × 8 bits). */
readonly FORMAT_RGBA: number;
/** Paletted format. */
readonly FORMAT_PALETTE: number;
new(): never;
}
declare var Texture: TextureConstructor;