1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Added space for panning - Closes #110

This commit is contained in:
OverloadedOrama 2020-01-09 20:49:27 +02:00
parent a4886a2ee7
commit 48e871586c
5 changed files with 20 additions and 6 deletions

View file

@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added ### Added
- Italian localization - thanks to Marco Galli! - Italian localization - thanks to Marco Galli!
- In addition to the middle mouse button, you can now use `Space` to pan around the canvas.
### Changed ### Changed
- More translatable strings, updates to Greek & Brazilian Portuguese (thanks to YeldhamDev) localizations. - More translatable strings, updates to Greek & Brazilian Portuguese (thanks to YeldhamDev) localizations.
@ -14,10 +15,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Added a VSplitContainer for Palettes and Layers. - Added a VSplitContainer for Palettes and Layers.
- Added a ScrollContainer for the palette buttons on the Edit Palette popup. - Added a ScrollContainer for the palette buttons on the Edit Palette popup.
- Made Palette .json files more readable, and made "comments" on top of the color data. - Made Palette .json files more readable, and made "comments" on top of the color data.
- THe grid options are now being updated realtime when they're being changed from the preferences. - The grid options are now being updated realtime when they're being changed from the preferences.
### Fixed ### Fixed
- Crash that occured when trying to delete contents of a selection, that were outside the canvas. - Fixed crash that occured when trying to delete contents of a selection, that were outside the canvas.
- Fixed .gpl palettes not being imported correctly - Issue #112 - Fixed .gpl palettes not being imported correctly - Issue #112
- Fixed crash that occured when pressing the play buttons on the timeline, on Godot 3.2 - Issue #111 - Fixed crash that occured when pressing the play buttons on the timeline, on Godot 3.2 - Issue #111

View file

@ -11,9 +11,9 @@ func _ready() -> void:
func _input(event : InputEvent) -> void: func _input(event : InputEvent) -> void:
var mouse_pos := viewport_container.get_local_mouse_position() var mouse_pos := viewport_container.get_local_mouse_position()
var viewport_size := viewport_container.rect_size var viewport_size := viewport_container.rect_size
if event.is_action_pressed("camera_drag"): if event.is_action_pressed("camera_drag") || event.is_action_pressed("space"):
drag = true drag = true
elif event.is_action_released("camera_drag"): elif event.is_action_released("camera_drag") || event.is_action_released("space"):
drag = false drag = false
if Global.can_draw && Rect2(Vector2.ZERO, viewport_size).has_point(mouse_pos): if Global.can_draw && Rect2(Vector2.ZERO, viewport_size).has_point(mouse_pos):

View file

@ -91,11 +91,18 @@ func _input(event : InputEvent) -> void:
else: else:
return return
current_pixel = get_local_mouse_position() + location
if Global.current_frame == frame && Global.has_focus: if Global.current_frame == frame && Global.has_focus:
update() update()
# We don't want to draw when pressing space, because it's used for panning
if Input.is_action_pressed("space"):
previous_mouse_pos = current_pixel
previous_mouse_pos.x = clamp(previous_mouse_pos.x, location.x, location.x + size.x)
previous_mouse_pos.y = clamp(previous_mouse_pos.y, location.y, location.y + size.y)
return
sprite_changed_this_frame = false sprite_changed_this_frame = false
current_pixel = get_local_mouse_position() + location
var mouse_pos := current_pixel var mouse_pos := current_pixel
var mouse_pos_floored := mouse_pos.floor() var mouse_pos_floored := mouse_pos.floor()
var mouse_pos_ceiled := mouse_pos.ceil() var mouse_pos_ceiled := mouse_pos.ceil()

View file

@ -24,6 +24,7 @@ func _ready() -> void:
contributors.create_item(contributor_root).set_text(0, " Subhang Nanduri") contributors.create_item(contributor_root).set_text(0, " Subhang Nanduri")
contributors.create_item(contributor_root).set_text(0, " danielnaoexiste") contributors.create_item(contributor_root).set_text(0, " danielnaoexiste")
contributors.create_item(contributor_root).set_text(0, " huskee") contributors.create_item(contributor_root).set_text(0, " huskee")
contributors.create_item(contributor_root).set_text(0, " Gaarco")
var donors_root := donors.create_item() var donors_root := donors.create_item()
donors.create_item(donors_root).set_text(0, " pcmxms") donors.create_item(donors_root).set_text(0, " pcmxms")

View file

@ -45,12 +45,12 @@ _global_script_class_icons={
[application] [application]
config/name="Pixelorama" config/name="Pixelorama"
config/description="A free & open-source 2D sprite editor"
run/main_scene="res://Main.tscn" run/main_scene="res://Main.tscn"
run/low_processor_mode=true run/low_processor_mode=true
boot_splash/image="res://splash.png" boot_splash/image="res://splash.png"
boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 ) boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 )
config/icon="res://icon.png" config/icon="res://icon.png"
config/description="A free & open-source 2D sprite editor"
config/Version="v0.6.1" config/Version="v0.6.1"
[autoload] [autoload]
@ -214,6 +214,11 @@ delete={
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777224,"unicode":0,"echo":false,"script":null) "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777224,"unicode":0,"echo":false,"script":null)
] ]
} }
space={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
]
}
[locale] [locale]