Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ASCIIRenderer

An ASCIIRenderer renders the Agents in a GridEnvironment. Agents are rendered using their "value" data (a single character). Since v0.4.0, this class has been deprecated, and it will be removed entirely in v0.6.0.

const renderer = new ASCIIRenderer(grid);
renderer.mount("#container-id");
deprecated

since 0.4.0

since

0.0.10

Hierarchy

  • AbstractRenderer
    • ASCIIRenderer

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

environment

environment: GridEnvironment

Points to the GridEnvironment that this ASCIIRenderer is tied to. This is automatically set when the ASCIIRenderer is created.

Methods

mount

  • mount(el: string | HTMLElement): void
  • Mount this renderer to a DOM element. Pass either a string representing a CSS selector matching the element or the element itself.

    // mounts the renderer to the element with the ID `container`
    renderer.mount('#container');
    
    // mounts the renderer to the element itself
    const container = document.getElementById('container');
    renderer.mount(container);
    

    Parameters

    • el: string | HTMLElement

    Returns void

render

  • render(): void

Generated using TypeDoc