• Content Count

  • Joined

  • Last visited

About grinmonk

  • Rank

Contact Methods

  • Twitter

Recent Profile Visitors

605 profile views
  1. @EpicKingdom_ Have you tried scaling your game in a browser? I would recommend using Chrome's device emulation:
  2. this.inputEnableChildren = true; this.onChildInputDown.add(() => this.onClick.dispatch(this)); I use the code above to track input on my Group. But when I cache the Group: this.cacheAsBitmap = true; ...the signal stops working. Is there a way to handle input on a cached Group?
  3. @samme Thanks a lot! I will try your suggestion out. And thanks for the fix.
  4. @samme Thanks for your response! Am I correct that you suggest to replace Math.floor with bitwise OR? But aren't the results going to be the same? Could you please explain in more detail or point out where can I read about it? Thanks!
  5. I'm trying to zoom camera (change its scale) while focused on a player on a tilemap. const speed = 0.01; if (this.cursors.up.isDown) {, speed); } else if (this.cursors.down.isDown) {, -speed); } This is how I create the map: this.map16 ="tilemap16"); this.map16.addTilesetImage("xrpg_tileset", "tileset16"); this.wallsLayer = this.map16.createLayer('Walls'); Both player object and the map layers are placed in the World. But it seems that tilemap layer's position is affected by camera's zoom which looks wrong: To check if something is wrong with the scene I replaced the map with an image and zoom worked correctly: The behaivor is identical in 2.6.2 and 2.10.3.
  6. Initially the height value comes from here: But then it gets rounded to zero:
  7. We moved our game from Phaser 2.6.2 "Kore Springs" to 2.10.3 and encountered this error in Firefox and Internet Explorer: IndexSizeError: Index or size is negative or greater than the allowed amount The exception is trown from PIXI.Sprite.prototype._renderCanvas: renderSession.context.drawImage(this.texture.baseTexture.source, cx, cy, cw, ch, dx, dy, cw / resolution, ch / resolution); The arguments are: cx : 803 cy : 899.37 cw : 168 ch : 0 dx : -0 dy : -0.6299999999999955 resolution : 1 Everything was fine in "Kore Springs" but we wanted to take advantage of all the fixes and updates on tilemaps in CE.
  8. grinmonk

    Stop RAF updating

    I want to stop RAF updating when my scene (canvas) is not mounted. I thought that pausing the game would do that, but updateRAF() method is being launched anyway.
  9. I have the same problem on 2.5.0. Adding graphics to a sprite does not affect sprite's dimensions. I have found this issue: Ok, if this does not happen automatically, is there a way to update sprite's bounds without scaling?
  10. grinmonk

    Input events propagation

    I have a very trivial nested-sprites situation, similar to this: function create() { var sprite = game.add.sprite(0, 0, 'phaser'); sprite.width = 100; sprite.width = 100; sprite.inputEnabled = true;{console.log("parent clicked")}); var child = game.make.sprite(0, 0, 'phaser'); child.width = 10; child.width = 10; sprite.addChild(child); child.inputEnabled = true;{console.log("child clicked")}); //child.input.priorityID = 1; } The problem is that by default the parent catches the click event and does not propagate it to the child. How do I make both child and parent catch the click event?
  11. grinmonk

    Centering an object relatively to its parent

    @blackgames, thanks for a solution! I think it suits right. But what if sprite's anchor is changed due to some adaptive positioning (for example)? Then it is going to ruin internal positioning.
  12. grinmonk

    Centering an object relatively to its parent

    Solved by setting text position to (0, 0): var text = game.make.text(0, 0, "Yo", { font: "10px Arial", fill: "#ffffff", align: "center" }); Am I correct, that children are positioned relatively to parent's anchor?
  13. Hi! With this code I try to put a text object in the center of a sprite, which is in its turn is centered relatively to the world. var sprite = game.add.sprite(0, 0, 'phaser'); sprite.anchor.set(0.5); sprite.x = * 0.5; sprite.y = * 0.5; var text = game.make.text(sprite.width * 0.5, sprite.height * 0.5, "Yo", { font: "10px Arial", fill: "#ffffff", align: "center" }); text.anchor.set(0.5); sprite.addChild(text); But what I get is this: instead of this: What am I doing wrong and how to achive my goal? Thanks!
  14. grinmonk

    Phaser documentation issue

    The website is pretty beautiful but there is a problem with documentation that I would like to be solved: whenever I learn about some Phaser class I need to see both public properties and methods. But with current implementation I have to scroll through all the public properties (which may be a long list) to the methods (example: There at least could be an anchor to the Public Methods at the top of the page, but I think it would be better if there was an index of all public methods and properties at the top of a class page. Sorry if this is not the best place to post this kind of a problem.
  15. grinmonk

    Multipack texture atlases

    Sorry for bumping the thread. Are there any news on atlas multipack support in Phaser 2?