Jump to content

markp

Members
  • Content Count

    9
  • Joined

  • Last visited

About markp

  • Rank
    Newbie

Contact Methods

  • Twitter
    markphillips100
  1. Ref v2.0.1. I'm creating an atlas from a bitmap canvas that is drawn to within the preload event of my stage. The image data is dynamic in nature so cannot be a static image asset. var bmd = this.game.add.bitmapData(x,y);// draw on bmd.ctx;// build atlasData structure to define frames of sprite data drawn to bmd.ctxthis.game.load.atlas('mykey', bmd.canvas.toDataURL(), null, atlasData);The issue I have is that the drawing process I have available to me can only inform me of its completion by way of a completion event on the dom. As I can only call the bmd.canvas.toDataURL() method when drawin
  2. I solved my issue by just using a bitmapData which exposes its own underlying canvas. I can do whatever graphics and text I want on this canvas. Loading the image drawn on the canvas is simply a case of calling the canvase method toDataUrl() and passing the return value to the second parameter of game.load.image.
  3. I have a graphics object that I use to draw a filled square with a thick border. I can create a texture using this graphics object and generateTexture() method so that I can create square sprites. I needed to add some dynamic text layered onto the sprite so I just started with a group, added the sprite for the square and then added text. The result is text on top of the square. If I create say 100 of these groups my FPS on my test Nexus 7 is down at about 5fps. Pretty low so I thought I'd just see the effect of replacing the contents of the group with a single sprite created from a singl
  4. Thanks for taking a look. Think I'll use moment.js from now on.
  5. I've been having a problem with timer events and tweens not working at all and it would appear that just by having a script src to date.js included it causes the issue but I have no idea why. The data.js can be downloaded from this site https://github.com/datejs/Datejs. I'm using Phaser v2.0.1 and the latest datejs. I can reproduce the issue just by adding the following line to view_full.html in the examples and then trying one of the time based examples or one with animation. None of the animations or tweening will work. <script src="_site/js/date.js" type="text/javascript"></
  6. I have 2 similar sprites that can be moved by a mouse or tween independent of one another. I want to draw a line between the centres of each of the two sprites. When the sprites are moved I want the line to always remain drawn from one sprite's centre to the other sprite's centre. I'm using v2.0 and typescript so I think in terms of classes. I'm thinking Phaser.Line and its fromSprite method but I'm having trouble with this method accessing 'center' properties on the sprites but those properties don't appear to exist, and if I don't use centering the x and y on the sprite is used which ar
  7. I'm pretty new to Phaser. Started on 1.6 and just moved to 2.0 and think it is a great framework. I used CAAT animation toolkit in the past and liked the ability to set paths for sprites to follow. The feature allowed me to setup a bezier curve with specific parameters so that by changing the parameters I could get a sprite to follow a different curve. Using Phaser v2.0 I thought I might be able to do the same using: tween.to(pos, 5000, Phaser.Easing.Exponential.InOut, false).interpolation(Phaser.Math.bezierInterpolation).start()The movement from the code above looks linear rather than
  8. I can confirm the same effect was happening when trying to stop a loop tween. I was creating an auto-starting loop tween on a sprite's onInputDown and stopping it in it's onInputUp. The tween just scaled the sprite smaller then back to normal and so on. If the onInputUp fired whilst the second tween was in operation the sprite would continue looping forever. If I clicked again I'd get multiple loop tweens applied with jittery effects when one battled with another to change the scale. Tried the change and all appears to be good to me.
  9. Just upgraded from 1.6 to 2.0 and had similar issues with VS2013 typescript plugin not understanding the new phaser.d.ts file. I managed to get the unknown type build errors to dissappear by editing the phaser.d.ts file: Move the "declare class Phaser {..." declaration to after the "declare module Phaser {..." declaration.
×
×
  • Create New...