0 votes

The problem

Hey everyone, I posted a similar question, but I wasn't specific about the kind of TileMap I was using. Basically I want to transform the result of get_used_rect() into a result I can use to stretch a TextureRect over the entirety of my TileMap.

I've been learning about matrix transformations in order to solve this problem, but It'd be nice if anyone can give a solution.

Context

I'm trying to create a fog of war shader. I have almost everything figured out, but I can't get the TextureRect (which is rendering the shader) to stretch accross my isometric TileMap. Does this sound like the right approach? I'll post a repo of the project soon.

Edit: link to the repo

Edit 2: figured out how to the get the correct size. I erroneously thought that the size of the TextureRect should be multiplied by the cell_size, not the case. The actual number to multiply the TextureRect before the transform is made is by what the tile size side would be if you made the inverse transform on it (basically flattening it). In the demo that number is something like Vector2(90, 90).

in Engine by (173 points)
edited by

I think got the hang of Transform2D, now I just need to get the TextureRect in the right position..

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.