Topic was automatically imported from the old Question2Answer platform.
Asked By
rogeriodec
Since I’m creating multiple children via code, I can only evaluate the result on the final rendered screen.
I wonder, is there any way to create a grid or other controls to evaluate, for example, if the placement of a child created in the code is correct in the final rendered output?
tool
extends Control
export var bg = Color(1,1,1)
export var fg = Color(0.6,0.5,0.5)
export var rows = 3
export var columns = 3
func _draw():
var w = rect_size.x
var h = rect_size.y
var cw = w/columns #cell width
var ch = h/rows #cell height
draw_rect( Rect2(Vector2.ZERO,rect_size), bg)
for row in range(1,rows, 2):
var y = ch*row+(ch*0.5)
draw_line( Vector2(0,y), Vector2(w,y), fg, ch )
for column in range(1,columns, 2):
var x = cw*column+(cw*0.5)
draw_line( Vector2(x,0), Vector2(x,h), fg, cw )