Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

change x scale phaser

function preload ()
{
    this.load.image('atari', 'assets/sprites/atari130xe.png');
}

function create ()
{
    //  setScale sets the x and y scale values (1 = no scale)
    this.add.image(400, 100, 'atari').setScale(0.5, 1);

    this.add.image(400, 300, 'atari').setScale(2, 1);

    var image2 = this.add.image(400, 500, 'atari');

    //  You can also set the scale via the scaleX property:
    image2.scaleX = 2.5;
}
Comment

change xy scale phaser

function preload ()
{
    this.load.image('atari', 'assets/sprites/atari130xe.png');
}

function create ()
{
    //  setScale sets the x and y scale values
    this.add.image(100, 300, 'atari').setScale(0.5, 0.2);

    //  If you just provide one value then both x and y are set to it
    this.add.image(400, 300, 'atari').setScale(2);

    var image2 = this.add.image(800, 300, 'atari');

    //  You can also set the scale via the scaleX and scaleY properties:
    image2.scaleX = 0.5;
    image2.scaleY = 4.5;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Javascripti functions accepting Flask parameters to display a PDF file with Adobe Embed API 
Javascript :: gatsby js quick start 
Javascript :: Cntrlsss:$.Control-Ai 
Javascript :: phaser place items on circle 
Javascript :: phaser random line 
Javascript :: phaser 60 fps animation test 
Javascript :: phaser animation from json 
Javascript :: phaser remove animation event 
Javascript :: test unitaire javascript 
Javascript :: using cron with bull node js 
Javascript :: axios imgbb 
Javascript :: Expresion regular para validar nombres de usuario 
Javascript :: nodejs mongodb native reuse single connection 
Javascript :: debounce getx 
Javascript :: get elements by class name wildcard 
Javascript :: convert javascript to python 
Javascript :: block scoped in js 
Javascript :: js index of 
Javascript :: array sort 
Javascript :: string get a letter by index 
Javascript :: undefined value check in javascript 
Javascript :: how to do subtraction in javascript 
Javascript :: javascript run function 
Javascript :: javascript make do while loop 
Javascript :: update to new npm 
Javascript :: spread operator react array 
Javascript :: javascript array length 
Javascript :: object properties 
Javascript :: react-native-geolocation-service 
Javascript :: python to java script 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =