mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-20 21:07:17 +01:00
Added size indicators to the world generator addon's rect editors to show how big a chunk is at the current zoom level.
This commit is contained in:
parent
d53a157657
commit
6cf52d15a5
@ -59,6 +59,27 @@ func on_zoom_changed(zoom : float) -> void:
|
||||
func _draw():
|
||||
draw_rect(Rect2(Vector2(), get_size()), Color(0.2, 0.2, 0.2, 1))
|
||||
|
||||
var rsh : float = clamp(_rect_scale / 2.0, 1, 5)
|
||||
var c : Color = Color(0.4, 0.4, 0.4, 1)
|
||||
|
||||
# Indicators that show the size of a unit (1 chunk)
|
||||
|
||||
# Top left
|
||||
draw_line(Vector2(_rect_scale, 0), Vector2(_rect_scale, rsh), c)
|
||||
draw_line(Vector2(0, _rect_scale), Vector2(rsh, _rect_scale), c)
|
||||
|
||||
# Top right
|
||||
draw_line(Vector2(get_size().x - _rect_scale, 0), Vector2(get_size().x - _rect_scale, rsh), c)
|
||||
draw_line(Vector2(get_size().x - rsh, _rect_scale), Vector2(get_size().x, _rect_scale), c)
|
||||
|
||||
# Bottom left
|
||||
draw_line(Vector2(_rect_scale, get_size().y - rsh), Vector2(_rect_scale, get_size().y), c)
|
||||
draw_line(Vector2(0, get_size().y - _rect_scale), Vector2(rsh, get_size().y - _rect_scale), c)
|
||||
|
||||
# Bottom right
|
||||
draw_line(Vector2(get_size().x - _rect_scale, get_size().y - rsh), Vector2(get_size().x - _rect_scale, get_size().y), c)
|
||||
draw_line(Vector2(get_size().x - rsh, get_size().y - _rect_scale), Vector2(get_size().x, get_size().y - _rect_scale), c)
|
||||
|
||||
func refresh() -> void:
|
||||
clear()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user