mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Grid size and color in preferences, update_texture optimization
- Added grid size and color in preferences - Canvas' update_texture() updates the frame button's texture only when the user releases a mouse button. This should optimize drawing in large images. - Cursor is no longer invisible inside the canvas - Minor UI changes - Added some more translations. This is going to be a common thing in commits from now on.
This commit is contained in:
parent
ade2d05a1b
commit
d81d7ee5ef
268
Main.tscn
268
Main.tscn
|
@ -163,14 +163,12 @@ size_flags_vertical = 3
|
|||
custom_constants/separation = 0
|
||||
|
||||
[node name="ToolPanel" type="Panel" parent="MenuAndUI/UI"]
|
||||
editor/display_folded = true
|
||||
margin_right = 224.0
|
||||
margin_bottom = 620.0
|
||||
rect_min_size = Vector2( 224, 0 )
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Tools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel"]
|
||||
editor/display_folded = true
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
|
@ -404,10 +402,10 @@ align = 1
|
|||
margin_top = 19.0
|
||||
margin_right = 208.0
|
||||
margin_bottom = 43.0
|
||||
hint_tooltip = "Show left mouse indicator when drawing"
|
||||
hint_tooltip = "Show left mouse pixel indicator or brush on the canvas when drawing"
|
||||
mouse_default_cursor_shape = 2
|
||||
pressed = true
|
||||
text = "Left cursor"
|
||||
text = "Left pixel indicator"
|
||||
|
||||
[node name="LeftBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
editor/display_folded = true
|
||||
|
@ -598,9 +596,9 @@ align = 1
|
|||
margin_top = 19.0
|
||||
margin_right = 208.0
|
||||
margin_bottom = 43.0
|
||||
hint_tooltip = "Show right mouse indicator when drawing"
|
||||
hint_tooltip = "Show right mouse pixel indicator or brush on the canvas when drawing"
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Right cursor"
|
||||
text = "Right pixel indicator"
|
||||
|
||||
[node name="RightBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
editor/display_folded = true
|
||||
|
@ -1273,7 +1271,6 @@ margin_right = 200.0
|
|||
margin_bottom = 70.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CreateNewImage"]
|
||||
editor/display_folded = true
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 192.0
|
||||
|
@ -1281,65 +1278,57 @@ margin_bottom = 106.0
|
|||
|
||||
[node name="ImageSize" type="Label" parent="CreateNewImage/VBoxContainer"]
|
||||
margin_right = 184.0
|
||||
margin_bottom = 14.0
|
||||
margin_bottom = 15.0
|
||||
text = "Image Size"
|
||||
|
||||
[node name="WidthCont" type="HBoxContainer" parent="CreateNewImage/VBoxContainer"]
|
||||
editor/display_folded = true
|
||||
margin_top = 18.0
|
||||
[node name="OptionsContainer" type="GridContainer" parent="CreateNewImage/VBoxContainer"]
|
||||
margin_top = 19.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 42.0
|
||||
margin_bottom = 98.0
|
||||
columns = 2
|
||||
|
||||
[node name="WidthLabel" type="Label" parent="CreateNewImage/VBoxContainer/WidthCont"]
|
||||
[node name="WidthLabel" type="Label" parent="CreateNewImage/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 5.0
|
||||
margin_right = 46.0
|
||||
margin_bottom = 19.0
|
||||
margin_right = 75.0
|
||||
margin_bottom = 20.0
|
||||
text = "Width:"
|
||||
|
||||
[node name="WidthValue" type="SpinBox" parent="CreateNewImage/VBoxContainer/WidthCont"]
|
||||
margin_left = 50.0
|
||||
margin_right = 124.0
|
||||
margin_bottom = 24.0
|
||||
[node name="WidthValue" type="SpinBox" parent="CreateNewImage/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 79.0
|
||||
margin_right = 143.0
|
||||
margin_bottom = 25.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 64.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="HeightCont" type="HBoxContainer" parent="CreateNewImage/VBoxContainer"]
|
||||
margin_top = 46.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 70.0
|
||||
|
||||
[node name="Height" type="Label" parent="CreateNewImage/VBoxContainer/HeightCont"]
|
||||
margin_top = 5.0
|
||||
margin_right = 46.0
|
||||
margin_bottom = 19.0
|
||||
[node name="Height" type="Label" parent="CreateNewImage/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 34.0
|
||||
margin_right = 75.0
|
||||
margin_bottom = 49.0
|
||||
text = "Height:"
|
||||
|
||||
[node name="HeightValue" type="SpinBox" parent="CreateNewImage/VBoxContainer/HeightCont"]
|
||||
margin_left = 50.0
|
||||
margin_right = 124.0
|
||||
margin_bottom = 24.0
|
||||
[node name="HeightValue" type="SpinBox" parent="CreateNewImage/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 79.0
|
||||
margin_top = 29.0
|
||||
margin_right = 143.0
|
||||
margin_bottom = 54.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 64.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="FillColor" type="HBoxContainer" parent="CreateNewImage/VBoxContainer"]
|
||||
margin_top = 74.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 94.0
|
||||
[node name="FillColorLabel" type="Label" parent="CreateNewImage/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 61.0
|
||||
margin_right = 75.0
|
||||
margin_bottom = 76.0
|
||||
text = "Fill with color:"
|
||||
|
||||
[node name="FillColorLabel" type="Label" parent="CreateNewImage/VBoxContainer/FillColor"]
|
||||
margin_top = 3.0
|
||||
margin_right = 94.0
|
||||
margin_bottom = 17.0
|
||||
text = "Fill with color: "
|
||||
|
||||
[node name="FillColor" type="ColorPickerButton" parent="CreateNewImage/VBoxContainer/FillColor"]
|
||||
margin_left = 98.0
|
||||
margin_right = 162.0
|
||||
margin_bottom = 20.0
|
||||
[node name="FillColor" type="ColorPickerButton" parent="CreateNewImage/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 79.0
|
||||
margin_top = 58.0
|
||||
margin_right = 143.0
|
||||
margin_bottom = 79.0
|
||||
rect_min_size = Vector2( 64, 20 )
|
||||
color = Color( 0, 0, 0, 0 )
|
||||
|
||||
|
@ -1409,65 +1398,58 @@ margin_bottom = 106.0
|
|||
|
||||
[node name="ImageSize" type="Label" parent="ScaleImage/VBoxContainer"]
|
||||
margin_right = 184.0
|
||||
margin_bottom = 14.0
|
||||
margin_bottom = 15.0
|
||||
text = "Image Size"
|
||||
|
||||
[node name="WidthCont" type="HBoxContainer" parent="ScaleImage/VBoxContainer"]
|
||||
margin_top = 18.0
|
||||
[node name="OptionsContainer" type="GridContainer" parent="ScaleImage/VBoxContainer"]
|
||||
editor/display_folded = true
|
||||
margin_top = 19.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 42.0
|
||||
margin_bottom = 98.0
|
||||
columns = 2
|
||||
|
||||
[node name="WidthLabel" type="Label" parent="ScaleImage/VBoxContainer/WidthCont"]
|
||||
[node name="WidthLabel" type="Label" parent="ScaleImage/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 5.0
|
||||
margin_right = 46.0
|
||||
margin_bottom = 19.0
|
||||
margin_right = 72.0
|
||||
margin_bottom = 20.0
|
||||
text = "Width:"
|
||||
|
||||
[node name="WidthValue" type="SpinBox" parent="ScaleImage/VBoxContainer/WidthCont"]
|
||||
margin_left = 50.0
|
||||
margin_right = 124.0
|
||||
margin_bottom = 24.0
|
||||
[node name="WidthValue" type="SpinBox" parent="ScaleImage/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 76.0
|
||||
margin_right = 159.0
|
||||
margin_bottom = 25.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 64.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="HeightCont" type="HBoxContainer" parent="ScaleImage/VBoxContainer"]
|
||||
editor/display_folded = true
|
||||
margin_top = 46.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 70.0
|
||||
|
||||
[node name="Height" type="Label" parent="ScaleImage/VBoxContainer/HeightCont"]
|
||||
margin_top = 5.0
|
||||
margin_right = 46.0
|
||||
margin_bottom = 19.0
|
||||
[node name="Height" type="Label" parent="ScaleImage/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 34.0
|
||||
margin_right = 72.0
|
||||
margin_bottom = 49.0
|
||||
text = "Height:"
|
||||
|
||||
[node name="HeightValue" type="SpinBox" parent="ScaleImage/VBoxContainer/HeightCont"]
|
||||
margin_left = 50.0
|
||||
margin_right = 124.0
|
||||
margin_bottom = 24.0
|
||||
[node name="HeightValue" type="SpinBox" parent="ScaleImage/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 76.0
|
||||
margin_top = 29.0
|
||||
margin_right = 159.0
|
||||
margin_bottom = 54.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 64.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="InterpolationContainer" type="HBoxContainer" parent="ScaleImage/VBoxContainer"]
|
||||
margin_top = 74.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 94.0
|
||||
|
||||
[node name="InterpolationLabel" type="Label" parent="ScaleImage/VBoxContainer/InterpolationContainer"]
|
||||
margin_top = 3.0
|
||||
margin_right = 87.0
|
||||
margin_bottom = 17.0
|
||||
[node name="InterpolationLabel" type="Label" parent="ScaleImage/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 61.0
|
||||
margin_right = 72.0
|
||||
margin_bottom = 76.0
|
||||
text = "Interpolation:"
|
||||
|
||||
[node name="InterpolationType" type="OptionButton" parent="ScaleImage/VBoxContainer/InterpolationContainer"]
|
||||
margin_left = 91.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 20.0
|
||||
[node name="InterpolationType" type="OptionButton" parent="ScaleImage/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 76.0
|
||||
margin_top = 58.0
|
||||
margin_right = 159.0
|
||||
margin_bottom = 79.0
|
||||
text = "Nearest"
|
||||
items = [ "Nearest", null, false, 0, null, "Bilinear", null, false, 1, null, "Cubic", null, false, 2, null, "Trilinear", null, false, 3, null, "Lanczos", null, true, 4, null ]
|
||||
selected = 0
|
||||
|
@ -1478,24 +1460,89 @@ margin_right = 200.0
|
|||
margin_bottom = 70.0
|
||||
window_title = "Preferences"
|
||||
|
||||
[node name="LanguageContainer" type="HBoxContainer" parent="PreferencesDialog"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PreferencesDialog"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -92.0
|
||||
margin_top = 8.0
|
||||
margin_right = 92.0
|
||||
margin_bottom = 131.0
|
||||
|
||||
[node name="LanguageLabel" type="Label" parent="PreferencesDialog/LanguageContainer"]
|
||||
margin_top = 12.0
|
||||
[node name="OptionsContainer" type="GridContainer" parent="PreferencesDialog/VBoxContainer"]
|
||||
margin_right = 184.0
|
||||
margin_bottom = 21.0
|
||||
columns = 2
|
||||
|
||||
[node name="LanguageLabel" type="Label" parent="PreferencesDialog/VBoxContainer/OptionsContainer"]
|
||||
margin_top = 3.0
|
||||
margin_right = 57.0
|
||||
margin_bottom = 27.0
|
||||
margin_bottom = 18.0
|
||||
text = "Language:"
|
||||
|
||||
[node name="LanguageOption" type="OptionButton" parent="PreferencesDialog/LanguageContainer"]
|
||||
[node name="LanguageOption" type="OptionButton" parent="PreferencesDialog/VBoxContainer/OptionsContainer"]
|
||||
margin_left = 61.0
|
||||
margin_right = 142.0
|
||||
margin_bottom = 40.0
|
||||
margin_bottom = 21.0
|
||||
text = "English"
|
||||
items = [ "System Language", null, false, 0, null, "Greek", null, false, 1, null, "English", null, false, 2, null ]
|
||||
items = [ "System Language", null, false, 0, null, "Greek [el]", null, false, 1, null, "English [en]", null, false, 2, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="GridOptionsLabel" type="Label" parent="PreferencesDialog/VBoxContainer"]
|
||||
margin_top = 25.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 40.0
|
||||
text = "Grid options"
|
||||
|
||||
[node name="GridOptions" type="GridContainer" parent="PreferencesDialog/VBoxContainer"]
|
||||
margin_top = 44.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 123.0
|
||||
columns = 2
|
||||
|
||||
[node name="WidthLabel" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"]
|
||||
margin_top = 5.0
|
||||
margin_right = 39.0
|
||||
margin_bottom = 20.0
|
||||
text = "Width:"
|
||||
|
||||
[node name="GridWidthValue" type="SpinBox" parent="PreferencesDialog/VBoxContainer/GridOptions"]
|
||||
margin_left = 43.0
|
||||
margin_right = 107.0
|
||||
margin_bottom = 25.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 1.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="Height" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"]
|
||||
margin_top = 34.0
|
||||
margin_right = 39.0
|
||||
margin_bottom = 49.0
|
||||
text = "Height:"
|
||||
|
||||
[node name="GridHeightValue" type="SpinBox" parent="PreferencesDialog/VBoxContainer/GridOptions"]
|
||||
margin_left = 43.0
|
||||
margin_top = 29.0
|
||||
margin_right = 107.0
|
||||
margin_bottom = 54.0
|
||||
min_value = 1.0
|
||||
max_value = 16384.0
|
||||
value = 1.0
|
||||
suffix = "px"
|
||||
|
||||
[node name="GridColorLabel" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"]
|
||||
margin_top = 61.0
|
||||
margin_right = 39.0
|
||||
margin_bottom = 76.0
|
||||
text = "Color:"
|
||||
|
||||
[node name="GridColor" type="ColorPickerButton" parent="PreferencesDialog/VBoxContainer/GridOptions"]
|
||||
margin_left = 43.0
|
||||
margin_top = 58.0
|
||||
margin_right = 107.0
|
||||
margin_bottom = 79.0
|
||||
rect_min_size = Vector2( 64, 20 )
|
||||
|
||||
[node name="AboutDialog" type="AcceptDialog" parent="."]
|
||||
editor/display_folded = true
|
||||
margin_right = 284.0
|
||||
|
@ -1511,15 +1558,15 @@ margin_bottom = 158.0
|
|||
|
||||
[node name="Pixelorama" type="Label" parent="AboutDialog/AboutUI"]
|
||||
margin_right = 268.0
|
||||
margin_bottom = 31.0
|
||||
margin_bottom = 33.0
|
||||
text = "Pixelorama v0.3
|
||||
"
|
||||
align = 1
|
||||
|
||||
[node name="MadeBy" type="Label" parent="AboutDialog/AboutUI"]
|
||||
margin_top = 35.0
|
||||
margin_top = 37.0
|
||||
margin_right = 268.0
|
||||
margin_bottom = 83.0
|
||||
margin_bottom = 88.0
|
||||
text = "Your Free and Open Source Sprite Editor
|
||||
Developed by Orama Interactive
|
||||
"
|
||||
|
@ -1527,9 +1574,9 @@ align = 1
|
|||
|
||||
[node name="Links" type="CenterContainer" parent="AboutDialog/AboutUI"]
|
||||
editor/display_folded = true
|
||||
margin_top = 87.0
|
||||
margin_top = 92.0
|
||||
margin_right = 268.0
|
||||
margin_bottom = 107.0
|
||||
margin_bottom = 113.0
|
||||
|
||||
[node name="LinkButtons" type="HBoxContainer" parent="AboutDialog/AboutUI/Links"]
|
||||
editor/display_folded = true
|
||||
|
@ -1538,26 +1585,26 @@ margin_right = 231.0
|
|||
margin_bottom = 21.0
|
||||
|
||||
[node name="Website" type="Button" parent="AboutDialog/AboutUI/Links/LinkButtons"]
|
||||
margin_right = 65.0
|
||||
margin_bottom = 20.0
|
||||
margin_right = 55.0
|
||||
margin_bottom = 21.0
|
||||
text = "Website"
|
||||
|
||||
[node name="GitHub" type="Button" parent="AboutDialog/AboutUI/Links/LinkButtons"]
|
||||
margin_left = 69.0
|
||||
margin_right = 162.0
|
||||
margin_bottom = 20.0
|
||||
margin_left = 59.0
|
||||
margin_right = 139.0
|
||||
margin_bottom = 21.0
|
||||
text = "GitHub Repo"
|
||||
|
||||
[node name="Donate" type="Button" parent="AboutDialog/AboutUI/Links/LinkButtons"]
|
||||
margin_left = 166.0
|
||||
margin_right = 224.0
|
||||
margin_bottom = 20.0
|
||||
margin_left = 143.0
|
||||
margin_right = 194.0
|
||||
margin_bottom = 21.0
|
||||
text = "Donate"
|
||||
|
||||
[node name="Copyright" type="Label" parent="AboutDialog/AboutUI"]
|
||||
margin_top = 111.0
|
||||
margin_top = 117.0
|
||||
margin_right = 268.0
|
||||
margin_bottom = 142.0
|
||||
margin_bottom = 150.0
|
||||
text = "
|
||||
Copyright 2019 - Orama Interactive"
|
||||
align = 1
|
||||
|
@ -1633,7 +1680,10 @@ dialog_text = "Are you sure you want to exit Pixelorama?"
|
|||
[connection signal="confirmed" from="ScaleImage" to="." method="_on_ScaleImage_confirmed"]
|
||||
[connection signal="popup_hide" from="ScaleImage" to="." method="_can_draw_true"]
|
||||
[connection signal="popup_hide" from="PreferencesDialog" to="." method="_can_draw_true"]
|
||||
[connection signal="item_selected" from="PreferencesDialog/LanguageContainer/LanguageOption" to="." method="_on_LanguageOption_item_selected"]
|
||||
[connection signal="item_selected" from="PreferencesDialog/VBoxContainer/OptionsContainer/LanguageOption" to="." method="_on_LanguageOption_item_selected"]
|
||||
[connection signal="value_changed" from="PreferencesDialog/VBoxContainer/GridOptions/GridWidthValue" to="." method="_on_GridWidthValue_value_changed"]
|
||||
[connection signal="value_changed" from="PreferencesDialog/VBoxContainer/GridOptions/GridHeightValue" to="." method="_on_GridHeightValue_value_changed"]
|
||||
[connection signal="color_changed" from="PreferencesDialog/VBoxContainer/GridOptions/GridColor" to="." method="_on_GridColor_color_changed"]
|
||||
[connection signal="popup_hide" from="AboutDialog" to="." method="_can_draw_true"]
|
||||
[connection signal="pressed" from="AboutDialog/AboutUI/Links/LinkButtons/Website" to="AboutDialog" method="_on_Website_pressed"]
|
||||
[connection signal="pressed" from="AboutDialog/AboutUI/Links/LinkButtons/GitHub" to="AboutDialog" method="_on_GitHub_pressed"]
|
||||
|
|
|
@ -112,8 +112,6 @@ func _process(delta : float) -> void:
|
|||
Input.set_custom_mouse_cursor(preload("res://Assets/Graphics/Tools/Bucket_Cursor.png"), 0, Vector2(6, 27))
|
||||
elif Global.current_left_tool == "ColorPicker":
|
||||
Input.set_custom_mouse_cursor(preload("res://Assets/Graphics/Tools/ColorPicker_Cursor.png"), 0, Vector2(5, 28))
|
||||
elif Global.current_left_tool != "RectSelect":
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
else:
|
||||
if !Input.is_mouse_button_pressed(BUTTON_LEFT) && !Input.is_mouse_button_pressed(BUTTON_RIGHT):
|
||||
if mouse_inside_canvas:
|
||||
|
@ -121,10 +119,8 @@ func _process(delta : float) -> void:
|
|||
Global.cursor_position_label.text = "[%s×%s]" % [size.x, size.y]
|
||||
if cursor_inside_canvas:
|
||||
cursor_inside_canvas = false
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
Input.set_custom_mouse_cursor(null)
|
||||
|
||||
|
||||
#Handle Undo/Redo
|
||||
var can_handle : bool = mouse_in_canvas && Global.can_draw && Global.has_focus
|
||||
var mouse_pressed : bool = (Input.is_action_just_pressed("left_mouse") && !Input.is_action_pressed("right_mouse")) || (Input.is_action_just_pressed("right_mouse") && !Input.is_action_pressed("left_mouse"))
|
||||
|
@ -276,7 +272,7 @@ func _process(delta : float) -> void:
|
|||
|
||||
previous_action = current_action
|
||||
if sprite_changed_this_frame:
|
||||
update_texture(current_layer_index)
|
||||
update_texture(current_layer_index, (Input.is_action_just_released("left_mouse") || Input.is_action_just_released("right_mouse")))
|
||||
|
||||
func handle_undo(action : String) -> void:
|
||||
var canvases := []
|
||||
|
@ -319,22 +315,23 @@ func handle_redo(action : String) -> void:
|
|||
Global.undo_redo.add_do_method(Global, "redo", canvases, layer_index)
|
||||
Global.undo_redo.commit_action()
|
||||
|
||||
func update_texture(layer_index : int) -> void:
|
||||
func update_texture(layer_index : int, update_frame_tex := true) -> void:
|
||||
layers[layer_index][1].create_from_image(layers[layer_index][0], 0)
|
||||
var layer_container := get_layer_container(layer_index)
|
||||
if layer_container:
|
||||
layer_container.get_child(0).get_child(1).texture = layers[layer_index][1]
|
||||
|
||||
#This code is used to update the texture in the animation timeline frame button
|
||||
#but blend_rect causes major performance issues on large images
|
||||
var whole_image := Image.new()
|
||||
whole_image.create(size.x, size.y, false, Image.FORMAT_RGBA8)
|
||||
for layer in layers:
|
||||
whole_image.blend_rect(layer[0], Rect2(position, size), Vector2.ZERO)
|
||||
layer[0].lock()
|
||||
var whole_image_texture := ImageTexture.new()
|
||||
whole_image_texture.create_from_image(whole_image, 0)
|
||||
frame_texture_rect.texture = whole_image_texture
|
||||
if update_frame_tex:
|
||||
#This code is used to update the texture in the animation timeline frame button
|
||||
#but blend_rect causes major performance issues on large images
|
||||
var whole_image := Image.new()
|
||||
whole_image.create(size.x, size.y, false, Image.FORMAT_RGBA8)
|
||||
for layer in layers:
|
||||
whole_image.blend_rect(layer[0], Rect2(position, size), Vector2.ZERO)
|
||||
layer[0].lock()
|
||||
var whole_image_texture := ImageTexture.new()
|
||||
whole_image_texture.create_from_image(whole_image, 0)
|
||||
frame_texture_rect.texture = whole_image_texture
|
||||
|
||||
func frame_changed(value : int) -> void:
|
||||
frame = value
|
||||
|
@ -394,10 +391,10 @@ func _draw() -> void:
|
|||
|
||||
#Idea taken from flurick (on GitHub)
|
||||
if Global.draw_grid:
|
||||
for x in size.x:
|
||||
draw_line(Vector2(x, location.y), Vector2(x, size.y), Color.black, true)
|
||||
for y in size.y:
|
||||
draw_line(Vector2(location.x, y), Vector2(size.x, y), Color.black, true)
|
||||
for x in range(0, size.x, Global.grid_width):
|
||||
draw_line(Vector2(x, location.y), Vector2(x, size.y), Global.grid_color, true)
|
||||
for y in range(0, size.y, Global.grid_height):
|
||||
draw_line(Vector2(location.x, y), Vector2(size.x, y), Global.grid_color, true)
|
||||
|
||||
#Draw rectangle to indicate the pixel currently being hovered on
|
||||
var mouse_pos := get_local_mouse_position() + location
|
||||
|
|
|
@ -15,6 +15,12 @@ var hidden_canvases := []
|
|||
# warning-ignore:unused_class_variable
|
||||
var selected_pixels := []
|
||||
var image_clipboard : Image
|
||||
# warning-ignore:unused_class_variable
|
||||
var grid_width := 1
|
||||
# warning-ignore:unused_class_variable
|
||||
var grid_height := 1
|
||||
# warning-ignore:unused_class_variable
|
||||
var grid_color := Color.black
|
||||
|
||||
#Tools & options
|
||||
# warning-ignore:unused_class_variable
|
||||
|
|
|
@ -38,7 +38,7 @@ func _ready() -> void:
|
|||
|
||||
# Set the language option menu's default selected option to the loaded locale
|
||||
var locale_index := loaded_locales.find(saved_locale)
|
||||
$PreferencesDialog/LanguageContainer/LanguageOption.selected = locale_index + 1
|
||||
$PreferencesDialog/VBoxContainer/OptionsContainer/LanguageOption.selected = locale_index + 1
|
||||
else: # If the user doesn't have a language preference, set it to their OS' locale
|
||||
TranslationServer.set_locale(OS.get_locale())
|
||||
|
||||
|
@ -309,9 +309,9 @@ func help_menu_id_pressed(id : int) -> void:
|
|||
Global.can_draw = false
|
||||
|
||||
func _on_CreateNewImage_confirmed() -> void:
|
||||
var width = $CreateNewImage/VBoxContainer/WidthCont/WidthValue.value
|
||||
var height = $CreateNewImage/VBoxContainer/HeightCont/HeightValue.value
|
||||
var fill_color : Color = $CreateNewImage/VBoxContainer/FillColor/FillColor.color
|
||||
var width : int = $CreateNewImage/VBoxContainer/OptionsContainer/WidthValue.value
|
||||
var height : int = $CreateNewImage/VBoxContainer/OptionsContainer/HeightValue.value
|
||||
var fill_color : Color = $CreateNewImage/VBoxContainer/OptionsContainer/FillColor.color
|
||||
clear_canvases()
|
||||
Global.canvas = load("res://Prefabs/Canvas.tscn").instance()
|
||||
Global.canvas.size = Vector2(width, height).floor()
|
||||
|
@ -591,9 +591,9 @@ func save_spritesheet() -> void:
|
|||
OS.alert("Can't save file")
|
||||
|
||||
func _on_ScaleImage_confirmed() -> void:
|
||||
var width = $ScaleImage/VBoxContainer/WidthCont/WidthValue.value
|
||||
var height = $ScaleImage/VBoxContainer/HeightCont/HeightValue.value
|
||||
var interpolation = $ScaleImage/VBoxContainer/InterpolationContainer/InterpolationType.selected
|
||||
var width : int = $ScaleImage/VBoxContainer/OptionsContainer/WidthValue.value
|
||||
var height : int = $ScaleImage/VBoxContainer/OptionsContainer/HeightValue.value
|
||||
var interpolation : int = $ScaleImage/VBoxContainer/OptionsContainer/InterpolationType.selected
|
||||
Global.undos += 1
|
||||
Global.undo_redo.create_action("Scale")
|
||||
Global.undo_redo.add_do_property(Global.canvas, "size", Vector2(width, height).floor())
|
||||
|
@ -618,6 +618,15 @@ func _on_LanguageOption_item_selected(ID : int) -> void:
|
|||
config_cache.set_value("preferences", "locale", TranslationServer.get_locale())
|
||||
config_cache.save("user://cache.ini")
|
||||
|
||||
func _on_GridWidthValue_value_changed(value : float) -> void:
|
||||
Global.grid_width = value
|
||||
|
||||
func _on_GridHeightValue_value_changed(value : float) -> void:
|
||||
Global.grid_height = value
|
||||
|
||||
func _on_GridColor_color_changed(color : Color) -> void:
|
||||
Global.grid_color = color
|
||||
|
||||
func _on_ImportSprites_popup_hide() -> void:
|
||||
if !opensprite_file_selected:
|
||||
Global.can_draw = true
|
||||
|
@ -1003,4 +1012,3 @@ func _exit_tree() -> void:
|
|||
config_cache.set_value("window", "position", OS.window_position)
|
||||
config_cache.set_value("window", "size", OS.window_size)
|
||||
config_cache.save("user://cache.ini")
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ OK OK Εντάξει
|
|||
Cancel Cancel Άκυρο
|
||||
Open Open Άνοιγμα
|
||||
Please Confirm... Please Confirm... Παρακαλώ επιβεβαιώστε...
|
||||
Image Size Image Size Μέγεθος εικόνας
|
||||
Width: Width: Πλάτος:
|
||||
Height: Height: Ύψος:
|
||||
File File Αρχείο
|
||||
|
@ -25,15 +26,23 @@ Clear Selection Clear Selection Καθαρισμός επιλογής
|
|||
Flip Horizontal Flip Horizontal Οριζόντια αναστροφή
|
||||
Flip Vertical Flip Vertical Κάθετη αναστροφή
|
||||
Preferences Preferences Προτιμήσεις
|
||||
Language: Language: Γλώσσα:
|
||||
System Language System Language Γλώσσα Συστήματος
|
||||
English English Αγγλικά
|
||||
Greek Greek Ελληνικά
|
||||
Tile Mode Tile Mode Λειτουργία μοτίβου
|
||||
Show Grid Show Grid Εμφάνιση πλέγματος
|
||||
Show Rulers Show Rulers Εμφάνιση χαράκων
|
||||
Show Guides Show Guides Εμφάνιση οδηγών
|
||||
About Pixelorama About Pixelorama Σχετικά με το Pixelorama
|
||||
Fill with color: Fill with color: Γέμισμα με χρώμα:
|
||||
Interpolation: Interpolation: Παρεμβολή:
|
||||
Nearest Nearest Χωρίς
|
||||
Bilinear Bilinear Διγραμμική
|
||||
Cubic Cubic Κυβική
|
||||
Trilinear Trilinear Τριγραμμική
|
||||
Grid options Grid options Επιλογές πλέγματος
|
||||
Color: Color: Χρώμα:
|
||||
Language: Language: Γλώσσα:
|
||||
System Language System Language Γλώσσα Συστήματος
|
||||
English English Αγγλικά
|
||||
Greek Greek Ελληνικά
|
||||
Utility Tools Utility Tools Βοηθητικά Εργαλεία
|
||||
Draw Tools Draw Tools Εργαλεία Ζωγραφικής
|
||||
Left tool options Left tool options Επιλογές αριστερού εργαλείου
|
||||
|
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue