Draggable |

Hierarchy (View Summary)

Index

Constructors

constructor

  • new Draggable(x: number, y: number, width: number, height: number): Draggable

    Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns Draggable

Properties

alpha

alpha: number

alwaysUpdate

alwaysUpdate: boolean

ancestor

anchorPoint

autoTransform

autoTransform: boolean

blendMode

blendMode: string

body

currentTransform

dragging

dragging: boolean

dragId

dragId: any

edges

floating

floating: boolean

grabOffset

GUID

GUID: string

handleDragEnd

handleDragEnd: ((e: any, draggable: any) => void) | undefined

handleDragStart

handleDragStart: ((e: any, draggable: any) => void) | undefined

handlePointerMove

handlePointerMove: ((e: any) => void) | undefined

indices

indices: number[]

isDirty

isDirty: boolean

isKinematic

isKinematic: boolean

isPersistent

isPersistent: boolean

mask

name

name: string

onVisibilityChange

onVisibilityChange: Function

points

pos

shader

shader: any

type

type: string = "Rectangle"

updateWhenPaused

updateWhenPaused: boolean

Accessors

bottom

  • get bottom(): number

    Returns number

centerX

  • get centerX(): number

    Returns number

  • set centerX(value: number): void

    Returns void

centerY

  • get centerY(): number

    Returns number

  • set centerY(value: number): void

    Returns void

depth

  • get depth(): number

    Returns number

  • set depth(value: number): void

    Returns void

height

  • get height(): number

    Returns number

  • set height(value: number): void

    Returns void

inViewport

  • get inViewport(): boolean

    Returns boolean

  • set inViewport(value: boolean): void

    Returns void

isFlippedX

  • get isFlippedX(): boolean

    Returns boolean

isFlippedY

  • get isFlippedY(): boolean

    Returns boolean

isFloating

  • get isFloating(): boolean

    Returns boolean

left

  • get left(): number

    Returns number

parentApp

  • Returns Application

    the parent application or undefined if not attached to any container/app

  • get right(): number

    Returns number

tint

  • set tint(value: Color): void

    Returns void

top

  • get top(): number

    Returns number

width

  • get width(): number

    Returns number

  • set width(value: number): void

    Returns void

Methods

angleTo

  • angleTo(target: any): number

    Returns number

    angle in radians

centerOn

  • Parameters

    • x: number
    • y: number

    Returns Draggable

    this rectangle

clone

  • Returns Rect

    new rectangle

contains

  • contains(x: number, y: number): boolean

    Parameters

    • x: number
    • y: number

    Returns boolean

    True if the polygon contain the point, otherwise false

  • Returns boolean

    True if the polygon contain the point, otherwise false

containsRectangle

  • containsRectangle(rectangle: Rect): boolean

    Parameters

    Returns boolean

    True if the rectangle contain the given rectangle, otherwise false

copy

distanceTo

  • distanceTo(target: any): number

dragEnd

  • Returns boolean

    false if the object stopped being dragged

dragMove

  • dragMove(e: object): void

    Returns void

dragStart

  • dragStart(e: object): boolean

    Returns boolean

    false if the object is being dragged

draw

  • Returns void

equals

  • equals(rect: Rect): boolean

    Returns boolean

    true if equals

flipX

  • Parameters

    • Optionalflip: boolean = true

    Returns Renderable

    Reference to this object for method chaining

flipY

  • Parameters

    • Optionalflip: boolean = true

    Returns Renderable

    Reference to this object for method chaining

getAbsolutePosition

  • getAbsolutePosition(): Vector2d

    Returns Vector2d

getBounds

  • Returns Bounds

    bounding box Rectangle object

getIndices

  • Returns number[]

    an array of vertex indices for all triangles forming this polygon.

getOpacity

  • Returns number

    current opacity value between 0 and 1

isConvex

  • isConvex(): boolean | null

    Returns boolean | null

    true if the vertices are convex, false if not, null if not computable

isFinite

  • Returns boolean

    false if all coordinates are positive or negative Infinity or NaN; otherwise, true.

lookAt

  • Returns Renderable

    Reference to this object for method chaining

onCollision

  • Returns boolean

    true if the object should respond to the collision (its position and velocity will be corrected)

onDestroyEvent

  • Returns void

overlaps

  • overlaps(rect: Rect): boolean

    Returns boolean

    true if overlaps

postDraw

preDraw

  • Returns void

recalc

  • Returns Draggable

    Reference to this object for method chaining

resize

  • Parameters

    • w: number
    • h: number

    Returns Draggable

    this rectangle

rotate

  • Parameters

    • angle: number
    • Optionalv: any

    Returns Renderable

    Reference to this object for method chaining

scale

  • Parameters

    • x: number
    • Optionaly: number = x

    Returns Renderable

    Reference to this object for method chaining

scaleV

  • Returns Renderable

    Reference to this object for method chaining

setOpacity

  • setOpacity(alpha: number): void

    Returns void

setShape

  • Returns Draggable

    this instance for objecf chaining

setSize

  • setSize(width: number, height: number): Draggable

    Parameters

    • width: number
    • height: number

    Returns Draggable

setVertices

  • Returns Draggable

    this instance for objecf chaining

shift

  • shift(x: number, y?: number): void

    Parameters

    • x: number
    • Optionaly: number

    Returns void

  • Returns void

to2d

  • Returns Draggable

    Reference to this object for method chaining

toIso

  • Returns Draggable

    Reference to this object for method chaining

toPolygon

  • Returns Polygon

    a new Polygon that represents this rectangle.

transform

  • Returns Renderable

    Reference to this object for method chaining

translate

  • translate(x: number, y?: number): Polygon

    Parameters

    • x: number
    • Optionaly: number

    Returns Polygon

    Reference to this object for method chaining

  • Returns Polygon

    Reference to this object for method chaining

union

update

  • update(dt: number): boolean

    Returns boolean

    true if the renderable is dirty

updateBounds

  • updateBounds(absolute?: boolean): Bounds

    Parameters

    • Optionalabsolute: boolean = true

    Returns Bounds

    this shape bounding box Rectangle object