Test sprite from script
This commit is contained in:
Vendored
+41
@@ -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 0–255. */
|
||||
declare class Color {
|
||||
/** @param r Red 0–255 (default 0) */
|
||||
/** @param g Green 0–255 (default 0) */
|
||||
/** @param b Blue 0–255 (default 0) */
|
||||
/** @param a Alpha 0–255 (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;
|
||||
}
|
||||
Vendored
+19
@@ -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;
|
||||
Vendored
+28
@@ -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;
|
||||
Reference in New Issue
Block a user