mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Added 2 small sprites below the cursor for the selected tools
Instead of having a tool icon as a cursor for the left tool only
This commit is contained in:
parent
e26fd5077d
commit
1bd8ec4ae0
BIN
Assets/Graphics/Cursor.png
Normal file
BIN
Assets/Graphics/Cursor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 667 B |
34
Assets/Graphics/Cursor.png.import
Normal file
34
Assets/Graphics/Cursor.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Cursor.png-a311bc072ee5dc38d7f52d76fe3ea236.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Cursor.png"
|
||||
dest_files=[ "res://.import/Cursor.png-a311bc072ee5dc38d7f52d76fe3ea236.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -1,34 +1,13 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Bucket_Cursor.png-8abbae452d9f96bd83cd2d0982f01047.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
importer="image"
|
||||
type="Image"
|
||||
path="res://.import/Bucket_Cursor.png-8abbae452d9f96bd83cd2d0982f01047.image"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Tools/Bucket_Cursor.png"
|
||||
dest_files=[ "res://.import/Bucket_Cursor.png-8abbae452d9f96bd83cd2d0982f01047.stex" ]
|
||||
dest_files=[ "res://.import/Bucket_Cursor.png-8abbae452d9f96bd83cd2d0982f01047.image" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
|
@ -1,34 +1,13 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ColorPicker_Cursor.png-85822710d85a1ad1331ab050f6c87cad.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
importer="image"
|
||||
type="Image"
|
||||
path="res://.import/ColorPicker_Cursor.png-85822710d85a1ad1331ab050f6c87cad.image"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Tools/ColorPicker_Cursor.png"
|
||||
dest_files=[ "res://.import/ColorPicker_Cursor.png-85822710d85a1ad1331ab050f6c87cad.stex" ]
|
||||
dest_files=[ "res://.import/ColorPicker_Cursor.png-85822710d85a1ad1331ab050f6c87cad.image" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
|
@ -1,34 +1,13 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Eraser_Cursor.png-f692572693acb37ec2194276528a81d8.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
importer="image"
|
||||
type="Image"
|
||||
path="res://.import/Eraser_Cursor.png-f692572693acb37ec2194276528a81d8.image"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Tools/Eraser_Cursor.png"
|
||||
dest_files=[ "res://.import/Eraser_Cursor.png-f692572693acb37ec2194276528a81d8.stex" ]
|
||||
dest_files=[ "res://.import/Eraser_Cursor.png-f692572693acb37ec2194276528a81d8.image" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
|
@ -1,34 +1,13 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/LightenDarken_Cursor.png-4c3a225d3133a1ea63f3ad47f599a686.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
importer="image"
|
||||
type="Image"
|
||||
path="res://.import/LightenDarken_Cursor.png-4c3a225d3133a1ea63f3ad47f599a686.image"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Tools/LightenDarken_Cursor.png"
|
||||
dest_files=[ "res://.import/LightenDarken_Cursor.png-4c3a225d3133a1ea63f3ad47f599a686.stex" ]
|
||||
dest_files=[ "res://.import/LightenDarken_Cursor.png-4c3a225d3133a1ea63f3ad47f599a686.image" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
|
@ -1,34 +1,13 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Pencil_Cursor.png-835e48cc824d523278a13c95a3b3ec6e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
importer="image"
|
||||
type="Image"
|
||||
path="res://.import/Pencil_Cursor.png-835e48cc824d523278a13c95a3b3ec6e.image"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Tools/Pencil_Cursor.png"
|
||||
dest_files=[ "res://.import/Pencil_Cursor.png-835e48cc824d523278a13c95a3b3ec6e.stex" ]
|
||||
dest_files=[ "res://.import/Pencil_Cursor.png-835e48cc824d523278a13c95a3b3ec6e.image" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
|
@ -1,34 +1,13 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/RectSelect_Cursor.png-a7675c7d3d9b92992266b4bedca7e03f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
importer="image"
|
||||
type="Image"
|
||||
path="res://.import/RectSelect_Cursor.png-a7675c7d3d9b92992266b4bedca7e03f.image"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Tools/RectSelect_Cursor.png"
|
||||
dest_files=[ "res://.import/RectSelect_Cursor.png-a7675c7d3d9b92992266b4bedca7e03f.stex" ]
|
||||
dest_files=[ "res://.import/RectSelect_Cursor.png-a7675c7d3d9b92992266b4bedca7e03f.image" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
|
@ -121,7 +121,6 @@ shortcut = SubResource( 16 )
|
|||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_default_cursor_shape = 16
|
||||
theme = ExtResource( 1 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
|
@ -782,7 +781,6 @@ size_flags_horizontal = 3
|
|||
custom_constants/separation = 0
|
||||
|
||||
[node name="HViewportContainer" type="HBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline"]
|
||||
editor/display_folded = true
|
||||
margin_right = 704.0
|
||||
margin_bottom = 478.0
|
||||
size_flags_horizontal = 3
|
||||
|
@ -809,7 +807,6 @@ enabled_focus_mode = 0
|
|||
script = ExtResource( 13 )
|
||||
|
||||
[node name="ViewportandVerticalRuler" type="HBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers"]
|
||||
editor/display_folded = true
|
||||
margin_top = 16.0
|
||||
margin_right = 704.0
|
||||
margin_bottom = 478.0
|
||||
|
@ -1707,6 +1704,10 @@ resizable = true
|
|||
dialog_text = "QUIT_LABEL"
|
||||
|
||||
[node name="AnimationTimer" type="Timer" parent="."]
|
||||
|
||||
[node name="LeftCursor" type="Sprite" parent="."]
|
||||
|
||||
[node name="RightCursor" type="Sprite" parent="."]
|
||||
[connection signal="color_changed" from="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_LeftColorPickerButton_color_changed"]
|
||||
[connection signal="popup_closed" from="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_can_draw_true"]
|
||||
[connection signal="pressed" from="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_can_draw_false"]
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
[ext_resource path="res://Scripts/FrameButton.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=3]
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 0.337255, 0.32549, 0.388235, 1 )
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
corner_radius_bottom_right = 2
|
||||
corner_radius_bottom_left = 2
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 0.231373, 0.219608, 0.266667, 1 )
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
bg_color = Color( 0.211765, 0.2, 0.247059, 1 )
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
corner_radius_bottom_right = 2
|
||||
corner_radius_bottom_left = 2
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
[sub_resource type="StyleBoxFlat" id=3]
|
||||
bg_color = Color( 0.270588, 0.258824, 0.305882, 1 )
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
|
@ -34,9 +34,9 @@ rect_min_size = Vector2( 36, 36 )
|
|||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
custom_styles/hover = SubResource( 3 )
|
||||
custom_styles/pressed = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 2 )
|
||||
custom_styles/hover = SubResource( 1 )
|
||||
custom_styles/pressed = SubResource( 2 )
|
||||
custom_styles/normal = SubResource( 3 )
|
||||
toggle_mode = true
|
||||
button_mask = 3
|
||||
script = ExtResource( 1 )
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
bg_color = Color( 0.337255, 0.32549, 0.388235, 1 )
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
bg_color = Color( 0.231373, 0.219608, 0.266667, 1 )
|
||||
bg_color = Color( 0.211765, 0.2, 0.247059, 1 )
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=3]
|
||||
bg_color = Color( 0.270588, 0.258824, 0.305882, 1 )
|
||||
|
|
|
@ -113,7 +113,9 @@ func _process(delta : float) -> void:
|
|||
Global.cursor_position_label.text = "[%s×%s] %s, %s" % [size.x, size.y, mouse_pos_floored.x, mouse_pos_floored.y]
|
||||
if !cursor_inside_canvas:
|
||||
cursor_inside_canvas = true
|
||||
Input.set_custom_mouse_cursor(load("res://Assets/Graphics/Tools/%s_Cursor.png" % Global.current_left_tool), 0, Vector2(3, 24))
|
||||
Input.set_custom_mouse_cursor(load("res://Assets/Graphics/Cursor.png"), 0, Vector2(15, 15))
|
||||
Global.left_cursor.visible = true
|
||||
Global.right_cursor.visible = true
|
||||
else:
|
||||
if !Input.is_mouse_button_pressed(BUTTON_LEFT) && !Input.is_mouse_button_pressed(BUTTON_RIGHT):
|
||||
if mouse_inside_canvas:
|
||||
|
@ -121,6 +123,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
|
||||
Global.left_cursor.visible = false
|
||||
Global.right_cursor.visible = false
|
||||
Input.set_custom_mouse_cursor(null)
|
||||
|
||||
#Handle Undo/Redo
|
||||
|
|
|
@ -12,6 +12,8 @@ var has_focus := false
|
|||
var canvases := []
|
||||
# warning-ignore:unused_class_variable
|
||||
var hidden_canvases := []
|
||||
var left_cursor_tool_texture : ImageTexture
|
||||
var right_cursor_tool_texture : ImageTexture
|
||||
# warning-ignore:unused_class_variable
|
||||
var selected_pixels := []
|
||||
var image_clipboard : Image
|
||||
|
@ -103,6 +105,8 @@ var custom_right_brush_texture := ImageTexture.new()
|
|||
|
||||
#Nodes
|
||||
var control : Node
|
||||
var left_cursor : Sprite
|
||||
var right_cursor : Sprite
|
||||
var canvas : Canvas
|
||||
var canvas_parent : Node
|
||||
var main_viewport : ViewportContainer
|
||||
|
@ -178,8 +182,14 @@ func _ready() -> void:
|
|||
|
||||
var root = get_tree().get_root()
|
||||
control = find_node_by_name(root, "Control")
|
||||
left_cursor = find_node_by_name(root, "LeftCursor")
|
||||
right_cursor = find_node_by_name(root, "RightCursor")
|
||||
canvas = find_node_by_name(root, "Canvas")
|
||||
canvases.append(canvas)
|
||||
left_cursor_tool_texture = ImageTexture.new()
|
||||
left_cursor_tool_texture.create_from_image(preload("res://Assets/Graphics/Tools/Pencil_Cursor.png"))
|
||||
right_cursor_tool_texture = ImageTexture.new()
|
||||
right_cursor_tool_texture.create_from_image(preload("res://Assets/Graphics/Tools/Eraser_Cursor.png"))
|
||||
canvas_parent = canvas.get_parent()
|
||||
main_viewport = find_node_by_name(root, "ViewportContainer")
|
||||
second_viewport = find_node_by_name(root, "ViewportContainer2")
|
||||
|
|
|
@ -164,6 +164,10 @@ func _ready() -> void:
|
|||
Global.brushes_from_files = Global.custom_brushes.size()
|
||||
|
||||
func _input(event : InputEvent) -> void:
|
||||
Global.left_cursor.position = get_global_mouse_position() + Vector2(-20, 20)
|
||||
Global.left_cursor.texture = Global.left_cursor_tool_texture
|
||||
Global.right_cursor.position = get_global_mouse_position() + Vector2(20, 20)
|
||||
Global.right_cursor.texture = Global.right_cursor_tool_texture
|
||||
if event.is_action_pressed("toggle_fullscreen"):
|
||||
OS.window_fullscreen = !OS.window_fullscreen
|
||||
|
||||
|
@ -319,8 +323,8 @@ func _on_CreateNewImage_confirmed() -> void:
|
|||
Global.canvas = load("res://Prefabs/Canvas.tscn").instance()
|
||||
Global.canvas.size = Vector2(width, height).floor()
|
||||
|
||||
Global.canvas_parent.add_child(Global.canvas)
|
||||
Global.canvases.append(Global.canvas)
|
||||
Global.canvas_parent.add_child(Global.canvas)
|
||||
Global.current_frame = 0
|
||||
if fill_color.a > 0:
|
||||
Global.canvas.layers[0][0].fill(fill_color)
|
||||
|
@ -497,8 +501,8 @@ func _on_ImportSprites_files_selected(paths) -> void:
|
|||
#Store [Image, ImageTexture, Layer Name, Visibity boolean]
|
||||
canvas.layers.append([image, tex, "Layer 0", true])
|
||||
canvas.frame = i
|
||||
Global.canvas_parent.add_child(canvas)
|
||||
Global.canvases.append(canvas)
|
||||
Global.canvas_parent.add_child(canvas)
|
||||
canvas.visible = false
|
||||
if path == paths[0]: #If it's the first file
|
||||
max_size = canvas.size
|
||||
|
@ -712,6 +716,9 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
|
|||
else:
|
||||
t[0].texture_normal = load("res://Assets/Graphics/Tools/%s.png" % tool_name)
|
||||
|
||||
Global.left_cursor_tool_texture.create_from_image(load("res://Assets/Graphics/Tools/%s_Cursor.png" % Global.current_left_tool))
|
||||
Global.right_cursor_tool_texture.create_from_image(load("res://Assets/Graphics/Tools/%s_Cursor.png" % Global.current_right_tool))
|
||||
|
||||
func _on_LeftIndicatorCheckbox_toggled(button_pressed) -> void:
|
||||
Global.left_square_indicator_visible = button_pressed
|
||||
|
||||
|
|
Loading…
Reference in a new issue