Options
Menu

Class Shape

Graphic wraps a Elements as a scene graph instantiation. A Graphic is owned by a Sprite object.

see

away.base.ElementsBase

see

away.entities.Sprite

class

away.base.Graphic

Hierarchy

  • AssetBase

Implements

Index

Constructors

constructor

  • Creates a new Shape object

    Parameters

    • elements: ElementsBase
    • Default value material: IMaterial = null
    • Default value style: Style = null
    • Default value count: number = 0
    • Default value offset: number = 0

    Returns Shape

Properties

_adapter

_adapter: IAssetAdapter

_owners

_owners: Array<Graphics>

adaptee

adaptee: AssetBase

adapter

adapter: IAssetAdapter

adapter is used to provide MovieClip to scripts taken from different platforms setter typically managed by factory. getter defaults to AwayJS class

assetFullPath

assetFullPath: Array<string>

assetNamespace

assetNamespace: string

count

count: number

id

id: number

A unique id for the asset, used to identify assets in an associative array

name

name: string

offset

offset: number

originalName

originalName: string

The original name used for this asset in the resource (e.g. file) in which it was found. This may not be the same as name, which may have changed due to of a name conflict.

Static DEFAULT_NAMESPACE

DEFAULT_NAMESPACE: string

Static ID_COUNT

ID_COUNT: number

Static assetType

assetType: string

Accessors

assetType

  • get (): string
  • Returns string

elements

  • The Elements object which provides the geometry data for this Shape.

    Returns ElementsBase

  • The Elements object which provides the geometry data for this Shape.

    Parameters

    Returns void

isStroke

  • get (): boolean
  • set (value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

material

  • The material used to render the current Shape. If set to null, the containing Graphics's material will be used instead.

    Returns IMaterial

  • The material used to render the current Shape. If set to null, the containing Graphics's material will be used instead.

    Parameters

    Returns void

strokePath

  • Returns GraphicsPath

  • Parameters

    Returns void

style

  • The style used to render the current Shape. If set to null, its parent Sprite's style will be used instead.

    Returns Style

  • The style used to render the current Shape. If set to null, its parent Sprite's style will be used instead.

    Parameters

    Returns void

Methods

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

applyTransformation

  • applyTransformation(transform: Matrix3D): void
  • //TODO

    internal

    Parameters

    • transform: Matrix3D

    Returns void

assetPathEquals

  • assetPathEquals(name: string, ns: string): boolean
  • Parameters

    • name: string
    • ns: string

    Returns boolean

clear

  • clear(): void
  • Returns void

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • Returns void

getBoxBounds

  • getBoxBounds(): Box
  • Returns Box

getSphereBounds

  • getSphereBounds(center: Vector3D, target?: Sphere): Sphere
  • Parameters

    • center: Vector3D
    • Default value target: Sphere = null

    Returns Sphere

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

hitTestPoint

  • hitTestPoint(x: number, y: number, z: number): boolean
  • Parameters

    • x: number
    • y: number
    • z: number

    Returns boolean

invalidate

  • invalidate(): void
  • Returns void

invalidateElements

  • invalidateElements(): void

invalidateMaterial

  • invalidateMaterial(): void

isAsset

  • isAsset(assetClass: IAssetClass): boolean
  • Parameters

    • assetClass: IAssetClass

    Returns boolean

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

resetAssetPath

  • resetAssetPath(name: string, ns?: string, overrideOriginal?: boolean): void
  • Parameters

    • name: string
    • Optional ns: string
    • Optional overrideOriginal: boolean

    Returns void

scale

  • scale(scale: number): void
  • Parameters

    • scale: number

    Returns void

scaleUV

  • scaleUV(scaleU?: number, scaleV?: number): void
  • Parameters

    • Default value scaleU: number = 1
    • Default value scaleV: number = 1

    Returns void

updateFullPath

  • updateFullPath(): void
  • Returns void

Static getShape

  • Parameters

    • elements: ElementsBase
    • Default value material: IMaterial = null
    • Default value style: Style = null
    • Default value count: number = 0
    • Default value offset: number = 0

    Returns Shape

Static storeShape

  • storeShape(shape: Shape): void
  • Parameters

    Returns void

Generated using TypeDoc