API Docs for: 1.0.1

Grape.Rectangle Class

A Rectangle visualizer.

Constructor

Grape.Rectangle

(
  • [opts]
)

Parameters:

  • [opts] Object optional

    Initial values of properties

Methods

visualize

(
  • ctx
)

This abstract method is called each render frame if visible is set to true.

Parameters:

  • ctx CanvasRenderingContext2D

    The rendering context

Properties

alpha

Number

The alpha value set before calling the visualize method

Default: 1

backgroundColor

Number

The background color

Default: '#fff'

borderWidth

Number

The border width

Default: 1

height

Number

The height of the rectangle

Default: 0

visible

Number

If set false, the visualize method is not called.

Default: true

width

Number

The width of the rectangle

Default: 0