• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by rich

  1. Change anim of elements group

    Phaser.Actions.Play(group.getChildren(), key)
  2. Crypt Of Nightmares - The Haunted Ruins

    Love the AMOS book on the shelf
  3. Nope, but it would be a simple and small add. Feel free to submit a PR, or just open an issue as a feature request. Some thoughts though: Would it set the property if it didn't exist? If the property did exist, would it replace the current value, or skip it? (non destructive)
  4. How to order 2 functions with the same input

    The order in which handlers are set (for the same event) controls the order in which they are invoked.
  5. My object index is undefined?????

    There's a few ways, but here's one: var partA = levers.create(x, y, key); var partB = levers.create(x, y, key); partA.setData('index', 0); partB.setData('index', 0); function collide (a, b) { if (a.getData('index') === b.getData('index')) { // do stuff } }
  6. My object index is undefined?????

    That's in Phaser 2. In v3 it's (x, y, key, frame, visible)
  7. My object index is undefined?????

    Just curious, but why did you expect index to be defined in the first place? It's not a standard Group property, or a StaticGroup one either. You could add it if you wanted though.
  8. We need to focus on getting Containers finished and in 3.3.0 and then we will be looking at Spine support, so it makes sense to include Creature at the same time. Drop me an email with an outline of what features you would need to support Creature fully (ideally with some sample pseudo code) and we can factor it into our planning in a few weeks time.
  9. Dynamically creating text with physics

    Arcade Physics 2 uses SAT but isn't in v3 yet. We basically ran out of time but will revisit it one day!
  10. Does Phaser 3 need Containers?

    Yeah, we're working on it this week
  11. How to know the current fps in phaser 3?

    Please use the built-in FPS meter in your browser.
  12. The hottest one is coming to town

    None of the Playground examples work for me (lots of WebGL errors in the console), which is a shame as I like the 'json' approach - although to say it eliminates coding is wrong, it just moves the knowledge required to create a scene away from your JavaScript API and moves it instead to knowledge required to learn the data structure of your JSON. The lights demo worked. Very pretty. But at 624 gl ops and 40 draw calls I'd bloody hope so!
  13. Get image from cache

    As has been mentioned, all images are stored in the Texture Manager. You can get the raw image data like this: var tex = this.textures.get('key'); tex.getSourceImage(); You can pass getSourceImage a frame key, should the texture span multiple image files (like in a multi-texture set-up)
  14. There’s no way a background color can crash a mobile. Plenty of things can, but that isn't one of them.
  15. Yeah the oplayer example was for Phaser 3 (because this was posted in that forum I guess). In Phaser 2 you can use a game configuration object and one of the properties it has is backgroundColor: var config = { width: 800, height: 600, renderer: Phaser.AUTO, backgroundColor: '#ff0000', state: { preload: preload, create: create, update: update } } var game = new Phaser.Game(config);
  16. setInteractive() on a whole group

    You could do: this.input.setHitArea(group.getChildren()); To figure out which sprite was clicked there are several ways of doing it. Either the 'gameobjectdown' events, or listen on the sprite itself. There's a tutorial about exactly this here:
  17. You can tell for sure by opening up the dev tools and looking at the console. There it will output the version being used.
  18. There is no Stage in Phaser 3, and the code you posted in your very first post is all Phaser 2 code. So if you're actually using any of the 3.x versions there's no way it would do anything (that you'd expect)
  19. This isn't a Phaser 3 question, so I'll move it to the correct forum. However, the reason game.stage isn't defined even when set the line after game is created, is because the game hasn't booted yet, so the Stage hasn't been made, so you can't set the color on it. It needs to happen either in the game config or the State. The game config shown above is for Phaser 3 though and won't work with Phaser 2.
  20. C# port of Phaser for desktop games

    Node Webkit or Electron will get your game onto Windows, OS X and Linux with minimal effort. Cordova will get it into a native app for iOS / Android. Anything else (i.e. console) would be out of reach anyway, even if it was C#.
  21. Sorry I meant that I create my animations in my Preloader Scene, which is a Scene dedicated entirely to preloading assets and setting up animations at the beginning of the game.Then I move to the next Scene after this (which in my case is a MainMenu, but what it is doesn't matter)
  22. There are a couple options. First, I would create the animations as part of your Preload process. Animations are global, retained between Scenes, and only need making once. So I've been making mine during preload (which I never return to) However, if you need to have the creation code in a Scene you're going back to, then you're on the right track with the code above, but `anims.has()` takes a string-based key, not the Animation itself, as its parameter. Also, it's a method of the 'anims' Map, which means you'd need to do something like 'this.anims.anims.has(string)' - alternatively, it's probably easier to do 'this.anims.get(string)' and if it returns undefined then no animation exists.
  23. renderTexture in phaser3?

    Build from master to get the latest version of it, then have a look in the labs for an example of how to use it as it differs significantly from v2
  24. Does Phaser 3 need Containers?

    That’s exactly what a transform does anyway - checks and updates all properties of all children and iterates them every frame, so that element of it is going to happen regardless of approach, no matter if the Container does it, or you do it manually. Making this about convenience, not performance.