2d-physics-engine
Version:
A lightweight, flexible 2D physics engine with ECS architecture, built with TypeScript
19 lines • 892 B
TypeScript
import { Transform } from '../components/Transform.component';
import { Scene } from '../core/Scene';
import { Vector2 } from '../math/Vector2';
import { System } from './System.abstract';
export declare class Rendering extends System {
private canvas;
private canvasCtx;
readonly needsFixedUpdate = false;
private spriteCache;
constructor(canvas: HTMLCanvasElement, canvasCtx: CanvasRenderingContext2D);
/** Load a sprite into the cache for faster rendering. */
loadSprite(key: string, imagePath: string): Promise<void>;
/** Draw a sprite at the given position with optional rotation and scale. */
drawSprite(key: string, position: Vector2, rotation?: number, scale?: Vector2): void;
drawLineToPosition(transform: Transform): void;
clear(): void;
update(_deltaTime: number, scene: Scene): void;
}
//# sourceMappingURL=Rendering.system.d.ts.map