Advertisement
metalx1000

Phaser Fullscreen icon and function

Oct 18th, 2017
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fscreen(){
  2.   game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;
  3.   game.scale.startFullScreen();
  4. }
  5.  
  6. function fsIcon(icon){
  7.   var graphics = game.add.graphics(icon.x, icon.y);
  8.   // draw a rectangle
  9.   graphics.lineStyle(2, 0xFFFFFF, 1);
  10.   var fsicon = graphics.drawRect(0, 0, 25, 25);
  11.   game.input.onDown.add(fscreen, fsicon);
  12.   return fsicon;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement