shohan4556

Members
  • Content Count

    118
  • Joined

  • Last visited

Posts posted by shohan4556


  1. 3 hours ago, megmut said:

    Phaser SHOW_ALL doesn't actually scale 100% of the time. Not properly anyway. It sticks to the same aspect ratio calculated from when you created the game, however it doesn't determine if it needs to scale according to maximum width or maximum height. I'm in the process of writing a blog at the moment showing how to fix this issue, it's pretty straight forward but if have a look at the USER_SCALE, and the letterbox in relation to game design, that should be a good guide on where to get started :)

     

    So Whats the solution of the problem ?

    Should I use SHOW_ALL or USER_SCALE to solve the problem. please share your thought.


  2. Hello, I have noticed that my sprite position is not constant its differ for different mobile device please take a look at the image.

    
    BasicGame.Game.prototype = {
    
        init: function () {
         // also tried RESIZ not working 
            this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
            this.scale.pageAlignHorizontally = true;
            this.scale.pageAlignVertically = true;
    
            this.scale.setResizeCallback(this.gameResized, this);
            this.scale.updateLayout(true);
            this.scale.refresh();
    
        },
    
        preload: function () {
            this.load.image('cake','asset/cake-color.png');
        },
    
        create: function () {
            this.image1 = this.add.sprite(this.game.world.centerX,this.game.height-150,'cake');
    
            this.image1.anchor.setTo(0.5, 0.5);
            this.image1.scale.setTo(this.game.global.scaleRation);
    
        },
    
        gameResized: function (width, height) {
          // this.image1.x = Math.round(width/2);
           //this.image1.y = Math.round( height-120 );
        }
    
    };

    I have tried Scale Manager SHOW_ALL AND RESIZE but no result.

    is there any way to fix the problem, please help me.

    forum-post.png


  3. 34 minutes ago, denisb said:

    Lets say I have this code:

    var mySprite=this.add.sprite('mySprite');

    mySprite.alpha=0;

    var mySpriteTween=this.add.tween(mySprite);

    mySpriteTween.to({alpha:1},1000,'Linear',false,0,0,true);

    mySpriteTween.start();

    mySpriteTween.start();

    When I call start() the second time the tween does not run even though I have yoyo set to true and thus the alpha of mySprite has been tweened back to zero.

    Does the Tween Manager clear the TweenData object owned by mySpriteTween after it has completed?

     

    I think tween is cleared when its done. you set a timer loop to call the tween many times.