Jump to content

Search the Community

Showing results for tags 'Phaser.Image'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. Hi, when I create an empty image, I always get a 32x32 pixels image. //As you can see, I'm not passing any 'key' this.img = this.game.add.image(x, y); Then, even after adding a rectangle to my Phaser.Image, its size is still 32x32. this.rect = new Phaser.Graphics(game); this.rect.beginFill(color, alpha); this.rect.drawRect(0, 0, 200, 100); this.rect.endFill(); this.img.addChild(this.rect); And if I manually set the image width and height properties, it would scale the image children. So, how can I create an empty Phaser.Image of a specific size? Edit: I'm not sure this is the right way of doing it, but I guess I could give this image a texture with the size I need.
  2. I'm trying to extend the Phaser.Image class in Typescript so I can create some buttons for my UI, and remove some clutter from my main js file. IE: exitButton.anchor.setTo(0.5, 0.5);exitButton.inputEnabled = true;exitButton.visible = true;to var exitImage = new ButtonImage(this.game, (this.scale.width -this.yGridMargin), this.scale.height, 'buttonSheet', 5);When I run the game chrome and firefox return this.game is null or cannot read property cache of null. The console seems to be point to line 35779 in the phaser.js file. else if (typeof key === 'string' && !this.game.cache.checkImageKey(key))ButtonImage ///<reference path = "../tsDefinitions/phaser.d.ts" />module BasicGame{ export class ButtonImage extends Phaser.Image{ constructor(game: Phaser.Game, x:number, y:number, key:any, frame: number | string){ //constructor(x: number, y:number, key: any | 'string', frame: number | string){ super(this.game, x, y, key, frame); this.anchor.setTo(0.5, 0.5); this.inputEnabled = true; this.visible = true; //game.add.existing(this); } } }Any help is much appreciated. *edit for language context
×
×
  • Create New...