klg

Members
  • Content Count

    20
  • Joined

  • Last visited

About klg

  • Rank
    Member

Profile Information

  • Gender
    Male
  1. Thanks for the help. I'll do as dryahes said.
  2. Hi Michael, Thanks for the reply. I use sprite.tint = config.colors.primaryColor;to set the colors when these sprites are created. This is done for multiple sprites and some sprites have different colors. To change the color again with sprite.tint, I will need to keep a track of all these sprites globally since they are present in different functions. Also, as you said in your reply, just updating the color like config.colors.primaryColor = newColorValue;does not work. Is there any way to force stage to redraw all elements?
  3. Hi All, Is there a way to invalidate stage and force phaser to redraw all elements on it? Basically my game is supposed to have multiple themes and user can change themes after the game is loaded. Currently I have a javascript object with all the theme colors but it seems like just changing the primary color value in the object does not update elements/buttons using it. Is there a way to achieve this? Thank You so much in advance.
  4. Hi mariogarranz, I've almost the same situation as you do and haven't been able to figure out the solution. I'm not sure why there is no performance boost when I set visible or renderable property to false.
  5. Hi, I cannot find a lot of examples on web for using audiosprites in phaser except this one: http://phaser.io/examples/v2/audio/audio-sprite-json In the above example both markers and JSON file is used. Since I have already provided the JSON file, do I still need to create markers? Thanks for your help in advance.
  6. Yup that's exactly what I did. Thanks for the reply achexi.
  7. Thank Rich. By reading the API, I thought they might swap the X and Y positions too. Also, thank you so much for the awesome framework and all the support you are providing for it.
  8. Hi Everyone, I'm trying to understand what swap() and swapChildren() methods in group do. Can they be used to swap X and Y positions of children in group? The example here only seems to swap the Z position. Should I update X and Y position manually or does phaser has a method for that? Thanks
  9. I am currently working on a multiplayer game that uses node and socketio for backend and the frontend in created using phaser. For persistence you can try mongodb or mysql.
  10. Hi, I noticed that the tween onComplete is called before the animation is completed. Basically I am animating a sprite on X axis and calling onComplete when its done. The x position of sprite in onComplete does not seem to be the final position. Did anyone else experience the same behavior? Thanks. Edit: I am sorry. Admins, please delete this topic if possible. I have those sprites inside a group and I was animating the group and reading sprite world position for some reason the sprite position is not the final position but group position is fine. I can use that in my case.
  11. klg

    Masking group of sprites

    Thanks mxmlb. I'll give this a try. I'm using sprite.input for click event so inputEnabled should work too. I was trying to find a way to do this with phaser or pixi rather than doing it manually. I'll assume that phaser or pixi does not have any way to take care of interactive sprites in masked area. Edit: I was able to make this work by changing the inputEnabled property on sprite. Thanks again mxmlb and beuleal for your help.
  12. klg

    Masking group of sprites

    I'm not sure how to get the slider effect using sprite.visible property. Is it possible? The sprites are positioned at different x and y coordinates inside group. Basically I want to have this group on 70 percent of my canvas width and rest 30 percent will have something else. Thank you so much for trying to help me.
  13. klg

    Masking group of sprites

    Forgot to quote you in my reply. Thanks.
  14. klg

    Masking group of sprites

    Hi beuleal, Thanks you so much for sharing your answer. I don't think this will work in my case. I do not have a slider with images. I have a bunch of cards generated as a bitmapdata. These bitmapdata are used to create sprites which are added to a group. Also, the cards are generated using data from the server and depending on the screen size I show 3, 6, 9, 12 etc cards in a table at a certain time. All other cards can be accessed by next and prev buttons. I noticed there is a property called hitArea. do you know anything about this one. I'm trying to use this in my case but it does not seem to work. Thanks again.
  15. Hi kid_karma, were you able to find a solution or any workaround for this issue. I am also working on a game where I need to mask interactive objects. Thanks.