# Class: ResponsiveCanvas

core.ResponsiveCanvas

Base class for Pulsar canvas elements. Instances will be contained in a CanvasContainer, which they will fill on the page.

# Table of contents

# Properties

# Constructors

# Methods

# Properties

# Defaults

Static Defaults: Object

Name Default value
background ""

# Type declaration

Name Type
background string

# Defined in

core/ResponsiveCanvas.ts:44 (opens new window)


# canvas

canvas: HTMLCanvasElement

The canvas element which the instance is responsible for controlling.

# Defined in

core/ResponsiveCanvas.ts:17 (opens new window)


# container

container: CanvasContainer

The parent CanvasContainer instance.

# Defined in

core/ResponsiveCanvas.ts:21 (opens new window)


# context

context: CanvasRenderingContext2D

The CanvasRenderingContext2D (opens new window) for the canvas.

# Defined in

core/ResponsiveCanvas.ts:25 (opens new window)


# components

components: Component[] = []

List of the Component instances attached to the canvas instance.

# Defined in

core/ResponsiveCanvas.ts:29 (opens new window)


# background

background: string = ResponsiveCanvas.Defaults.background

The background style of the canvas.

# Defined in

core/ResponsiveCanvas.ts:33 (opens new window)


# updateFlag

updateFlag: boolean = true

Indicates whether the canvas instance is to be redrawn on the next event loop pass (see Controller).

# Defined in

core/ResponsiveCanvas.ts:37 (opens new window)

# Constructors

# constructor

new ResponsiveCanvas(container, options?)

# Parameters

Name Type Description
container CanvasContainer Parent CanvasContainer instance.
options Partial<{ background: string }> Options for the canvas.

# Defined in

core/ResponsiveCanvas.ts:52 (opens new window)

# Methods

# update

update(): void

Clears the canvas and redraws all attached Component instances.

# Returns

void

# Defined in

core/ResponsiveCanvas.ts:74 (opens new window)


# setBackground

setBackground(css): void

Sets the background style of the background canvas.

# Parameters

Name Type Description
css string A valid string for the background (opens new window) property.

# Returns

void

# Defined in

core/ResponsiveCanvas.ts:87 (opens new window)