Position and Input issues with maps imported from Tiled

KieranJWKieranJW Posts: 3Member

I'm using the Tiled Map Importer plugin to create levels and I'm experiencing two issues - the first is that the first row of tiles (starting at 0, 0) is being imported off the top of the screen, with coordinates starting at -32:

This isn't a big problem because I can just reposition them all in the editor (or start editing the map in Tiled at row 1) but I'm just curious if there's anything I'm doing wrong importing the file?

Secondly and much worse I can't seem to get mouse clicks to work on Sprites added to one of these maps. I've added a button (which definitely works when tested as a separate scene) but when added to the imported scene the _input_event doesn't seem to fire.

I'm new to Godot so I might be doing something wrong, I don't know! I've recreated it as a simple example here, any help you can give me would be greatly appreciated!


Tags :

Best Answer

  • ZeltaZelta Posts: 83
    edited January 25 Accepted Answer

    I'm using the Tiled Map Importer plugin to create levels and I'm experiencing two issues - the first is that the first row of tiles (starting at 0, 0) is being imported off the top of the screen, with coordinates starting at -32:

    i dont know the reason of this, but the tex offset is at -32, u have to change to 0 in every tile and works

Answers

  • ZeltaZelta Posts: 83Member

    @KieranJW said:
    I'm using the Tiled Map Importer plugin to create levels and I'm experiencing two issues - the first is that the first row of tiles (starting at 0, 0) is being imported off the top of the screen, with coordinates starting at -32:

    looks like a offset problem, do u checked the 'centered' option?

    Secondly and much worse I can't seem to get mouse clicks to work on Sprites added to one of these maps. I've added a button (which definitely works when tested as a separate scene) but when added to the imported scene the _input_event doesn't seem to fire.

    could u paste the code or some pic? probably the method is not well connected or perhaps there is something blocvking the button

  • KieranJWKieranJW Posts: 3Member

    I'm not sure what centered option you mean?

    Also here's the code: https://www.dropbox.com/s/gfilnbxnmiag4h7/Click Issue.zip?dl=0

  • ZeltaZelta Posts: 83Member

    the color rect is blocking the mouse, if you 'ignore' it just works.

  • ZeltaZelta Posts: 83Member
    edited January 25 Accepted Answer

    I'm using the Tiled Map Importer plugin to create levels and I'm experiencing two issues - the first is that the first row of tiles (starting at 0, 0) is being imported off the top of the screen, with coordinates starting at -32:

    i dont know the reason of this, but the tex offset is at -32, u have to change to 0 in every tile and works

  • KieranJWKieranJW Posts: 3Member

    That's great! Thank you for the help! :D

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file