Politybuilder

Members
  • Content Count

    16
  • Joined

  • Last visited

  1. I figured it out. The page that was being loaded was not the page that I thought was being loaded. The page that was being loaded was using Phser version 2.2.2. When I changed it to 2.6.2 everything worked fine. Thanks for your help though!
  2. Aargh! I have just discovered that I am a complete liar and have NOT used sprite.inputEnabled = true at all. However, I tried it and it still doesn't work. Besides, if that was the problem, surely it would be an issue across browsers rather than just with Safari? Anyway, button code looks like this: startButton = game.add.button(300, 300, 'sprites', start, this, 4, 5, 6); startButton.setFrames(4, 5, 6); Where 'sprites' is a spritesheet with all the different button images on it and start is the function to be run. Basically NOTHING is happening when I tap on the button - no image change, no function call - nothing.
  3. Yes. It works with Chrome, but not with Safari. Am going to try on devices other than an iPhone tomorrow, but it looks like it might be Safari.
  4. Using Phaser 2.6.2 with Safari on an iPhone, game loads up fine and seems to be running ok but can't get any response out of the buttons.
  5. In the Phaser documentation for groups it says that you can do the following: group.create(x, y, "spritesheet", index) ...where index is the frame on the spritesheet you want be be included in the group. However, when I use this it just displays the entire spritesheet.
  6. Ah I wondered if that was it. I'm thinking of doing this differently - creating a transparent sprite1 and then changing it to something from a spritesheet when it gets clicked on. This way all the clicking is done on the same sprite.
  7. I've tried both ways an in each case the result is the same as before - leftButton is undefined. I've also tried it with mousepointer and with different buttons - always the same result - not recognising any of the buttons on the pointer.
  8. I tried that but game.input.activePointer.leftButton.isDown is giving me Cannot read property 'isDown' of undefined.
  9. I have a situation where there are two sprites - sprite1 and sprite2. sprite1 is enabled for onInputDown as follows: sprite1.inputEnabled = true; sprite1.events.onInputDown.add(select, this); Then, within the select() function, there is some code to work out which sprite to display, which in this case turns out to be sprite2. Once this is done I enable sprite2 for onInputUp: sprite2 = game.add.image(game.input.mousePointer.x, game.input.mousePointer.y, "sprite2"); sprite2.inputEnabled = true; sprite2.events.onInputUp.add(deselect, this); So here, sprite2 appears under (or actually below and to the right of, but never mind) the mouse pointer while the mouse button is still down. Now, if the user lets the button go up, sprite2 should disappear when running deselect()So, if you click on sprite1 then sprite2 will briefly appear and then disappear. But it you click on sprite1 and keep holding the mouse button down then sprite2 will appear and remain there until you let the mouse button go. function deselect() { sprite2.destroy(); } BUT this is not what happens dammit. sprite2 does NOT disappear when you let the mouse button up, it just stays there. However, after this, if you then click on sprite2 and THEN let the mouse button go, it will disappear. How can I make it so that sprite2 appears when the mouse button is held down but disappears if you let it go from the first time the user triggers onInputDown?
  10. I'm trying to draw a graph incrementally, one line segment every second. I start with this: graphics = game.add.graphics(50, 50); window.graphics = graphics; ...and draw up the graph axes etc - all works fine. Then I set the line style, plot the first data point and then create a series of calls to nextData() - one per second: graphics.lineStyle(5, 0xff0000, 1); graphics.moveTo(xData[0], yData[0]); game.time.events.repeat(1000, 159, nextData, this); The nextData() function takes x and y coordinates from arrays according to a step variable that increments each time the function is called: function nextData() { graphics.lineTo(xData[step], yData[step]); step++; } However, nothing gets drawn. The data is all fine - all the values are correct and the function is called once a second and the step function increments as it should. The only thing I have noticed is that if I put in a REALLY small value for the time interval in game.time.events.repeat like this: game.time.events.repeat(1, 159, nextData, this); e.g. 1 instead of 1000, the first data point is drawn but nothing else - no lines, nothing. I tried this with Javascript setInterval() as well and it didn't work then either so I'm thinking it has something to do with the graphics?
  11. I've just started the first tutorial, following the instructions and am at the bit where you open part1.html. When I do that there is an error in line 17: Phaser is not defined, please fix or add /"global Phaser"/ If I ignore it and carry on with the rest of the tutorial, I get to the bit where you make the star appear in the upper-left-hand corner, but all I get is a little yellow box with "script 0px x 0px" in it, but minimising and maximising the browser makes the star appear instead.
  12. I can't be bothered with it anymore - too many issues. I'm just doing it in Cloud9 instead.
  13. I've restarted many times. It doesn't change anything.
  14. mattstyles: I did a search through the forums on this issue before posting. None that I could find addressed it. FakeWizard: The only executable file vaguely matching that description was "httpd.exe" so I ran "httpd -t" and got: "Syntax OK" There are no previously reported errors. Still getting the same problem with hellophaser