Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default grid to Debug2D #168

Merged
merged 4 commits into from
Dec 18, 2021
Merged

Add default grid to Debug2D #168

merged 4 commits into from
Dec 18, 2021

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Dec 18, 2021

This adds ability to draw an infinite grid at run-time (while the game is running):

image

This uses GridRect class previously added in #80. The grid drawing is disabled by default, so if you want to use it, you have to go into project settings and enable it manually:

image

The grid settings more or less match GridRect ones. Additionally, you can access the grid via code and be able to customize everything that way:

func _ready():
    var grid: GridRect = Debug2D.get_grid()

If you use Camera2D or change the canvas transform, the grid's position and scale are going to be updated automatically to simulate an infinite grid. The only thing which does not work correctly is when you set Camera2D to rotating. GridRect doesn't currently support rotated grid lines, but hopefully updating origin+scale should be enough for debugging purposes.

@Xrayez Xrayez added enhancement Improvement of existing features feature 💡 New feature proposal component:scene labels Dec 18, 2021
@Xrayez Xrayez added this to the 1.2-gd3 milestone Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:scene enhancement Improvement of existing features feature 💡 New feature proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant