Home Reference Source Repository
import {Square} from 'webgame-lib/src/drawable.js'
public class | source

Square

Extends:

Drawable → Square

Simple square.

Constructor Summary

Public Constructor
public

constructor(size: number, style: string)

Initializes.

Member Summary

Public Members
public

pos: *

public

size: *

public

style: *

Method Summary

Public Methods
public

bounds(rect: *)

public

draw(ctx: *, x: *, y: *)

Inherited Summary

From class Drawable
public

bounds(rect: Rect)

Set the rectangular bounds of the section to draw.

public

Draws at given position.

Public Constructors

public constructor(size: number, style: string) source

Initializes.

Params:

NameTypeAttributeDescription
size number

Length of side

style string

Color

Public Members

public pos: * source

public size: * source

public style: * source

Public Methods

public bounds(rect: *) source

Override:

Drawable#bounds

Params:

NameTypeAttributeDescription
rect *

public draw(ctx: *, x: *, y: *) source

Override:

Drawable#draw

Params:

NameTypeAttributeDescription
ctx *
x *
y *