Home Reference Source
import GlRect from './ui/gldraw/glrect.js'
public class | source

GlRect

Extends:

Events → GlRect

rectangle data structure for GlRectInstancer

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

childs: *[]

public

color: *

public
public get

data: *

public set
public get
public get
public set
public get
public

draggableMove: boolean

public

draggableX: boolean

public

draggableY: boolean

public get

h: *

public get

idx: *

public

interactive: boolean

public get
public get

texture: *

public get

visible: *

public set
public get

w: *

public get

x: *

public get

y: *

public get

z: *

Private Members
private

_absX: number

private

_absY: number

private

_absZ: number

private
private

_border: *

private

_data: {}

private

_dragOffsetX: number

private

_dragOffsetY: number

private

_dragStartX: number

private

_dragStartY: number

private

_draggable: boolean

private

_h: number

private

_hovering: boolean

private

_isDragging: boolean

private

_log: *

private

_parent: *

private
private
private

_shape: boolean

private
private

_visible: boolean

private

_w: number

private

_x: number

private

_y: number

private

_z: number

Method Summary

Public Methods
public

addChild(c: *)

public
public

getParentX(): *

public

getParentY(): *

public

getParentZ(): *

public

hasChild(c: *): *

public

isHovering(): *

public

isPointInside(x: *, y: *): *

public

mouseDown(e: *)

public

mouseDrag(x: *, y: *, button: *)

public
public

mouseMove(x: *, y: *, button: *)

public

mouseUp(e: *)

public

removeChild(child: *)

public

setBorder(c: *)

public

setColor(r: *, g: *, b: *, a: *)

public

setColorHover(r: *, g: *, b: *, a: *)

public

setOpacity(a: *, childs: *)

public

setParent(p: *)

public

setPosition(_x: *, _y: *, _z: *)

public

setSelected(c: *)

public

setShape(c: *)

public

setSize(w: *, h: *)

public

setTexRect(x: *, y: *, w: *, h: *)

public

setTexture(t: *)

Private Methods
private

Inherited Summary

From class Events
public

off: *

public

on: *

private
private
private

_log: *

private

_logEvents: boolean

private

_logName: string

public

addEventListener(which: *, cb: *, idPrefix: string): string

add event listener

public

emitEvent(which: string, param1: *, param2: *, param3: *, param4: *, param5: *, param6: *)

emit event

public

hasEventListener(id: *, cb: *): boolean

check event listener registration

public

hasListenerForEventName(eventName: *): boolean

check event listener by name

public

logEvents(enabled: boolean, logName: string)

enable/disable logging of events for the class

public

removeEventListener(id: *, cb: *)

rempve event listener registration

Public Constructors

public constructor() source

Override:

Events#constructor

Public Members

public childs: *[] source

public color: * source

public colorHover: * source

public get data: * source

public set data source

public get dragOffsetX: * source

public get dragOffsetY: * source

public set draggable source

public get draggable: * source

public draggableMove: boolean source

public draggableX: boolean source

public draggableY: boolean source

public get h: * source

public get idx: * source

public interactive: boolean source

public get isDragging: * source

public get texture: * source

public get visible: * source

public set visible source

public get w: * source

public get x: * source

public get y: * source

public get z: * source

Private Members

private _absX: number source

private _absY: number source

private _absZ: number source

private _attrIndex: * source

private _border: * source

private _data: {} source

private _dragOffsetX: number source

private _dragOffsetY: number source

private _dragStartX: number source

private _dragStartY: number source

private _draggable: boolean source

private _h: number source

private _hovering: boolean source

private _isDragging: boolean source

private _log: * source

Override:

Events#_log

private _parent: * source

private _rectInstancer: * source

private _selected: * source

private _shape: boolean source

private _texture: * source

private _visible: boolean source

private _w: number source

private _x: number source

private _y: number source

private _z: number source

Public Methods

public addChild(c: *) source

Params:

NameTypeAttributeDescription
c *

public dispose() source

public getParentX(): * source

Return:

*

public getParentY(): * source

Return:

*

public getParentZ(): * source

Return:

*

public hasChild(c: *): * source

Params:

NameTypeAttributeDescription
c *

Return:

*

public isHovering(): * source

Return:

*

public isPointInside(x: *, y: *): * source

Params:

NameTypeAttributeDescription
x *
y *

Return:

*

public mouseDown(e: *) source

Params:

NameTypeAttributeDescription
e *

public mouseDrag(x: *, y: *, button: *) source

Params:

NameTypeAttributeDescription
x *
y *
button *

public mouseDragEnd() source

public mouseMove(x: *, y: *, button: *) source

Params:

NameTypeAttributeDescription
x *
y *
button *

public mouseUp(e: *) source

Params:

NameTypeAttributeDescription
e *

public removeChild(child: *) source

Params:

NameTypeAttributeDescription
child *

public setBorder(c: *) source

Params:

NameTypeAttributeDescription
c *

public setColor(r: *, g: *, b: *, a: *) source

Params:

NameTypeAttributeDescription
r *
g *
b *
a *

public setColorHover(r: *, g: *, b: *, a: *) source

Params:

NameTypeAttributeDescription
r *
g *
b *
a *

public setOpacity(a: *, childs: *) source

Params:

NameTypeAttributeDescription
a *
childs *

public setParent(p: *) source

Params:

NameTypeAttributeDescription
p *

public setPosition(_x: *, _y: *, _z: *) source

Params:

NameTypeAttributeDescription
_x *
_y *
_z *

public setSelected(c: *) source

Params:

NameTypeAttributeDescription
c *

public setShape(c: *) source

Params:

NameTypeAttributeDescription
c *

public setSize(w: *, h: *) source

Params:

NameTypeAttributeDescription
w *
h *

public setTexRect(x: *, y: *, w: *, h: *) source

Params:

NameTypeAttributeDescription
x *
y *
w *
h *

public setTexture(t: *) source

Params:

NameTypeAttributeDescription
t *

Private Methods

private _updateSize() source