Options
Menu

Class Sampler2D

The Sampler2D export class represents display objects that represent bitmap images. These can be images that you load with the flash.Assets or flash.display.Loader classes, or they can be images that you create with the Sampler2D() constructor.

The Sampler2D() constructor allows you to create a Sampler2D object that contains a reference to a Image2D object. After you create a Sampler2D object, use the addChild() or addChildAt() method of the parent DisplayObjectContainer instance to place the bitmap on the display list.

A Sampler2D object can share its Image2D reference among several Sampler2D objects, independent of translation or rotation properties. Because you can create multiple Sampler2D objects that reference the same Image2D object, multiple texture objects can use the same complex Image2D object without incurring the memory overhead of a Image2D object for each texture object instance.

Hierarchy

Implements

  • IAsset
  • IAssetAdapter

Index

Constructors

constructor

  • new Sampler2D(repeat?: boolean, smooth?: boolean, mipmap?: boolean): Sampler2D
  • Parameters

    • Default value repeat: boolean = false
    • Default value smooth: boolean = false
    • Default value mipmap: boolean = false

    Returns Sampler2D

Properties

_adapter

_adapter: IAssetAdapter

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

frameRect

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

  • Parameters

    • value: Rectangle

    Returns void

imageRect

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

  • Parameters

    • value: Rectangle

    Returns void

mipmap

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

  • Parameters

    • value: boolean

    Returns void

repeat

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

  • Parameters

    • value: boolean

    Returns void

smooth

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

  • Parameters

    • value: boolean

    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

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

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