Search the Community
Showing results for tags 'phas3r'.
-
I am trying to make a toggle button. So I made a spriteSheet with the two frames with the positions that the button can have. this.load.spritesheet('buttontog', 'assets/tbspr.png', {frameWidth: 160, frameHeight: 47}); It works when I click it once, toggling it. this.buttontog = this.add.sprite(660,420, 'buttontog', this.frame = 0) .setInteractive({useHandCursor: true}) .on('pointerup', () => {if (this.frame == 0) this.buttontog.setFrame(1); if(this.frame == 1) this.buttontog.setFrame(0);}); What I can't do is to "untoggle" it, and is why I am here, so I can ask for your help. since I am new to this framework. This is the spriteSheet:
-
I need an area where like half the screen will only do 50% the normal physics calculations! This will be useful for items inside water areas