Ivasik

Members
  • Content Count

    34
  • Joined

  • Last visited

Everything posted by Ivasik

  1. If a custom button that displays an error: Uncaught TypeError: Cannot read property 'anchor' of undefined If the text and buttons all in the same way as with anchor.set. :\
  2. For to set custom button or for button and text?
  3. this.game.width, this.game.height you need to resize the elements do not remain in place and has changed his position. //example this.play_game= this.add.button(this.game.width, this.game.height, 'test_button', this.play_game_functions, this); this.play_game.anchor.set(1.65, 7.5); resize: function(width, height) { this.play_game.x = this.game.width; this.play_game.y = this.game.height; }
  4. Ivasik

    SpriteBatch

    var expression = 1+2; //Get "Test test test" var expression = 1; //Get "Nice" switch (expression) { case 1: alert("Nice"); break; case 2: alert("Good Job!"); break; case 3: alert("Test test test"); break; default: statements_def break; } I hope I understand the question. https://jsfiddle.net/ytrtfdxm/
  5. Hi, i have a custom buttons and i want apply anchor. How to do it? Custom buttons: this.button_start = this.btn("Play a game", this.play_game, 2.03, 15.1, 2, 8.5, 140, 30); btn: function(name, functions, anc1X, anc1Y, anc2X, anc2Y, w, h) { this.button = this.game.add.button(this.game.width, this.game.height, '', functions, this); this.button.name = name; this.button.width = w; this.button.height = h; this.button.anchor.set(anc1X, anc1Y);//Temporary this.text = this.add.bitmapText(this.game.width, this.game.height, 'Text_mainmenu', this.button.name, 46); this.text.anchor.set(anc2X, anc2Y);//Temporary } /* name - the name of the button functions - button function anc1X - first anchor.setX anc1Y - first anchor.setY anc2X - two anchor.setX anc2Y - two anchor.setY */
  6. Maybe: MyGame.StateA = function (game) { this.background = null; this.sprite = null; this.windMax = 0; this.emitter1 = null; this.emitter2 = null; this.emitter3 = null; this.emitter4 = null; this.emitter5 = null; this.emitter6 = null; this.declenche; };
  7. If I write: particle.events.onInputDown.add(declenche, this); I will write that there is no such function. particle.events.onInputDown.add(this.declenche, this); Maybe the problem will disappear...
  8. Hi, how to make fullscreen not in viewport?(Like when you press F11) and with resize.
  9. Hi, how to make bold BitMapText?
  10. I need it in the form of a slider, not slider.
  11. Not right animationDuration: 0 Correctly animationDuration: 1
  12. For the future, if possible make a vertical flip(as a separate library). Example:
  13. How about "I would also like to see the implementation of the memorization of the slide at which he stopped"?
  14. Can someone loop slider? That did not stop at ending the slide and repeated the first. I would also like to see the implementation of the memorization of the slide at which he stopped
  15. Lastly I wanted to ask, there is a code: musics = new Array ('Main_Theme', 'Main_Theme1', 'Main_Theme2', 'Main_Theme3', 'Main_Theme4', 'Main_Theme5'); random = Math.floor(Math.random() * musics.length); music = this.game.add.audio(musics[random]); music.play(); As at the end of the music again to make a mixed music and playing?
  16. So if I call a separate file "blue.png", "green.png", throw them in satin and after specifying their name, I don't have to enter the coordinates of their location? I understood you correctly?
  17. Explain easier, I have a picture(attached). How to find the coordinates of the red, blue, green rectangles?
  18. How to determine the coordinates of the textures in the Atlas, to easily make an animation of 10 and more images ? My code: {"frames": [ { "filename": "gems.swf/0000", "frame": {"x":19, "y":12, "w":129, "h":129}, "rotated": false, "trimmed": true, "spriteSourceSize": {"x":0, "y":0, "w":129, "h":129}, "sourceSize": {"w":129, "h":129} }, { "filename": "gems.swf/0019", "frame": {"x":0, "y":1355, "w":447, "h":412}, "rotated": false, "trimmed": true, "spriteSourceSize": {"x":-14, "y":-2, "w":447, "h":412}, "sourceSize": {"w":447, "h":412} }], "meta": { "version": "1.0", "image": "textures.png", "format": "RGBA8888", "size": {"w":1072,"h":1756}, "scale": "1", "smartupdate": "$TexturePacker:SmartUpdate:c510ff2f709e8d175b059cd1cbe64773$" } }
  19. There is a code of creating animated group pictures(2 pictures). How to kill/destroy/remove at the beginning of image 1, then 2? lives_kill = this.game.add.group(); for (var i = 0; i < 2; i++) { gem_kill = lives_kill.create(game.world.width - 1142 + (33 * i), 405, 'lives'); gem_kill.scale.set(0.25); }
  20. Hi guys! I have: pass_round: function() { live = lives.getFirstAlive(); if (live) { live.kill(); } if (lives.countLiving() < 1) { this.game.state.start('mainmenu'); } }, //and update: function() { if (this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR).duration > 1000) { this.pass_round(); } } and after holding spacebar lost all lives, instead of one. How to solve this problem?
  21. Hello guys! How to automatically change background image when zooming in or out of the browser window?
  22. As at the end of the music re-play it? Code at the moment: var musics = new Array ('Main_Theme', 'Main_Theme2'); var random = Math.floor(Math.random() * musics.length); music = this.game.add.audio(musics[random]); music.play();
  23. Talk to you again, so as not to create a separate subject. How can I make the tabs, as is done in bootstrap and generally in js. Without html, just js+phaser, if you can:)