Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Graphics

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Graphics(nativeLines?: boolean): Graphics

Properties

Protected _bounds

_bounds: Bounds

Protected _boundsID

_boundsID: number

Protected _boundsRect

_boundsRect: Rectangle

Protected _cacheAsBitmap

_cacheAsBitmap: boolean

Protected _cacheData

_cacheData: boolean

Protected _destroyed

_destroyed: boolean

Protected _enabledFilters

_enabledFilters: Filter[] | null

Protected _fastRect

_fastRect: boolean

Protected _filters

_filters: Filter[] | null

Protected _lastBoundsID

_lastBoundsID: number

Protected _localBounds

_localBounds: Bounds

Protected _localBoundsRect

_localBoundsRect: Rectangle

Protected _mask

_mask: Graphics | Sprite

Protected _prevTint

_prevTint: number

Protected _spriteRect

_spriteRect: Rectangle

Protected _webGL

_webGL: any

accessible

accessible: boolean

accessibleHint

accessibleHint: string | null

accessibleTitle

accessibleTitle: string | null

alpha

alpha: number

blendMode

blendMode: number

boundsDirty

boundsDirty: number

boundsPadding

boundsPadding: number

buttonMode

buttonMode: boolean

cacheAsBitmap

cacheAsBitmap: boolean

Protected cachedSpriteDirty

cachedSpriteDirty: boolean

children

children: DisplayObject[]

clearDirty

clearDirty: number

currentPath

currentPath: GraphicsData

cursor

cursor: string

defaultCursor

defaultCursor: string

dirty

dirty: number

fastRectDirty

fastRectDirty: number

fillAlpha

fillAlpha: number

filterArea

filterArea: Rectangle

filters

filters: Filter[] | null

Protected graphicsData

graphicsData: GraphicsData[]

height

height: number

hitArea

interactive

interactive: boolean

interactiveChildren

interactiveChildren: boolean

isMask

isMask: boolean

lineColor

lineColor: number

lineWidth

lineWidth: number

localTransform

localTransform: Matrix

mask

name

name: string | null

nativeLines

nativeLines: boolean

Protected onChildrenChange

onChildrenChange: function

Type declaration

    • (...args: any[]): void
    • Parameters

      • Rest ...args: any[]

      Returns void

parent

parent: Container

pivot

position

renderable

renderable: boolean

rotation

rotation: number

scale

skew

tabIndex

tabIndex: number

tint

tint: number

transform

transform: TransformBase

visible

visible: boolean

width

width: number

worldAlpha

worldAlpha: number

worldTransform

worldTransform: Matrix

worldVisible

worldVisible: boolean

x

x: number

y

y: number

Static EventEmitter

EventEmitter: object

Type declaration

  • constructor: function
    • Returns EventEmitter

  • prefixed: string | boolean

Static _SPRITE_TEXTURE

_SPRITE_TEXTURE: Texture

Static prefixed

prefixed: string | boolean

Methods

Protected _cacheAsBitmapDestroy

  • _cacheAsBitmapDestroy(options: boolean | any): void

Protected _calculateBounds

Protected _calculateCachedBounds

Protected _destroyCachedDisplayObject

  • _destroyCachedDisplayObject(): void

Protected _getCachedLocalBounds

Protected _initCachedDisplayObject

Protected _initCachedDisplayObjectCanvas

Protected _recursivePostUpdateTransform

  • _recursivePostUpdateTransform(): void

Protected _renderCachedCanvas

Protected _renderCachedWebGL

Protected _renderCanvas

Protected _renderSpriteRect

  • Parameters

    Returns void

Protected _renderWebGL

addChild

  • addChild<T>(child: T, ...additionalChildren: DisplayObject[]): T

addChildAt

  • addChildAt<T>(child: T, index: number): T
  • Type parameters

    Parameters

    • child: T
    • index: number

    Returns T

Protected addHole

  • Returns Graphics

addListener

arc

  • arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): Graphics
  • Parameters

    • cx: number
    • cy: number
    • radius: number
    • startAngle: number
    • endAngle: number
    • Optional anticlockwise: boolean

    Returns Graphics

arcTo

  • arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics
  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • radius: number

    Returns Graphics

beginFill

  • beginFill(color: number, alpha?: number): Graphics
  • Parameters

    • color: number
    • Optional alpha: number

    Returns Graphics

bezierCurveTo

  • bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Graphics
  • Parameters

    • cpX: number
    • cpY: number
    • cpX2: number
    • cpY2: number
    • toX: number
    • toY: number

    Returns Graphics

calculateBounds

  • calculateBounds(): void

clear

  • Returns Graphics

clone

  • Returns Graphics

Protected closePath

  • Returns Graphics

Protected containerUpdateTransform

  • containerUpdateTransform(): void

containsPoint

  • containsPoint(point: Point): boolean
  • Parameters

    Returns boolean

destroy

  • Parameters

    Returns void

Protected displayObjectUpdateTransform

  • displayObjectUpdateTransform(): void

drawCircle

  • drawCircle(x: number, y: number, radius: number): Graphics
  • Parameters

    • x: number
    • y: number
    • radius: number

    Returns Graphics

drawEllipse

  • drawEllipse(x: number, y: number, width: number, height: number): Graphics
  • Parameters

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

    Returns Graphics

drawPolygon

  • Parameters

    • path: number[] | Point[]

    Returns Graphics

drawRect

  • drawRect(x: number, y: number, width: number, height: number): Graphics
  • Parameters

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

    Returns Graphics

drawRoundedRect

  • drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics
  • Parameters

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

    Returns Graphics

drawShape

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    • Rest ...args: any[]

      Arguments that are passed to registered listeners

    Returns boolean

    true if the event had listeners, else false.

endFill

  • Returns Graphics

eventNames

  • eventNames(): Array<string | symbol>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<string | symbol>

generateCanvasTexture

  • generateCanvasTexture(scaleMode?: number, resolution?: number): Texture
  • Parameters

    • Optional scaleMode: number
    • Optional resolution: number

    Returns Texture

getBounds

getChildAt

getChildByName

getChildIndex

getGlobalPosition

  • getGlobalPosition(point?: Point, skipUpdate?: boolean): Point

getLocalBounds

isFastRect

  • isFastRect(): boolean
  • Returns boolean

lineStyle

  • lineStyle(lineWidth?: number, color?: number, alpha?: number): Graphics
  • Parameters

    • Optional lineWidth: number
    • Optional color: number
    • Optional alpha: number

    Returns Graphics

lineTo

  • lineTo(x: number, y: number): Graphics
  • Parameters

    • x: number
    • y: number

    Returns Graphics

listeners

  • listeners(event: string | symbol): Function[]
  • listeners(event: string | symbol, exists: boolean): boolean
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    Returns Function[]

  • Check if there listeners for a given event. If exists argument is not true lists listeners.

    Parameters

    • event: string | symbol

      The event name.

    • exists: boolean

      Only check if there are listeners.

    Returns boolean

moveTo

  • moveTo(x: number, y: number): Graphics
  • Parameters

    • x: number
    • y: number

    Returns Graphics

off

  • off(event: "added" | "removed" | string, fn?: Function, context?: any): this
  • Parameters

    • event: "added" | "removed" | string
    • Optional fn: Function
    • Optional context: any

    Returns this

on

  • on(event: "added" | "removed", fn: function, context?: any): this
  • on(event: string, fn: Function, context?: any): this
  • Parameters

    • event: "added" | "removed"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: string
    • fn: Function
    • Optional context: any

    Returns this

once

  • once(event: "added" | "removed", fn: function, context?: any): this
  • once(event: string, fn: Function, context?: any): this
  • Parameters

    • event: "added" | "removed"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: string
    • fn: Function
    • Optional context: any

    Returns this

quadraticCurveTo

  • quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Graphics
  • Parameters

    • cpX: number
    • cpY: number
    • toX: number
    • toY: number

    Returns Graphics

removeAllListeners

removeChild

removeChildAt

removeChildren

  • removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]
  • Parameters

    • Optional beginIndex: number
    • Optional endIndex: number

    Returns DisplayObject[]

removeListener

renderAdvancedWebGL

renderCanvas

renderWebGL

setChildIndex

setMaxListeners

  • setMaxListeners(): this
  • This function doesn't apply anymore.

    deprecated

    Returns this

setParent

setTransform

  • setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject
  • Parameters

    • Optional x: number
    • Optional y: number
    • Optional scaleX: number
    • Optional scaleY: number
    • Optional rotation: number
    • Optional skewX: number
    • Optional skewY: number
    • Optional pivotX: number
    • Optional pivotY: number

    Returns DisplayObject

swapChildren

toGlobal

toLocal

trackedPointers

  • trackedPointers(): object

updateLocalBounds

  • updateLocalBounds(): void
  • Returns void

updateTransform

  • updateTransform(): void

Generated using TypeDoc