Babsobar

Members
  • Content Count

    55
  • Joined

  • Last visited

About Babsobar

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Babsobar

    Dynamic zoom bounds?

    Figured it out thanks to KingCosmic on the discord For anyone wondering create{ //Create two sprites, one for each diagonal corner var topLeft = this.add.sprite(0,0) var bottomRight this.add.sprite(mapWidth*32,mapHeight*32) //add them both to an array testArray = [] testArray.push(topLeft) testArray.push(bottomRight) } update{ //Test if they are both inside the camera view cullTest = this.camera.main.cull(testArray) if(cullTest.length == 2){ // restrict zoom or something else } } In my case, this didn't work with getting the tiles, so I created two invisible sprites over each corner and test for those.
  2. Babsobar

    static panels on top of rpg/tilemap game

    I had this exact question and I resolved my problem by building a new scene that contained all the UI and launching it from create
  3. Babsobar

    Dynamic zoom bounds?

    This is good because it sets zoom min/max but it doesnt set that according to the maximum amount of map that can be revealed. What I'm looking for is something that sets the zoom's max to the maximum amount of tiles able to be shown so that the outside black of the map is never shown, or as little of it as possible is shown beofre it stop zooming What I thought could be possible would be to create two variables, one containing the top left sprite of the map and the other containing the bottom right sprite and stop zooming if both are within camera bounds That said, I can't find a way to check for wether or not a sprite is within camera bounds, in phaser 2 there was ' sprite.inCamera ' but I can't find it in phaser 3.
  4. Babsobar

    Dynamic zoom bounds?

    Hello everyone, I'm looking to set some zoom bounds to the camera much like camera.setBounds sets bounds to the scrolling behavior of the camera to be when there are no more tiles. I've searched the documentation and examples but there aren't any references to such a method or feature. Thanks for any help
  5. Babsobar

    How to replace arrow keys with wasd movement?

    The problem with something like this is that it's only useful for QWERTY keyboards, so a broader approach, like setting keys for each needed input seems to me like a better solution, even though that's a little more work.
  6. Babsobar

    Children inside container become unresponsive

    Just wanted to update on this in case someone is ever searching for a similar problem. I solved my issue by creating another scene and launching that scene within my editor scene. It's actually much easier, and you retain all the goodness of containers whilst still being able to pass information between those two. So yeah, scenes, scenes all the way.
  7. Hello everyone, I've got a container that has some buttons inside of it, it's a GUI so I have it fixed to the camera with .setScrollFactor(0). My camera can zoom in and out of the tilemap, and when it does, the GUI scales with it, which is the unwanted behavior. I've looked in the documentation and have been trying to find something like .setZoomFactor(0) but unfortunately I could not find anything like it. I then looked inside the examples and in cameras found the ignore container example, which is somewhat similar to what i want. So I created a camera just for displaying the GUI and set its bounds to the editorGUI container all the while ignoring my editorGUI container in my main camera. Now the buttons inside the container aren't scaling when zooming the map, which is the wanted behavior, but they become unresponsive to input. You can find the code on this github concerned files are editor.js and createButtons.js inside /js directory. Any help is greatly appreciated! Thanks, Bab
  8. Babsobar

    How to gets a tile from the Tilemap layer

    What you're looking for is here getTileAtWorldXY
  9. Babsobar

    Zooming out on tilemap layer?

    Just wanted to update that this problem was fixed by a recent update of Phaser.
  10. Babsobar

    Zooming out on tilemap layer?

    I'm still looking for an answer to this problem as well...
  11. Hello rich, Happy that I caught an actual live bug, that would be my first! So how would I go about setting the area visible in the camera? I've been trying to figure how to for days, zooming out using the camera doesnt show more of the dynamicTilemapLayer. Thanks
  12. Hello, I'm trying to use setDisplaySize method on a dynamicTilemap layer but I'm getting a 'this.frame is undefined' when trying to set it. It's supposed to take a width and a height as parameters as shown here. I've tried setting it to a frame but it returns the same error. . I believe this may be linked to the problem I've encoutered and posted about in this thread but I'm not sure. Any help much appreciated
  13. Babsobar

    Zooming out on tilemap layer?

    I've been trying to figure this out for a while now and I feel like there's a problem with tilemap Layers and zooming. Could you try adding zoomIn: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.A), zoomOut: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.E), to your control config and check if that displays culled tiles? I've been pulling my hair out over this. Tilemap layers have a .setDisplayheight and .setDisplayWidth but I get a phaser error telling me no frame is specifed when I try to run them. I feel like I shouldnt have to resize the height and width of the camera every time I zoom because that would seem very clunky... I'm looking for the same behavior as in this example but with dynamic tilemaps, right now I'm always getting the tiles culled by some sort of camera frame. Thanks
  14. Hello, I'm trying to group together UI elements so that I don't have to assign properties like being locked on screen to each and every one of them every time. In phaser 2 this was done by manipulating groups. While looking through phaser 3's doc I noticed that groups don't exist as they used to, and I can't seem to find how to do groups for UI elements now. Is there a particular way of doing UI elements in phaser 3 or has this not been implemented yet? Thanks
  15. Babsobar

    Getting Started with Phaser 3

    For future reference, the docs are located at this address, and this is the git cloning link: https://github.com/photonstorm/phaser3-docs.git