Jump to content

Dylan Cristy

Members
  • Content Count

    10
  • Joined

  • Last visited

About Dylan Cristy

  • Rank
    Member

Recent Profile Visitors

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

  1. Bump. Some things I tried which did not work: On every update: setting the group's mask to null, then clearing and re drawing the rect, then reassigning the Phaser.Graphics object as the group's mask. On every update: killing, then clearing, then reviving the Phaser.Graphics object, and then re drawing the rect.
  2. @samme is right, you have to use scaleMode.RESIZE. I found that in a web browser, sometimes the resize callback didn't always get fired on the very last bit of resizing/moving, so here is how I implemented resizing/realigning: In my Boot state, set the scale mode for the game: this.game.scale.scaleMode = Phaser.ScaleManager.RESIZE; Then, in my other game states (levels), I set flags for whether things need to be realigned (or not), and in the resize callback, only set the flag, and I do all the actual resizing in update(), like this: create() { this.game.scale.setRe
  3. Similar to this post, I am applying a mask to a group, and then clearing and redrawing the mask each update after things are re positioned. It was working fine, but then I made some changes to some other code that shouldn't affect the masking, but now for some reason the masked area is not updating, even though the Phaser.Graphics.graphicsData.shape appears to be in the right place. Here's my update code: if (this.buttonMask) { this.buttonMask.clear(); this.buttonMask.beginFill(0xffffff); let buttonMaskWidth = // my calculations to figure out the width let buttonM
  4. Nice, that worked, thanks! I think it was the difference of game.scale.fullScreenTarget = document.body; and game.scale.fullScreenTarget = document.documentElement;
  5. Hmm, I tried this.game.stage.addChild(new Phaser.TileSprite(0, 0, this.game.width, this.game.height, 'MyTileName')); but that seems to add it in front of the World, meaning, I can't see my main menu title or buttons. I know the buttons are there though, because when I mouse over where they should be, the pointer changes to a hand. And then if I click the button to start the game in fullscreen mode, the tiling does not continue to fill the screen, it ends at what would have been the height set in the TileSprite constructor. Is there something I have to do to reset the tili
  6. I am running my game as "transparent", directly in the body element, and setting a repeated tile background in the body through CSS. If I enter fullscreen mode through a button click that triggers this.game.scale.startFullScreen(), the background tiling disappears and there's just a black background. If I enter fullscreen mode "manually" (by physically pressing F11), the background remains. What am I missing about how to start fullscreen mode? How can I preserve the background?
  7. I have some sprites that are set to horizontal drag only. What I want to do is, if someone drags vertically up from one of those sprites, when they leave the bounds of that sprite (top edge), spawn a new sprite and be actively dragging that new sprite. The user should not have to release the mouse button, they should just instantly be dragging the new sprite. I can successfully calculate when the pointer is leaving the first sprite, and spawn a new sprite at that location, but I can't seem to transfer the drag control. I tried Pointer.swapTarget, but that doesn't seem to work -
  8. Gotcha. The hierarchy is Game > Stage > World. Interesting that you think the rendering problem is debug specific. It would certainly fit with what I have seen, which is that I have only noticed the problem with debug text and geometry.
  9. Hi, new to Phaser. I am having a little difficulty understanding the concepts of the Stage vs the World, which one controls what is rendered, and why they apparently don't match my Game dimensions. I am using Phaser 2.6.2. I create a Game with width 607 and height 1080 (16:9 portrait, would be pixel-perfect in fullscreen), and in my boot script I set scale mode to SHOW_ALL and set pageAlignHorizontally to true. In my first level, I set the game.stage.backgroundColor, and I create a group of buttons, and I set the buttonGroup.alignIn(this.game.world.bounds, Phaser.BOTTOM_CENTER). A
×
×
  • Create New...