Home Reference Source
import {Particle} from 'penvas/src/particle.js'
public class | source

Particle

Extends:

EventEmitterModel → Particle

Static Method Summary

Static Public Methods
public static

deserialize(objectPattern: {"x": *, "y": *, "type": *, "options": *, "opacity": *}): *

Constructor Summary

Public Constructor
public

constructor(x: *, y: *, type: *, options: *)

Member Summary

Public Members
public
public

options: *

public

type: *

public

x: *

public

y: *

Method Summary

Public Methods
public

render(ctx: *, drawer: *)

public

serialize(): *

public

step(dt: *)

Inherited Summary

From class EventEmitter
protected

List of registers

public

dispatch(event: String, args: mixed)

Dispatch event

public

on(event: String, callback: function, context: mixed)

Listen event

From class Model
public static
public get

hitbox: Object: {"x": *, "y": *, "width": *, "height": *, "radius": *}

public set

hitbox(hitbox: Object): *

public get

x: number: *

public set

x: *

public get

y: number: *

public set

y: *

public
public
public

parent: {}

public
public

render(ctx: RenderingContext, drawer: Drawer)

public
public

step(dt: number)

Static Public Methods

public static deserialize(objectPattern: {"x": *, "y": *, "type": *, "options": *, "opacity": *}): * source

Override:

Model#deserialize

Params:

NameTypeAttributeDescription
objectPattern {"x": *, "y": *, "type": *, "options": *, "opacity": *}
  • default: {"x":null,"y":null,"type":null,"options":null,"opacity":null}

Return:

*

Public Constructors

public constructor(x: *, y: *, type: *, options: *) source

Override:

Model#constructor

Params:

NameTypeAttributeDescription
x *
y *
type *
options *

Public Members

public opacity: number source

public options: * source

public type: * source

public x: * source

Override:

Model#x

public y: * source

Override:

Model#y

Public Methods

public render(ctx: *, drawer: *) source

Override:

Model#render

Params:

NameTypeAttributeDescription
ctx *
drawer *

public serialize(): * source

Override:

Model#serialize

Return:

*

public step(dt: *) source

Override:

Model#step

Params:

NameTypeAttributeDescription
dt *