damager

Members
  • Content Count

    23
  • Joined

  • Last visited

About damager

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    Ukraine

Recent Profile Visitors

343 profile views
  1. damager

    Click in the center

    Also you can check in the input handler intersection of custom created rectangle and pointer
  2. damager

    Scale Artifacts

    Fixed(just lag with padding in texture atlas)
  3. damager

    Scale Artifacts

    Hi, i have weird problem with my sprites when i scale them down, some artifacts appears on edge of some(not of all) sprites. When i turn antialias off they're not appearing, but my game is not pixel art game) Do anyone know how can i fix this? Or the reasons why that artifacts are appearing? Thanks)
  4. damager

    performance v3.9.0

    It's hard to say what's wrong without code, but what about draw calls statistic?
  5. damager

    BitmapData drawcalls

    Thanks for detailed answer. That's the mask image, i have about 20 mask images for puzzle pieces. I load images for puzzle from server. There is not actual in-game code, just sample for testing(cause algorithm of puzzle creation too big for simple explanation). About the text, i've tried to draw button sprites and then only text, but if i "addChild" text into button, it draws next to that button, doesn't matter where i call it in the code. And i tried to not "addChild" and only try to update text scale, position, etc. to button, but this doesn't work as i expected. I guess you told about this post, but my problem is about "addChild" text i think)
  6. damager

    BitmapData drawcalls

    Also i'm wondering if there some way to improve webfont draw call optimization? cause i have 3 buttons and it takes 6 draw calls to create them, is there way to improve this?May be render as image or something like that. P.S Thanks a lot to everyone for your advices)
  7. damager

    BitmapData drawcalls

    I'm using https://www.leshylabs.com/apps/sstool/ and it's pretty good, but as mentioned rich i need to dynamically generated atlas. But thank you for you answer) My problem solved(i hope so) by generating textureAtlas. my code if it'll help someone: let str:string = '{"frames":{'; let bmpTexture:Phaser.BitmapData = this.game.make.bitmapData(750,750); //Puzzle pieces block let _puzzlePieceSrc:Phaser.Sprite = this.game.make.sprite(0,0, "gameAssets", "puzzlePiece"); let _puzzleBmpData:Phaser.BitmapData = this.game.make.bitmapData(_puzzlePieceSrc.width, _puzzlePieceSrc.height); let sp:Phaser.Sprite; for(let i:number = 0; i<6; i++) { _puzzleBmpData = this.game.make.bitmapData(_puzzlePieceSrc.width, _puzzlePieceSrc.height); _puzzleBmpData.alphaMask(this._puzzleImage, _puzzlePieceSrc, new Phaser.Rectangle(-100*i,0,600,400)); sp = this.game.make.sprite(150*i,0,_puzzleBmpData); str += '"'+(i+1)+'":{"frame":{"x":'+sp.x+',"y":'+sp.y+',"w":'+sp.width+',"h":'+sp.height+'},"rotated":false,'+ '"trimmed":false,"spriteSourceSize":{"x":'+sp.x+',"y":'+sp.y+',"w":'+sp.width+',"h":'+sp.height+ '},"sourceSize":{"w":'+sp.width+',"h":'+sp.height+'}}'; bmpTexture.draw(sp, 150*i, 0); if(i<5) str+=','; } str+='}}'; this.game.cache.addTextureAtlas("pz", null, bmpTexture.canvas, JSON.parse(str), Phaser.Loader.TEXTURE_ATLAS_JSON_HASH);
  8. damager

    BitmapData drawcalls

    Thanks a lot for your answers. Unfortunatelly i can't create puzzle atlases because i'm using dynamically loaded images for puzzle. I'm not sure how to correctly create spritesheet for this task, but i'm wondering is there a way to create dynamically texture atlas and put all of this puzzle pieces into it and use it? I've found cache addTextureAtlas function but i'm not sure how to create the texture from all of this sprites.
  9. damager

    BitmapData drawcalls

    Hi, in my game(jigsaw puzzle) i'm using bitmapData and alphaMask to create puzzle pieces, but for each piece creates separate draw call and when it goes like 100 pieces there's a problem. Is there a way to reduce draw calls? Please help, thank you)
  10. Hi, i have a weird problem with sprite based on alphamask on my mobile(meizu m3). There is some flashing black random rectangles creating near the sprite(i'm creating a jigsaw puzzle game and every piece of it is a sprite based on alphamask). Do someone know what it might be? What am i doing wrong? On desktop everything is fine. My code below - puzzle piece class constructor based on Phaser.Sprite (sorry for my English ) phaser CE v.2.11.0 : let _puzzlePieceSrc:Phaser.Sprite = new Phaser.Sprite(game,0,0, "puzzleMask"); _puzzlePieceSrc.scale.setTo(defaultScale); let _puzzleBmpData:Phaser.BitmapData = game.make.bitmapData(_puzzlePieceSrc.width, _puzzlePieceSrc.height); _puzzleBmpData.alphaMask(souceImage, _puzzlePieceSrc, new Phaser.Rectangle(x,y,600,400)); super(game,x,y, _puzzleBmpData);
  11. damager

    Sound muteOnPause problem

    Okay, i don't know who is fixing bugs on phaser. But that was definately bug. I add code of checking boolean "muteOnPause", cause that checking was only in Stage Visability handler, not in game pause setter. I think that there's can be another variable like "muteOnDomPause" and "muteOnPause". set: function (value) { if (value === true) { if (this._paused === false) { this._paused = true; if (this.sound.muteOnPause) { this.sound.setMute(); } this.time.gamePaused(); this.onPause.dispatch(this); } this._codePaused = true; } else { if (this._paused) { this._paused = false; if (this.sound.muteOnPause) { this.sound.unsetMute(); } this.input.reset(); this.time.gameResumed(); this.onResume.dispatch(this); } this._codePaused = false; } } P.S In my game i did the next thing: i create 2 variables: muteOnDOMPause and muteOnPause. and every usage of previous of muteOnPause i change as muteOnDOMPause, and in setter of game pause and only there i use muteOnPause; In game i can actually choose what kind of mute i need
  12. damager

    Sound muteOnPause problem

    It doesn't mute when the game window is unfocused, but when game paused it does.
  13. damager

    Sound muteOnPause problem

    Hi, i have music in my game, but i don't want to stop it when game paused. I found "this.game.muteOnPause = false" but it doesn't work. What am i doing wrong? Thanks. Phaser v2.10.0
  14. damager

    Body mass problem

    No, body with high mass just walking through, but if mass like 9999 the body collide with bounds..that's problem with static body collision i think. But i don;t know how to solve it
  15. damager

    Body mass problem

    Hi, i need help. I tried to make Dynamic body without influence of other bodies, just like kinematic body, but with collision detection. So i decided to set body.mass = 99999999 and that worked perfectly, but when i'm setting collideWorldBounds = true player just walking through world Bounds...Is there an answer to do this right? I've tried sensors but they don't working...