Repository navigation
Conversation
This introduces `LINE_AXIS` constant.
Also added `origin_axes_line_width`.
Previously it was just `offset` property which acted like a "view" offset. Now, it's named as `origin_offset`, and shifting the origin has an effect of scrolling in terms of view.
Cell size is not determined from number of subdivisions here.
Users are free to interpret cell drawing as "minor" if they use divisions, but when there are no divisions, cells could be treated as "major" in the same manner, so just get rid of "minor/major" terms, because they can be ambiguous (the same applies to "primary/secondary" lines). This change makes existing terminology of "cells/divisions" consistent throughout class.
This is not the "proper" way to test this, but scene-based approach is easier to maintain and update when needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves godotengine/godot-proposals#2662.
Features:
_draw_line()virtual method (skipping every n-th line, different colors) (thanks to @LikeLakers2 for the idea presented in AddGridRectnode for displaying a two-dimensional grid (for editors/charts) godotengine/godot-proposals#2662 (comment));TileMap).GridRectnodes on top of each other).Note that this only provides essential features needed to draw grids. Things like scroll, drag, zoom are possible to implement via script as of now. Depending on whether I'll need those features myself, it may be reasonable to add
GridEditnode which can inherit this class.Example project
grid.zip
Editor builds of this PR (have to be logged in GitHub):