@raducal/isomer
Version:
A simple isometric graphics library for HTML5 canvas
44 lines (43 loc) • 1.35 kB
TypeScript
import { Canvas, CanvasOptions } from './canvas';
import { Color } from './color';
import { Path } from './path';
import { Point } from './point';
import { Shape } from './shape';
import { Vector } from './vector';
import { Textured } from './textured';
export type Drawable = HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
type Options = {
scale?: number;
originX?: number;
originY?: number;
lightPosition?: Vector;
lightColor?: Color;
useColor?: boolean;
canvas?: CanvasOptions;
};
declare class Isomer {
private canvas;
private angle;
private scale;
private originX;
private originY;
private lightPosition;
private lightAngle;
private colorDifference;
private lightColor;
private transformation;
constructor(canvas: HTMLCanvasElement | OffscreenCanvas, options?: Options);
init(options: Options): void;
setLightPosition(x: number, y: number, z: number): void;
private translatePoint;
add(item: Shape | Path | Shape[] | Path[] | Textured, baseColor?: Color): void;
private addPath;
static Canvas: typeof Canvas;
static Textured: typeof Textured;
static Color: typeof Color;
static Path: typeof Path;
static Point: typeof Point;
static Shape: typeof Shape;
static Vector: typeof Vector;
}
export { Isomer };