gwinnell

Members
  • Content Count

    10
  • Joined

  • Last visited

About gwinnell

  • Rank
    Member

Contact Methods

  • Website URL
    http://forceofhab.it/
  • Twitter
    @ashleygwinnell

Profile Information

  • Gender
    Not Telling
  • Location
    Bristol

Recent Profile Visitors

1095 profile views
  1. Someone has done a really shoddy job resurfacing the pavement by my house. @BristolCouncil https://t.co/GG793SHagt

  2. Given the arguments put forward by @TheyTookCROS, I am now a supporter of the trailing comma in programming, also sentences,

  3. Looks good. The one feature I'd need for production work is the ability to start/stop emitters though! Edit: aaaaaand just realised new Phaser has particle functionality built-in.
  4. https://github.com/englercj/phaser-debug has come in really useful so far in my Phaser project. Big props to the developer! I've recently been trying to modify the source to it so I can see the ".visible" property of objects/groups in the Scene panel. I can't for the life of me see where the Handlebar template values are being set though. Dang. Is something missing from the repository?
  5. Sorry to resurrect an old thread. Using the below, how can I get the name of the animation that finished playing? I have multiple animations on a sprite and only want to do some behaviour with one of those animations and this event triggers for all of them.this.spr.events.onAnimationComplete.add(function() { console.log('animation complete'); if (is_walk_animation) { ... } }, this);Thanks!
  6. setStyle() works. It doesn't seem to be in the docs though! Thanks.
  7. Hi there! I can see all the internal values changing, but the displayed text doesn't change colour. Tried with both Canvas and WebGL renderers.
  8. Seems a bit hacky, but works like a charm! Thanks, Xeke.
  9. Hi all, Is this possible? e.g. // Create textvar t = this.game.add.text(10, 10, "Hello World", { font: "16pt Arial", fill: "#FFFFFF", align: "center" });// Ideally not this because it uses internal values, and actually doesn't update the text displayed. t._style['fill'] = "#FF0000";// Perhaps something like this...!t.updateCSS({ font: "16pt Arial", fill: "#FF0000", align: "center" });Thanks!
  10. Hi all, How can I make keyboard input trigger a button's event AND affect it's visual state, almost like a simulated mouse press? I want to do something like the following: BasicGame.Game = function (game) { this.abutton = null; this.akey = null;}BasicGame.Game.prototype = { preload: function() { this.load.atlas('ui', 'assets/ui.png', 'assets/ui.json'); }, create: function () { this.abutton = this.game.add.button(10, 10, 'ui', this.abuttonEvent, this, 'ui/button_over', 'ui/button_off', 'ui/button_down'); this.akey = this.game.input.keyboard.addKey(Phaser.Keyboard.A); this.akey.onDown.add(this.abuttonEventKey, this); }, abuttonEvent: function() { // do button stuff }, abuttonEventKey: function() { // something here to change the button state/image to down and trigger the event this.abutton.doMousePress(); this.abuttonEventKey(); }}Thanks!
  11. Absolutely brilliant, Rich -- that's exactly what I was looking for! I must have missed the 'key' parameter in the docs somehow.
  12. Hi all, Using Phaser 1.1.3, how can I get an image or "sub sprite" out of an atlas without adding it to the scene? For example, this will get me a button sprite inside the ui texture atlas, but it will add it to the scene too. var ui = this.load.atlas('ui', 'assets/ui.png', 'assets/ui.json'); // preloadvar spr = this.game.add.sprite(50, 50, 'ui', 'button_off');What I want to do is get that sprite without it adding, to use in a button. a la below, or a version of below that uses the standard string/numeric asset references. var overImg = something;var outImg = something;var downImg = something;var btn = this.game.add.button(0, 0, function() {}, this, overImg, outImg, downImg);// orthis.game.set('overImg', 'ui', 'ui/overimg'); // etc.var btn = this.game.add.button(0, 0, function() {}, this, 'overImg', 'outImg', 'downImg'); Thanks!