Options
Menu

Class PrimitivePrefabBase

PrimitivePrefabBase is an abstract base class for polytope prefabs, which are simple pre-built geometric shapes

Hierarchy

Implements

  • IAsset
  • IAssetAdapter

Index

Constructors

constructor

  • Creates a new PrimitivePrefabBase object.

    Parameters

    • Default value material: MaterialBase = null

      The material with which to render the object

    • Default value elementsType: string = "triangle"

    Returns PrimitivePrefabBase

Properties

_adapter

_adapter: IAssetAdapter

_pObjects

_pObjects: Array<DisplayObject>

_primitiveDirty

_primitiveDirty: boolean

_scaleU

_scaleU: number

_scaleV

_scaleV: number

_uvDirty

_uvDirty: boolean

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

id

id: number

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

name

name: string

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

elementsType

  • get (): string
  • Returns string

material

  • get (): MaterialBase
  • set (value: MaterialBase): void
  • The material with which to render the primitive.

    Returns MaterialBase

  • The material with which to render the primitive.

    Parameters

    • value: MaterialBase

    Returns void

scaleU

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

  • Parameters

    • value: number

    Returns void

scaleV

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

  • Parameters

    • value: number

    Returns void

Methods

_iValidate

  • _iValidate(): void

_pBuildGraphics

  • _pBuildGraphics(target: ElementsBase, elementsType: string): void
  • Builds the primitive's geometry when invalid. This method should not be called directly. The calling should be triggered by the invalidateGraphics method (and in turn by updateGraphics).

    Parameters

    • target: ElementsBase
    • elementsType: string

    Returns void

_pBuildUVs

  • _pBuildUVs(target: ElementsBase, elementsType: string): void
  • Builds the primitive's uv coordinates when invalid. This method should not be called directly. The calling should be triggered by the invalidateUVs method (and in turn by updateUVs).

    Parameters

    • target: ElementsBase
    • elementsType: string

    Returns void

_pCreateObject

_pInvalidatePrimitive

  • _pInvalidatePrimitive(): void
  • Invalidates the primitive, causing it to be updated when requested.

    Returns void

_pInvalidateUVs

  • _pInvalidateUVs(): void
  • Invalidates the primitive's uv coordinates, causing them to be updated when requested.

    Returns void

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

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
  • inheritdoc

    Returns void

getNewObject

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

invalidate

  • invalidate(): void
  • Returns 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

updateFullPath

  • updateFullPath(): void
  • Returns void

Generated using TypeDoc