Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by danksch

  1. 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


    mytext2D.x = canvas2D.width * projectVec.x; 

    mytext2D.y = canvas2D.height - canvas2D.height * projectVec.y;   

    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: 


    BABYLON.Vector3.Project(space.position, BABYLON.Matrix.Identity(), scene.getTransformMatrix(), scene.activeCamera.viewport)

    However, this is the result: 


    Vector3 {x: NaN, y: NaN, z: NaN}

    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. 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!

  4. 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!

  5. 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. 




  6. 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. :P 

    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!  

  • Create New...