SpritesWebGLDrawable¶
Overview¶
WebGL drawable for Sprites.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class SpritesWebGLDrawable¶
Instance Methods¶
initialize( renderer, instance )¶
@param {number} renderer @param {Instance} instance
addSpriteImage( spriteImage )¶
Adds a SpriteImage to our SpriteSheet. @private
@param {SpriteImage} spriteImage
removeSpriteImage( spriteImage )¶
Removes a SpriteImage from our SpriteSheet. @private
@param {SpriteImage} spriteImage
onSpriteChange( newSpriteImage, oldSpriteImage )¶
Called when a Sprite's SpriteImage changes. @private
@param {SpriteImage} newSpriteImage @param {SpriteImage} oldSpriteImage
setup()¶
Sets up everything with a new WebGL context
onWebGLContextChange()¶
Callback for when the WebGL context changes. We'll reconstruct the painter. @public
onAddToBlock( webGLBlock )¶
Called when this drawable is added to a block. @public
@param {WebGLBlock} webGLBlock
onRemoveFromBlock( webGLBlock )¶
Called when this drawable is removed from a block. @public
@param {WebGLBlock} webGLBlock
draw()¶
Draws the WebGL content. @public
dispose()¶
Disposes the drawable. @public @override
markPaintDirty()¶
A "catch-all" dirty method that directly marks the paintDirty flag and triggers propagation of dirty information. This can be used by other mark* methods, or directly itself if the paintDirty flag is checked. @public
It should be fired (indirectly or directly) for anything besides transforms that needs to make a drawable dirty.
Source Code¶
See the source for SpritesWebGLDrawable.js in the scenery repository.