Titus

Members
  • Content count

    8
  • Joined

  • Last visited

About Titus

  • Rank
    Newbie

Contact Methods

  • Twitter
    @turnerjordan855
  1. Can't create new objects in phaser group

    I'm also new to Phaser but when I tested your code I was able to add both 'devil' sprites to the game world so maybe something else is affecting it, but you could try putting the sprite into a variable and then add it to the group function create (){ capetinhas = game.add.group(); game.add.sprite(window.width,0,'tabuleiro');//loading the background var devil = game.add.sprite(128,128,'devil'); capetinhas.add(devil); }
  2. Define Game Scaling at Boot

    @samme Thanks for the reply. You are correct. I'm not sure what was going on yesterday but today I've tested it again and the scaling defined at boot is being applied to the rest of the game. I think I might have had some images cached.
  3. Sprite.alpha missing from version 2.6.0

    @samme actually it looks like it was removed. Well I couldn't see it in the docs anyway: https://phaser.io/docs/2.6.2/Phaser.Sprite.html
  4. Sprite.alpha missing from version 2.6.0

    Not too sure about v2.6.2 but I'm using v2.8.2 (CE) which is still updated and sprite definitely has an alpha property. I'd suggest using that version if you can.
  5. Define Game Scaling at Boot

    Hi, Just wondering if it is possible to define the scaling for a game only once in a single state (rather than in every state) and it is applied to all states thereafter? In the game I'm currently making I have a boot state and I want to define the scaling only once in the init function but it doesn't seem to apply to any following states and I have to define these settings on all pages: This is the code I'm using for scaling if it helps at all: init: function() { this.scale.pageAlignHorizontally = true; this.scale.scaleMode = Phaser.ScaleManager.USER_SCALE; this.scale.setUserScale(0.445, 0.445, 0, 0); }, I'm sure I must be missing something obvious. Any help would be appreciated.
  6. Game Scaling for a fixed frame size

    @ptotheaul Thank you! That was exactly what I was looking for.
  7. Game Scaling for a fixed frame size

    Thanks for the reply, mattstyles. Apologies if this is really obvious, but how would I achieve the below type of scaling when I setGameSize(853, 480); this.game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL; because when I change the game size, my 1920 x 1080 background image isn't scaled down to fit in the new game size. Or maybe what I should be doing is adding the background image and all the other assets to a group and then resizing them specifically for the fixed game size. I'm new to game development and not really sure what is possible or best practice within the Phaser framework. When the user fullscreens the game, the plan is to resize it dynamically. I do plan on having some safe zone on the background to allow for differences in aspect ratio and resolutions.
  8. Hi Guys, I've recently started using Phaser and I'm developing a game to be used in a web browser on PC and mobile. The game has to be displayed in a specific frame size (853 x 480). The game will also have a full screen button that would then scale the game to the user's device window. I have the assets for the game created at 1920 x 1080 and I would like to use them in the game by using Phaser's scaling methods. I have found lots of resources on how to scale the game world to the user's device for full screen but I cannot find a way to scale the game to a specific frame size. Here is where I initialise a new Phaser game. FireSim.game = new Phaser.Game(1920, 1080, Phaser.AUTO, 'game'); The plan is to create the game at 1920 x 1080 and add all the assets to the screen and then resize the game world to 853 x 480. To achieve this, I've tried: this.scale.setGameSize(853, 480); But this doesn't resize any of the assets within the game, only the game window. Do I need to add all the game assets to a group and then scale from there? Another way I could do this is to simply use two different sets of assets, those to be used in the fixed sized window and then when the user goes full screen it would pull the 1920 x 1080 assets and scale them accordingly. I feel like I might be missing something really obvious though, so any help would be appreciated. Thanks