0 votes

I follow a tutorial to generate random dungeon from a tilemap, now after generating, I got the view like this picture.

Game View

Now I want the camera to fit the view so that I can't see anything except all dungeon,
and I have the size of the full rectangle of it.

in Engine by (16 points)

You didn't provide a picture. Also: What exactly is your question here?

I'm guessing he has a randomly sized level, and wants the camera to adjust its positioning and extents to tightly fit the generated level size, so you can see the whole level but minimal extra space.

I think you're going to want to use the tilemap's get_used_rect() and then modify the cameras extents or zoom based on that.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.