Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Circle

Hierarchy

  • Graphics
    • Circle

Implements

  • InteractiveTarget
  • AccessibleTarget

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Protected _bounds

_bounds: Bounds

Protected _boundsID

_boundsID: number

Protected _boundsRect

_boundsRect: Rectangle

Protected _cacheAsBitmap

_cacheAsBitmap: boolean

Protected _cacheData

_cacheData: boolean

Protected Readonly _destroyed

_destroyed: boolean

Protected _enabledFilters

_enabledFilters: Array<Filter<any>> | null

Protected _fastRect

_fastRect: boolean

Protected _filters

_filters: Array<Filter<any>> | null

Protected _lastBoundsID

_lastBoundsID: number

Protected _localBounds

_localBounds: Bounds

Protected _localBoundsRect

_localBoundsRect: Rectangle

Protected _mask

_mask: Graphics | Sprite | null

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

When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. This is not recommended if you are constantly redrawing the graphics element.

default

false

Protected cachedSpriteDirty

cachedSpriteDirty: boolean

canvasTintDirty

canvasTintDirty: number

children

children: DisplayObject[]

clearDirty

clearDirty: number

currentPath

currentPath: GraphicsData

cursor

cursor: string

defaultCursor

defaultCursor: string
deprecated

dirty

dirty: number

fastRectDirty

fastRectDirty: number

fillAlpha

fillAlpha: number

filterArea

filterArea: Rectangle | null

filters

filters: Array<Filter<any>> | null

Protected graphicsData

graphicsData: GraphicsData[]

height

height: number

hitArea

hitArea: Rectangle | Circle | Ellipse | Polygon | RoundedRectangle | HitArea

interactive

interactive: boolean

interactiveChildren

interactiveChildren: boolean

isMask

isMask: boolean

lineAlignment

lineAlignment: number

lineColor

lineColor: number

lineWidth

lineWidth: number

localTransform

localTransform: Matrix

mask

mask: Graphics | Sprite | null

name

name: string | null

The instance name of the object.

nativeLines

nativeLines: boolean

Protected onChildrenChange

onChildrenChange: function

Type declaration

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

      • Rest ...args: any[]

      Returns void

parent

parent: Container

pivot

pivot: Point | ObservablePoint

position

position: Point | ObservablePoint

Optional positionX

positionX: undefined | number

Optional positionY

positionY: undefined | number

renderable

renderable: boolean

rotation

rotation: number

scale

scale: Point | ObservablePoint

skew

skew: ObservablePoint

tabIndex

tabIndex: number

tint

tint: number

trackedPointers

trackedPointers: object

Type declaration

  • [key: number]: InteractionTrackingData

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 CURVES

CURVES: object

Graphics curves resolution settings. If adaptive flag is set to true, the resolution is calculated based on the curve"s length to ensure better visual quality. Adaptive draw works with bezierCurveTo and quadraticCurveTo.

property

{boolean} adaptive=false - flag indicating if the resolution should be adaptive

property

{number} maxLength=10 - maximal length of a single segment of the curve (if adaptive = false, ignored)

property

{number} minSegments=8 - minimal number of segments in the curve (if adaptive = false, ignored)

property

{number} maxSegments=2048 - maximal number of segments in the curve (if adaptive = false, ignored)

Type declaration

  • adaptive: boolean
  • maxLength: number
  • maxSegments: number
  • minSegments: number

Static EventEmitter

EventEmitter: object

Type declaration

  • constructor: function
    • new __type(): EventEmitter
    • Returns EventEmitter

  • prefixed: string | boolean

Static _SPRITE_TEXTURE

_SPRITE_TEXTURE: Texture

Static prefixed

prefixed: string | boolean

Methods

Protected _bezierCurveLength

  • _bezierCurveLength(fromX: number, fromY: number, cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): number
  • Parameters

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

    Returns number

Protected _cacheAsBitmapDestroy

  • _cacheAsBitmapDestroy(options: boolean | any): void
  • Parameters

    • options: boolean | any

    Returns void

Protected _calculateBounds

  • _calculateBounds(): Rectangle

Protected _calculateCachedBounds

  • _calculateCachedBounds(): Rectangle

Protected _destroyCachedDisplayObject

  • _destroyCachedDisplayObject(): void

Protected _getCachedLocalBounds

  • _getCachedLocalBounds(): Rectangle

Protected _initCachedDisplayObject

  • _initCachedDisplayObject(renderer: WebGLRenderer): void
  • Parameters

    • renderer: WebGLRenderer

    Returns void

Protected _initCachedDisplayObjectCanvas

  • _initCachedDisplayObjectCanvas(renderer: CanvasRenderer): void

Protected _quadraticCurveLength

  • _quadraticCurveLength(fromX: number, fromY: number, cpX: number, cpY: number, toX: number, toY: number): number
  • Parameters

    • fromX: number
    • fromY: number
    • cpX: number
    • cpY: number
    • toX: number
    • toY: number

    Returns number

Protected _recursivePostUpdateTransform

  • _recursivePostUpdateTransform(): void
  • recursively updates transform of all objects from the root to this one internal function for toLocal()

    Returns void

Protected _renderCachedCanvas

  • _renderCachedCanvas(renderer: CanvasRenderer): void
  • Parameters

    • renderer: CanvasRenderer

    Returns void

Protected _renderCachedWebGL

  • _renderCachedWebGL(renderer: WebGLRenderer): void
  • Parameters

    • renderer: WebGLRenderer

    Returns void

Protected _renderCanvas

  • _renderCanvas(renderer: CanvasRenderer): void

Protected _renderSpriteRect

  • _renderSpriteRect(renderer: SystemRenderer): void
  • Parameters

    • renderer: SystemRenderer

    Returns void

Protected _renderWebGL

  • _renderWebGL(renderer: WebGLRenderer): void
  • Parameters

    • renderer: WebGLRenderer

    Returns void

Protected _segmentsCount

  • _segmentsCount(length: number): number
  • Parameters

    • length: number

    Returns number

addChild

  • addChild<T>(...children: T[]): T
  • Type parameters

    • T: DisplayObject

    Parameters

    • Rest ...children: T[]

    Returns T

addChildAt

  • addChildAt<T>(child: T, index: number): T
  • Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    Type parameters

    • T: DisplayObject

    Parameters

    • child: T

      The child to add

    • index: number

      The index to place the child in

    Returns T

    The child that was added.

addHole

  • addHole(): Graphics
  • Returns Graphics

addListener

  • addListener(event: interaction.InteractionEventTypes, fn: function, context?: any): this
  • Parameters

    • event: interaction.InteractionEventTypes
    • fn: function
        • (event: InteractionEvent): void
        • Parameters

          • event: InteractionEvent

          Returns void

    • Optional context: any

    Returns this

arc

  • arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: undefined | false | true): Graphics
  • Parameters

    • cx: number
    • cy: number
    • radius: number
    • startAngle: number
    • endAngle: number
    • Optional anticlockwise: undefined | false | true

    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?: undefined | number): Graphics
  • Parameters

    • color: number
    • Optional alpha: undefined | 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
  • Recalculates the bounds of the container.

    Returns void

clear

  • clear(): Graphics
  • Returns Graphics

clone

  • clone(): Graphics
  • Returns Graphics

closePath

  • closePath(): Graphics
  • Returns Graphics

Protected containerUpdateTransform

  • containerUpdateTransform(): void

containsPoint

  • containsPoint(point: Point): boolean
  • Parameters

    • point: Point

    Returns boolean

destroy

  • destroy(options?: DestroyOptions | boolean): void
  • Parameters

    • Optional options: DestroyOptions | boolean

    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

  • drawPolygon(path: number[] | Point[] | Polygon): Graphics
  • Parameters

    • path: number[] | Point[] | Polygon

    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

  • drawShape(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any): GraphicsData
  • Parameters

    • shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any

    Returns GraphicsData

drawStar

  • drawStar(x: number, y: number, points: number, radius: number, innerRadius: number, rotation?: undefined | number): Graphics
  • Parameters

    • x: number
    • y: number
    • points: number
    • radius: number
    • innerRadius: number
    • Optional rotation: undefined | number

    Returns Graphics

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

  • endFill(): Graphics
  • 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?: undefined | number, resolution?: undefined | number): Texture
  • Parameters

    • Optional scaleMode: undefined | number
    • Optional resolution: undefined | number

    Returns Texture

getBounds

  • getBounds(skipUpdate?: undefined | false | true, rect?: Rectangle): Rectangle
  • Retrieves the bounds of the displayObject as a rectangle object.

    Parameters

    • Optional skipUpdate: undefined | false | true

      setting to true will stop the transforms of the scene graph from being updated. This means the calculation returned MAY be out of date BUT will give you a nice performance boost

    • Optional rect: Rectangle

      Optional rectangle to store the result of the bounds calculation

    Returns Rectangle

    the rectangular bounding area

getChildAt

  • getChildAt<T>(index: number): T
  • Returns the child at the specified index

    Type parameters

    • T: DisplayObject

    Parameters

    • index: number

      The index to get the child at

    Returns T

    The child at the given index, if any.

getChildByName

  • getChildByName<T>(name: string): T
  • Returns the display object in the container

    Type parameters

    • T: DisplayObject

    Parameters

    • name: string

      instance name

    Returns T

    The child with the specified name.

getChildIndex

  • getChildIndex(child: DisplayObject): number
  • Returns the index position of a child DisplayObject instance

    Parameters

    • child: DisplayObject

      The DisplayObject instance to identify

    Returns number

    The index position of the child display object to identify

getGlobalPosition

  • getGlobalPosition(point?: Point, skipUpdate?: undefined | false | true): Point
  • Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.

    Parameters

    • Optional point: Point

      the point to write the global value to. If null a new point will be returned

    • Optional skipUpdate: undefined | false | true

      setting to true will stop the transforms of the scene graph from being updated. This means the calculation returned MAY be out of date BUT will give you a nice performance boost

    Returns Point

    The updated point

getLocalBounds

  • getLocalBounds(rect?: Rectangle): Rectangle
  • Retrieves the local bounds of the displayObject as a rectangle object

    Parameters

    • Optional rect: Rectangle

    Returns Rectangle

    the rectangular bounding area

isFastRect

  • isFastRect(): boolean
  • Returns boolean

lineStyle

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

    • Optional lineWidth: undefined | number
    • Optional color: undefined | number
    • Optional alpha: undefined | number
    • Optional alignment: undefined | 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 | symbol, fn?: undefined | function, context?: any): this
  • Parameters

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

    Returns this

on

  • on(event: interaction.InteractionEventTypes | "added" | "removed", fn: function, context?: any): this
  • on(event: string | symbol, fn: function, context?: any): this
  • Parameters

    • event: interaction.InteractionEventTypes | "added" | "removed"
    • fn: function
        • (event: InteractionEvent): void
        • Parameters

          • event: InteractionEvent

          Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: string | symbol
    • fn: function
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional context: any

    Returns this

once

  • once(event: interaction.InteractionEventTypes | "added" | "removed", fn: function, context?: any): this
  • once(event: string | symbol, fn: function, context?: any): this
  • Parameters

    • event: interaction.InteractionEventTypes | "added" | "removed"
    • fn: function
        • (event: InteractionEvent): void
        • Parameters

          • event: InteractionEvent

          Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: string | symbol
    • fn: function
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • 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

  • removeAllListeners(event?: interaction.InteractionEventTypes): this
  • Parameters

    • Optional event: interaction.InteractionEventTypes

    Returns this

removeChild

  • removeChild<T>(child: DisplayObject): T
  • Type parameters

    • T: DisplayObject

    Parameters

    • child: DisplayObject

    Returns T

removeChildAt

  • removeChildAt<T>(index: number): T
  • Removes a child from the specified index position.

    Type parameters

    • T: DisplayObject

    Parameters

    • index: number

      The index to get the child from

    Returns T

    The child that was removed.

removeChildren

  • removeChildren<T>(beginIndex?: undefined | number, endIndex?: undefined | number): T[]
  • Removes all children from this container that are within the begin and end indexes.

    Type parameters

    • T: DisplayObject

    Parameters

    • Optional beginIndex: undefined | number
    • Optional endIndex: undefined | number

    Returns T[]

    List of removed children

removeListener

  • removeListener(event: interaction.InteractionEventTypes, fn?: undefined | function, context?: any): this
  • Parameters

    • event: interaction.InteractionEventTypes
    • Optional fn: undefined | function
    • Optional context: any

    Returns this

renderAdvancedWebGL

  • renderAdvancedWebGL(renderer: WebGLRenderer): void
  • Parameters

    • renderer: WebGLRenderer

    Returns void

renderCanvas

  • renderCanvas(renderer: CanvasRenderer): void
  • Parameters

    • renderer: CanvasRenderer

    Returns void

renderWebGL

  • renderWebGL(renderer: WebGLRenderer): void
  • Parameters

    • renderer: WebGLRenderer

    Returns void

setChildIndex

  • setChildIndex(child: DisplayObject, index: number): void
  • Changes the position of an existing child in the display object container

    Parameters

    • child: DisplayObject

      The child DisplayObject instance for which you want to change the index number

    • index: number

      The resulting index number for the child display object

    Returns void

setMaxListeners

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

    deprecated

    Returns this

setParent

  • setParent(container: Container): Container
  • Parameters

    • container: Container

    Returns Container

setTransform

  • setTransform(x?: undefined | number, y?: undefined | number, scaleX?: undefined | number, scaleY?: undefined | number, rotation?: undefined | number, skewX?: undefined | number, skewY?: undefined | number, pivotX?: undefined | number, pivotY?: undefined | number): DisplayObject
  • Convenience function to set the position, scale, skew and pivot at once.

    Parameters

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

    Returns DisplayObject

    The DisplayObject instance

swapChildren

  • swapChildren(child: DisplayObject, child2: DisplayObject): void
  • Swaps the position of 2 Display Objects within this container.

    Parameters

    • child: DisplayObject

      First display object to swap

    • child2: DisplayObject

      Second display object to swap

    Returns void

toGlobal

  • toGlobal(position: PointLike): Point
  • toGlobal<T>(position: PointLike, point?: T, skipUpdate?: undefined | false | true): T
  • Calculates the global position of the display object

    Parameters

    • position: PointLike

      The world origin to calculate from

    Returns Point

    A point object representing the position of this object

  • Calculates the global position of the display object

    Type parameters

    • T: PointLike

    Parameters

    • position: PointLike

      The world origin to calculate from

    • Optional point: T
    • Optional skipUpdate: undefined | false | true

    Returns T

    A point object representing the position of this object

toLocal

  • toLocal(position: PointLike, from?: DisplayObject): Point
  • toLocal<T>(position: PointLike, from?: DisplayObject, point?: T, skipUpdate?: undefined | false | true): T
  • Parameters

    • position: PointLike
    • Optional from: DisplayObject

    Returns Point

  • Calculates the local position of the display object relative to another point

    Type parameters

    • T: PointLike

    Parameters

    • position: PointLike

      The world origin to calculate from

    • Optional from: DisplayObject
    • Optional point: T
    • Optional skipUpdate: undefined | false | true

    Returns T

    A point object representing the position of this object

updateLocalBounds

  • updateLocalBounds(): void
  • Returns void

updateTransform

  • updateTransform(): void
  • Updates the transform on all children of this container for rendering

    Returns void