UNPKG

@awayjs/scene

Version:
66 lines 2.39 kB
import { IEntity } from '@awayjs/view'; import { IMaterial } from '@awayjs/renderer'; import { Graphics } from '@awayjs/graphics'; import { DisplayObjectContainer } from './DisplayObjectContainer'; import { PrefabBase } from '../prefabs/PrefabBase'; /** * Sprite is an instance of a Graphics, augmenting it with a presence in the scene graph, a material, and an animation * state. It consists out of Graphices, which in turn correspond to SubGeometries. Graphices allow different parts * of the graphics to be assigned different materials. */ export declare class Sprite extends DisplayObjectContainer { _iSourcePrefab: PrefabBase; private static _sprites; static assetType: string; static getNewSprite(graphics?: Graphics, material?: IMaterial): Sprite; static clearPool(): void; _graphics: Graphics; /** * */ get assetType(): string; /** * Specifies the Graphics object belonging to this Sprite object, where * drawing commands can occur. */ get graphics(): Graphics; set graphics(value: Graphics); /** * Create a new Sprite object. * * @param material [optional] The material with which to render the Sprite. */ constructor(graphics?: Graphics, material?: IMaterial); getEntity(): IEntity; /** * @inheritDoc */ dispose(): void; /** * @inheritDoc */ disposeValues(): void; /** * Clones this Sprite instance along with all it's children, while re-using the same * material, graphics and animation set. The returned result will be a copy of this sprite, * containing copies of all of it's children. * * Properties that are re-used (i.e. not cloned) by the new copy include name, * graphics, and material. Properties that are cloned or created anew for the copy * include subSpritees, children of the sprite, and the animator. * * If you want to copy just the sprite, reusing it's graphics and material while not * cloning it's children, the simplest way is to create a new sprite manually: * * <code> * var clone : Sprite = new Sprite(original.graphics, original.material); * </code> */ clone(): Sprite; copyTo(sprite: Sprite, cloneShapes?: boolean): void; /** * */ bakeTransformations(): void; } //# sourceMappingURL=Sprite.d.ts.map