Skip to content

Instantly share code, notes, and snippets.

View EvidentlyCube's full-sized avatar

Maurycy Zarzycki EvidentlyCube

View GitHub Profile
@EvidentlyCube
EvidentlyCube / Align_Center_Middle.ts
Last active August 29, 2015 14:19
Phaser augments by Retrocade.net
(function(Phaser, PIXI){
var defineFor = function(classDef){
classDef.prototype.positionCenter = function(){
this.center = Phaser.GAMES[0].width / 2;
};
classDef.prototype.positionMiddle = function(){
this.middle = Phaser.GAMES[0].height / 2;
};
classDef.prototype.positionCenterParent = function(){
if (this.parent !== null){