Jump to content

Search the Community

Showing results for tags '9 patch'.

  • 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 1 result

  1. Hello! I want to create my own buttons with some tool like "draw 9 patch" (so that they scale correctly) and use them in Phaser, but as I see, Phaser does not support it. Are there any plans to make phaser compatible with that technology? I found this post, but it didn't help me because i have my buttons packed in an atlas and I load them in the game as a custom class that inherits from "Phaser.Button" class and resizes the image depending on the label size it contains, I don't load it as an image as the example shows, and I don't know how can I make it work this way. For the moment, I'll create multiple buttons of multiple suizes, but I'd like to avoid that, asi it is not very efficient :/ Example of the constructor of my CustomButton class: function CustomButton(x, y, atlas, callBack, btnName, strLabel, intFontSize) { Phaser.Button.call(this, game, x, y, atlas, callBack, this, btnName + 'Up', btnName + 'Up', btnName + 'Down'); this.intFontSize = intFontSize || 50; this.strLabel = strLabel || ''; this.inputEnabled = true; game.add.existing(this); this.anchor.setTo(0.5, 0.5); var intScale = Tools.prototype.getScale(); if (strLabel == undefined) { this.scale.setTo(intScale); } else { this.lblButton = game.add.text(x, y, this.strLabel, { font: this.intFontSize + 'px Arial', fill: '#ffffff'}); this.lblButton.anchor.setTo(0.5, 0.5); this.width = this.lblButton.width + (180*intScale); this.height = this.lblButton.height + (40*intScale); } }
×
×
  • Create New...