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 :: calculate age from date of birth javascript 
Javascript :: reactjs libphonenumber 
Javascript :: Elementor Hide Sticky Header on Scroll Down - Show on Scroll Up 
Javascript :: phaser place items on circle reverse 
Javascript :: phaser random rectangle 
Javascript :: phaser add animation event 
Javascript :: phaser generate frame names 
Javascript :: phaser reverse animation 
Javascript :: share.sharesingle facebook react native 
Javascript :: javascript accordion 
Javascript :: how to invoke a function in a class 
Javascript :: Expresion regular para validar contraseñas 
Javascript :: Count the number of child records on the each parent object 
Javascript :: rxact 6 number long in yup validation 
Javascript :: mogoose schema to add json as a property 
Javascript :: Slice and Splice -Javascript 2 
Javascript :: iterating map javascript 
Javascript :: class declaration in javascript 
Javascript :: sort array method 
Javascript :: string charat 
Javascript :: console log like a pro 
Javascript :: Set CSS styles with javascript 
Javascript :: interface in javascript 
Javascript :: react native push notifications npm 
Javascript :: how to log all messages discord.js 
Javascript :: why we use $ in jquery 
Javascript :: for in loops javascript 
Javascript :: object methods 
Javascript :: what is console working for in js 
Javascript :: Material-ui add circle icon 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =