Warning: The magic method EDD_Blocks::__wakeup() must have public visibility in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/edd-blocks-master/edd-blocks.php on line 101

Warning: The magic method EDD_Blocks::__wakeup() must have public visibility in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/edd-blocks/edd-blocks.php on line 101

Warning: The magic method GAINWP_Manager::__wakeup() must have public visibility in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/gainwp.php on line 78

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 555

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 585

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 617

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 651

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 686

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 745

Deprecated: Optional parameter $filter declared before required parameter $metric is implicitly treated as a required parameter in /home/wcc1969/public_html/phasergames.com/wp-content/plugins/ga-in/tools/gapi.php on line 785
Phaser Utilities - Phaser Games

Phaser Utilities

Phaser Utilities

This pack of utilities includes:

  • Align Grid Class
  • Align Class
  • UiBlock

Align Grid

This is a grid for marking out UI or other games elements based on screen size. Learn more here.

Set Up
this.aGrid = new AlignGrid({scene: this,rows: 11,cols: 11});

Show the grid

this.aGrid.showNumbers();

Place An Item On Grid

var face=this.add.image(0,0,’face’);

this.aGrid.placeAtIndex(5,face);

Align Class

The align class is used for centering and scaling.

Scale an item to a percentage of the game’s width

Align.scaleToGameW(face,.1);

Centering

Align.center(face);

Align center horizontal

Align.centerH(face);

Align center vertical

Align.centerV(face);

The UIBlock

Use this as an alernative to Phaser Containers. Read more here.

class myUI extends UIBlock {
constructor(config) {
super();
}
}