runeater Posted April 29, 2016 Share Posted April 29, 2016 I'm learning how to use javascript as well as pix.js to make simple games, however I am running into an issue while scaling buttons for my menu. Below is what I am working with right now, button0 fails to show up only when I attempt to scale it button1 shows up just fine in the below code segment. Does anyone know why this may be occuring? var button0 = new PIXI.Sprite.fromImage("Assets/buttons/play.png"); var button1 = new PIXI.Sprite.fromImage("Assets/buttons/highscores.png"); var button2 = new PIXI.Sprite.fromImage("Assets/buttons/shop.png"); var button3 = new PIXI.Sprite.fromImage("Assets/buttons/options.png"); var button4 = new PIXI.Sprite.fromImage("Assets/buttons/exit.png"); button0.scale -= 0.5; button0.interactive = true; button0.on("mousedown", startPress); button0.position.set(50, 100); stage.addChild(button0); button1.interactive = true; button1.on("mousedown", highscoresPress); button1.position.set(50, 200); stage.addChild(button1); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 29, 2016 Share Posted April 29, 2016 Scale is a point. //ok button0.scale.x = 0.5; button0.scale.y = 0.5; //ok too button0.scale.set(0.5); //WRONG button0.scale = 0.5; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.