UNPKG

malwoden

Version:

![alt text](./coverage/badge-lines.svg) ![alt text](./coverage/badge-statements.svg) ![alt text](./coverage/badge-functions.svg) ![alt text](./coverage/badge-branches.svg)

35 lines (34 loc) 1.15 kB
import { Glyph } from "./glyph"; import { Vector2 } from "../struct/vector"; declare type RenderGlyph = (pos: Vector2, glyph: Glyph) => any; /** Represents glyph data, agnostic to how it is rendered. */ export declare class Display { private glyphs; private changedGlyphs; readonly width: number; readonly height: number; /** * Creates a new Display * @param width - The number of glyphs wide the display is * @param height - The number of glyphs tall the display is */ constructor(width: number, height: number); /** * Returns a Vector representing the width/height of the display. */ size(): Vector2; /** * Sets a single glyph in the display. * * @param pos Vector2 - The position of the Glyph * @param glyph Glyph - The Glyph */ setGlyph(pos: Vector2, glyph: Glyph): void; /** * Calls the callback with each x/y/glyph pair. * The terminal needs to decide how to render the display. * The callback is called bottom to top, right to left. */ render(callback: RenderGlyph): void; } export {};