mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:34:43 -04:00
One shared offset for rectangular and isometric grids, added "Draw Grid over Tile Mode" toggle (#434)
* One shared offset for rectangular and isometric grids * One draw call per grid * Added "Draw Grid over Tile Mode" toggle
This commit is contained in:
parent
c60fb0632e
commit
eeb97f71e4
6 changed files with 110 additions and 51 deletions
|
@ -22,8 +22,9 @@ var preferences = [
|
|||
["grid_height", "Canvas/GridOptions/GridHeightValue", "value", Global.grid_height],
|
||||
["grid_isometric_cell_bounds_width", "Canvas/GridOptions/IsometricCellBoundsWidthValue", "value", Global.grid_isometric_cell_bounds_width],
|
||||
["grid_isometric_cell_bounds_height", "Canvas/GridOptions/IsometricCellBoundsHeightValue", "value", Global.grid_isometric_cell_bounds_height],
|
||||
["grid_isometric_offset_x", "Canvas/GridOptions/IsometricGridOffsetXValue", "value", Global.grid_isometric_offset_x],
|
||||
["grid_isometric_offset_y", "Canvas/GridOptions/IsometricGridOffsetYValue", "value", Global.grid_isometric_offset_y],
|
||||
["grid_offset_x", "Canvas/GridOptions/GridOffsetXValue", "value", Global.grid_offset_x],
|
||||
["grid_offset_y", "Canvas/GridOptions/GridOffsetYValue", "value", Global.grid_offset_y],
|
||||
["grid_draw_over_tile_mode", "Canvas/GridOptions/GridDrawOverTileMode", "pressed", Global.grid_draw_over_tile_mode],
|
||||
["grid_color", "Canvas/GridOptions/GridColor", "color", Global.grid_color],
|
||||
["pixel_grid_show_at_zoom", "Canvas/PixelGridOptions/ShowAtZoom", "value", Global.pixel_grid_show_at_zoom],
|
||||
["pixel_grid_color", "Canvas/PixelGridOptions/GridColor", "color", Global.pixel_grid_color],
|
||||
|
@ -131,7 +132,7 @@ func preference_update(prop : String) -> void:
|
|||
else:
|
||||
autosave_interval.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
|
||||
|
||||
if prop in ["grid_type", "grid_width", "grid_height", "grid_isometric_cell_bounds_width", "grid_isometric_cell_bounds_height", "grid_isometric_offset_x", "grid_isometric_offset_y", "grid_color"]:
|
||||
if prop in ["grid_type", "grid_width", "grid_height", "grid_isometric_cell_bounds_width", "grid_isometric_cell_bounds_height", "grid_offset_x", "grid_offset_y", "grid_draw_over_tile_mode", "grid_color"]:
|
||||
Global.canvas.grid.update()
|
||||
|
||||
if prop in ["pixel_grid_show_at_zoom", "pixel_grid_color"]:
|
||||
|
|
|
@ -275,7 +275,7 @@ custom_constants/vseparation = 4
|
|||
custom_constants/hseparation = 4
|
||||
columns = 3
|
||||
|
||||
[node name="TypeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridTypeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = 3.0
|
||||
margin_right = 123.0
|
||||
margin_bottom = 17.0
|
||||
|
@ -296,48 +296,48 @@ text = "Rectangular"
|
|||
items = [ "Rectangular", null, false, 0, null, "Isometric", null, false, 1, null, "All", null, false, 2, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="WidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridWidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 234.0
|
||||
margin_top = 3.0
|
||||
margin_right = 344.0
|
||||
margin_bottom = 17.0
|
||||
rect_min_size = Vector2( 110, 0 )
|
||||
hint_tooltip = "Sets how far apart are vertical lines of the grid"
|
||||
hint_tooltip = "Sets how far apart are vertical lines of the rectangular grid"
|
||||
mouse_filter = 0
|
||||
text = "Grid width:"
|
||||
text = "Rectangular grid width:"
|
||||
|
||||
[node name="GridWidthValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = 24.0
|
||||
margin_right = 123.0
|
||||
margin_bottom = 48.0
|
||||
hint_tooltip = "Sets how far apart are vertical lines of the grid"
|
||||
hint_tooltip = "Sets how far apart are vertical lines of the rectangular grid"
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 1.0
|
||||
value = 2.0
|
||||
rounded = true
|
||||
align = 2
|
||||
suffix = "px"
|
||||
|
||||
[node name="Height" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridHeightLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 127.0
|
||||
margin_top = 29.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 43.0
|
||||
hint_tooltip = "Sets how far apart are horizontal lines of the grid"
|
||||
hint_tooltip = "Sets how far apart are horizontal lines of the rectangular grid"
|
||||
mouse_filter = 0
|
||||
text = "Grid height:"
|
||||
text = "Rectangular grid height:"
|
||||
|
||||
[node name="GridHeightValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 234.0
|
||||
margin_top = 24.0
|
||||
margin_right = 344.0
|
||||
margin_bottom = 48.0
|
||||
hint_tooltip = "Sets how far apart are horizontal lines of the grid"
|
||||
hint_tooltip = "Sets how far apart are horizontal lines of the rectangular grid"
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 1.0
|
||||
value = 2.0
|
||||
rounded = true
|
||||
align = 2
|
||||
suffix = "px"
|
||||
|
@ -386,20 +386,20 @@ rounded = true
|
|||
align = 2
|
||||
suffix = "px"
|
||||
|
||||
[node name="IsometricGridOffsetXLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridOffsetXLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = 57.0
|
||||
margin_right = 123.0
|
||||
margin_bottom = 71.0
|
||||
hint_tooltip = "Sets isometric grid's x offset from the canvas origin (top left corner of the image)"
|
||||
hint_tooltip = "Sets grid's x offset from the canvas origin (top left corner of the image)"
|
||||
mouse_filter = 0
|
||||
text = "Isometric grid offset x:"
|
||||
text = "Grid offset x:"
|
||||
|
||||
[node name="IsometricGridOffsetXValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridOffsetXValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 127.0
|
||||
margin_top = 52.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 76.0
|
||||
hint_tooltip = "Sets isometric grid's x offset from the canvas origin (top left corner of the image)"
|
||||
hint_tooltip = "Sets grid's x offset from the canvas origin (top left corner of the image)"
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = -16384.0
|
||||
max_value = 16384.0
|
||||
|
@ -407,20 +407,20 @@ rounded = true
|
|||
align = 2
|
||||
suffix = "px"
|
||||
|
||||
[node name="IsometricGridOffsetYLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridOffsetYLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = 57.0
|
||||
margin_right = 123.0
|
||||
margin_bottom = 71.0
|
||||
hint_tooltip = "Sets isometric grid's y offset from the canvas origin (top left corner of the image)"
|
||||
hint_tooltip = "Sets grid's y offset from the canvas origin (top left corner of the image)"
|
||||
mouse_filter = 0
|
||||
text = "Isometric grid offset y:"
|
||||
text = "Grid offset y:"
|
||||
|
||||
[node name="IsometricGridOffsetYValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
[node name="GridOffsetYValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 127.0
|
||||
margin_top = 52.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 76.0
|
||||
hint_tooltip = "Sets isometric grid's y offset from the canvas origin (top left corner of the image)"
|
||||
hint_tooltip = "Sets grid's y offset from the canvas origin (top left corner of the image)"
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = -16384.0
|
||||
max_value = 16384.0
|
||||
|
@ -428,6 +428,24 @@ rounded = true
|
|||
align = 2
|
||||
suffix = "px"
|
||||
|
||||
[node name="GridDrawOverTileModeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = -99.0
|
||||
margin_right = 131.0
|
||||
margin_bottom = -85.0
|
||||
rect_min_size = Vector2( 110, 0 )
|
||||
hint_tooltip = "If disabled grid will be drawn only over the original image"
|
||||
mouse_filter = 0
|
||||
text = "Draw over Tile Mode:"
|
||||
|
||||
[node name="GridDrawOverTileMode" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 114.0
|
||||
margin_top = -104.0
|
||||
margin_right = 161.0
|
||||
margin_bottom = -80.0
|
||||
hint_tooltip = "If disabled grid will be drawn only over the original image"
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "On"
|
||||
|
||||
[node name="GridColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 234.0
|
||||
margin_top = 57.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue