• Content count

  • Joined

  • Last visited

  1. Convert space to screen coordinates

    For whatever reason, it works now. I can't say why; I changed a couple of things in between and lost track of the things I've altered; been coding for too long non-stop now. I'm accessing the viewport via scene.activeCamera.viewport, which results in screen coordinates between 0 and 1. To get pixel values in order to place my Text2D or Shape2Ds, I do for anyone who's interested.
  2. Hi guys, I'm trying to make 2D-shapes / 2D-sprites in my Canvas2D (ScreenSpaceCanvas) follow some sprites which are placed in my 3d world. For this, I'm using the BABYLON.Vector3.Project function as followed: However, this is the result: I've checked each of the arguments and they all contain valid values at the time of being called. I've also stumbled across this topic, which uses another 4th argument in the call, but I've had no luck trying it with that one either. Any ideas? Thanks in advance!
  3. Update Text2D in Canvas2D

    Hello, thanks for answering, I'll look into babylon gui for now.
  4. Hi guys, I'm creating an UI for my babylon game via the Canvas2D, precisely the ScreenSpaceCanvas2D. Now I want to know if it's possible to update the text dynamically without recreating/overwriting the text2d child every time the score variable (which is used for displaying) is updated. Playground link for simplified case: http://www.babylonjs-playground.com/#2AVSFH#271 Thanks in advance!
  5. Problem with animation action

    Thanks for the fast and productive answer, fixed it right away!
  6. Hi guys, I'm having a hard time figuring out how to move a given object to the destination of a clicked mesh. Playground link (similar recreated scenario): http://www.babylonjs-playground.com/#2CFAMI#13 As you can see, the first two actions (hovering mouse in/out effect) work fine with every tile, but the animating action seems to always extract the position of the last added tile. I'm suspecting it's because I'm overwriting the tile variable (and thus its position values) or something. I also suspect that using instances for the tiles might be a better option, since in the game they also just use 5 different materials that are loaded before-hand...but first things first. Thanks in advance for taking a look!
  7. Hey @Wingnut, thanks for the thorough answer (plus the playground), I really appreciate it! Your solutions make sense; actually, I've already been using the callback-argument to resume the idle sprite animation. Just didn't think about switching a boolean on and off...well, sometimes it's the simple things. Thanks again!
  8. Hi! I'm currently implementing some actions via the ActionManager class in my project. I want to control a sprite with the keypad, and so I'm mixing the actual sprite animation (player.playAnimation) with a position animation where the sprite is moving a certain distance (custom animation with easing via scene.beginAnimation). Problem is, I'd like to have successive inputs blocked until the movement animation has finished so that the functions don't get called again during that time. Is that somehow possible ? Thanks in advance!
  9. Perspective projection in Phaser

    Hi, thanks for answering. The link you provided is interesting, I'll look further into the topic. I have stumbled across both PlayCanvas and GoDot while browsing the forums, maybe I'll try these out. I'm always a bit skeptical when it comes to having to use extra editors though, but maybe I'll be positively surprised. Thanks!
  10. Hello there, the last couple of days I was playing around with Phaser a lot, and I quite like it so far! My current project is supposed to be a kind of side-scrolling Beat'EmUp where the movement and action is turn-based and takes place on a pre-defined grid of rows and columns. Now, the idea was that it has a pseudo-3d look, and thus needs some kind of perspective projection. I've messed around with the Isometric-Plugin for Phaser, but the isometric perspective is not what I'm looking for. The camera would be static (the person is moving from left to right and the tiles on the ground keep scrolling in), so my guess is that it should somehow be possible in Phaser to mimic this effect by matrix manipulation of the coordinates or such. It's been a while I've been doing this, but I'd be willing to look up some maths again for this. I did a Tetris 3D game 2 years ago with Three.js, so I know that this setup is basic in true 3D environments, but for now, I'd like to know if anyone of you guys maybe has experience with things like this in Phaser, because I'd really like to stick with this framework. But if it should be too complicated to implement I'd also maybe have a look at Babylon.js or Three.js once more. As far as I know, those two lack those neat game-mechanics-implementations that Phaser offers...anyway, thanks for reading and taking your time, maybe one of you has an idea!