vastron

Members
  • Content Count

    16
  • Joined

  • Last visited

About vastron

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. vastron

    Loading assets

    Make sure you provide the correct file name, this.load.image('boat',' 'assets/bubble.png ')' Also, I can not see your create method. Is it similar to this? create: function(){ var boat = this.add.sprite(game.width/2,game.height/2,'boat'); boat.anchor.setTo(0.5); }
  2. vastron

    Phaser 2 PWA Scaling Issue

    Hello, I created a pwa with Phaser 2, following this tutorial https://phaser.io/news/2018/10/progressive-web-apps-tutorial. I face a problem with how the game scales on mobile. In my game I use these Phaser 2 methods: game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; When I click the localhost link in my mobile, the game is way too big and when I 'download' it to act like an app, it gets really shaky at first, scaling up and down until it settles to the correct size. The game dimensions are 1280x720. It looked very nice before I converted it to a PWA. I did an audit for a PWA in Chrome's dev tools and it showed this notification: The viewport size is 1280px, whereas the window size is 412px. Do you have any idea on how to fix this issue?
  3. vastron

    Icon fonts support

    Guys I did not get this to work, can you please help me? This is my code: <link rel="stylesheet" href="lib/fontawesome-free-5.0.13/web-fonts-with-css/css/fontawesome-all.min.css" /> <script src="lib/phaser.js"></script> <script src="scripts/game.js"></script> this.computer = this.add.text(100, 100, '\uf108 ', { fill: '#4286f4', font: '30px FontAwesome' }); console.log(this.computer.text); All I get is this :
  4. vastron

    Cross word

    Another crossword puzzle published in Issue 120 of Phaser World, http://phaser.io/news/2018/04/crossword-scape
  5. vastron

    Cross word

    @GSB Take a look at this tutorial. https://www.joshmorony.com/part-2-building-a-word-search-game-in-html5-with-phaser/ It is a very good game but to my understanding it does not place specific words in the grid. It randomly places letters from the alphabet in the grid and if the player finds a word, it checks if such a word exists in a text file that is loaded to the game.
  6. vastron

    Cross word puzzle

    @GSB Take a look at this tutorial. https://www.joshmorony.com/part-2-building-a-word-search-game-in-html5-with-phaser/ It is a very good game but to my understanding it does not place specific words in the grid. It randomly places letters from the alphabet in the grid and if the player finds a word, it checks if such a word exists in a text file that is loaded to the game.
  7. vastron

    Scaling and input fields

    in my case it worked like this: in html i do this : <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width" /> in css, this: * { padding: 0; margin: 0; } and in phaser i do this game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true;
  8. I ended up creating a modal and styled it like this. My game is inside the #canvasWrapper. It now looks ok with the game scaling! <style> body { background-color: black; box-sizing: border-box; } * { padding: 0; margin: 0; } #canvasWrapper { width: 99vw; height: 99vh; margin: 0 auto; } .modal.in { display: flex !important; } .modal .modal-dialog { margin: auto; } h4 { text-align: center; } .fa-undo-alt, .fa-check { display: none; } .modal-dialog { z-index: 50000; } @media screen and (orientation: portrait) { body.modal-open { position: fixed; } } </style>
  9. Thank you, I tried it, but it seems I cannot escape media queries, so I am thinking of using the bootstrap modal for my form.
  10. Hi guys, I have created some input fields in the DOM and I place them above my phaser game with css. In my game I use game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; so I use media queries to control the position of the input fields. I do it like this => #inputs { position: absolute; top: 30%; left: 40%; width:100%; } @media only screen and (max-width: 560px) { #inputs{ top: 35%; left: 20%; transform: scale(0.8,0.8); } } But it is almost impossible to follow the Phaser scaling!If you have any tips, please share!
  11. vastron

    Sprite flickering

    These two have worked for me. Try setting up a max velocity (sprite.body.maxVelocity.x = 300), if flickering persists try enabling the game in Phaser.CANVAS mode , not Phaser.AUTO.
  12. vastron

    HTML text input within Phaser canvas

    It is a great plugin but unfortunately it does not work on mobiles. Edit!!!!!!!!!!!!! It does if you put <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width" /> on your html file.
  13. Hi guys, does this work on mobile devices?
  14. vastron

    [Plugin] phaser-input

    It works if you put this meta tag <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width" /> on your html file!
  15. vastron

    space invaders example : little bug

    thank you very much for this!