Creates an instance of a Flippable.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
front |
PIXI.DisplayObject |
The object to show initially. Should have been added to the scene. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
back |
PIXI.DisplayObject |
The object to show on the backside. Should have not been added to the scene. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
renderer |
PIXI.WebGLRenderer | PIXI.CanvasRenderer |
The renderer of the application. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opts |
object |
optional
An options object which can contain the following properties.
|
- See:
Example
const front = PIXI.Sprite.fromImage('./assets/front.jpg')
const back = PIXI.Sprite.fromImage('./assets/back.jpg')
app.scene.addChild(front)
// Create the flippable
const flippable = new Flippable(front, back, app.renderer)
front.interactive = true
front.on('click', event => flippable.toggle())
Extends
- PIXI.projection.Camera3d
Members
-
Gets or sets the flipped state.
-
Gets the alignment state. true if the front side is in front, false otherwise.