Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

flip image on x axis phaser

function preload ()
{
    this.load.image('pic', 'assets/pics/cougar-face-of-nature.png');
}

function create ()
{
    //  Default non-flipped image
    this.add.image(250, 164, 'pic');

    //  Flipped via a call to setFlipX
    this.add.image(250, 464, 'pic').setFlipX(true);

    var image = this.add.image(650, 164, 'pic');

    //  Flipped via setting the flipX property
    image.flipX = true;

    var image2 = this.add.image(650, 464, 'pic');

    this.input.on('pointerdown', function () {

        //  Flipped via a call to toggleFlipX
        image2.toggleFlipX();

    });
}
Comment

flip image on y axis phaser

function preload ()
{
    this.load.image('pic', 'assets/pics/cougar-face-of-nature.png');
}

function create ()
{
    //  Default non-flipped image
    this.add.image(250, 164, 'pic');

    //  Flipped via a call to setFlipY
    this.add.image(250, 464, 'pic').setFlipY(true);

    var image = this.add.image(650, 164, 'pic');

    //  Flipped via setting the flipY property
    image.flipY = true;

    var image2 = this.add.image(650, 464, 'pic');

    this.input.on('pointerdown', function () {

        //  Flipped via a call to toggleFlipX
        image2.toggleFlipY();

    });
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: set position phaser 
Javascript :: change y scale phaser 
Javascript :: gatsby js quick start 
Javascript :: connect phantom wallet react typescript 
Javascript :: phaser place on line 
Javascript :: phaser rotate container facing point 
Javascript :: phaser create animation from canvas texture 
Javascript :: phaser animation on update event 
Javascript :: accessing-nested-javascript-objects-and-arrays-by-string-path 
Javascript :: NodeJS/express : Cached and 304 status code on chrome 
Javascript :: remove text in div JQuery zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 
Javascript :: file size to string js 
Javascript :: nodejs stream pipeline 
Javascript :: membuat validasi form dengan javascript 
Javascript :: vue mount modal to body 
Javascript :: check if value is a string javascript 
Javascript :: javascript prompts user to input 
Javascript :: forms in angular 
Javascript :: react time picker 
Javascript :: what is local storage and session storage in javascript 
Javascript :: vuejs accessing props from data 
Javascript :: event.target 
Javascript :: find duplicates array javascript 
Javascript :: react native activity 
Javascript :: angular architecture patterns 
Javascript :: keyboard close when typing react native 
Javascript :: what are undeclared and undefined variables in javascript 
Javascript :: sequelize find query to return raw data in json object format 
Javascript :: upload file in node 
Javascript :: check if string contains a value in array 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =