• Content Count

  • Joined

  • Last visited

  1. Nevermind, it was customcursor.cameraOffset.x and y.
  2. I have a world larger than the screen and am trying to add a custom cursor. However, the cursor seems to move relative to the world, so I tried using fixedToCamera = true, but then it didn't move at all. Here's the relevant code: // create event customcursor = game.add.sprite(game.input.mousePointer.x, game.input.mousePointer.y, 'cursor'); customcursor.scale.setTo(0.5, 0.5); customcursor.anchor.setTo(0.5, 0.5); customcursor.fixedToCamera = true; // update event customcursor.x = game.input.mousePointer.x; customcursor.y = game.input.mousePointer.y; If anyone knows what's wrong with this, please tell me!
  3. Hmm, thanks for the answers everyone! I'm probably going to use autocull or lifespans.
  4. Oh! That's what I need. But I'll have to test if the performance gains from not rendering the sprites (a bunch of bullets) are greater than the calculation cost the docs warn against.
  5. Figured it out, I guess it does it for me? From the Phaser.Camera docs:
  6. I'm developing a multiplayer game using Phaser, Node.JS, and socket.io. The world is much bigger than the screen. To optimize this, I want to be able to not render sprites that are off-screen. How would I do this? Is there a method that checks if a sprite is on screen at its current x and y coordinates? Or even a way to check if a worldx and worldy position is on-screen?