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

Minor changes that make Pixelorama work with Android

Just planting the seeds of a possible Android version, probably tablet-only, at least at first. I do not know when that will happen yet.
This commit is contained in:
Manolis Papadeas 2021-10-02 15:08:58 +03:00
parent 306d74a38b
commit 721cab8765
5 changed files with 16 additions and 4 deletions

9
.gitignore vendored
View file

@ -14,8 +14,11 @@ mono_crash.*.json
.directory .directory
*~ *~
#Visual Studio Code ignores # Visual Studio Code ignores
.vscode/ .vscode/
#macOS ignores # macOS ignores
.DS_Store .DS_Store
# Android ignores
android/

View file

@ -150,6 +150,7 @@ config/icon="res://assets/graphics/icons/icon.png"
config/macos_native_icon="res://assets/graphics/icons/icon.icns" config/macos_native_icon="res://assets/graphics/icons/icon.icns"
config/windows_native_icon="res://assets/graphics/icons/icon.ico" config/windows_native_icon="res://assets/graphics/icons/icon.ico"
config/Version="v0.9-stable" config/Version="v0.9-stable"
run/low_processor_mode.Android=false
[audio] [audio]
@ -181,6 +182,8 @@ window/per_pixel_transparency/allowed.HTML5=false
window/per_pixel_transparency/enabled.HTML5=false window/per_pixel_transparency/enabled.HTML5=false
window/per_pixel_transparency/allowed.OSX=false window/per_pixel_transparency/allowed.OSX=false
window/per_pixel_transparency/enabled.OSX=false window/per_pixel_transparency/enabled.OSX=false
window/per_pixel_transparency/allowed.Android=false
window/per_pixel_transparency/enabled.Android=false
[gui] [gui]

View file

@ -18,6 +18,7 @@ onready var canvas_preview_container := $MenuAndUI/UI/RightPanel/MarginContainer
onready var tool_panel := $MenuAndUI/UI/ToolsAndCanvas/ToolPanel onready var tool_panel := $MenuAndUI/UI/ToolsAndCanvas/ToolPanel
onready var scroll_container := $MenuAndUI/UI/RightPanel/MarginContainer/PreviewAndPalettes/ToolAndPaletteVSplit/ColorAndToolOptions/ScrollContainer onready var scroll_container := $MenuAndUI/UI/RightPanel/MarginContainer/PreviewAndPalettes/ToolAndPaletteVSplit/ColorAndToolOptions/ScrollContainer
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
var alternate_transparent_background = ColorRect.new() var alternate_transparent_background = ColorRect.new()
@ -77,6 +78,9 @@ func _ready() -> void:
OpenSave.handle_loading_files(OS.get_cmdline_args()) OpenSave.handle_loading_files(OS.get_cmdline_args())
get_tree().connect("files_dropped", self, "_on_files_dropped") get_tree().connect("files_dropped", self, "_on_files_dropped")
if OS.get_name() == "Android":
OS.request_permissions()
func handle_resize() -> void: func handle_resize() -> void:
var aspect_ratio = get_viewport_rect().size.x/(0.00001 if get_viewport_rect().size.y == 0 else get_viewport_rect().size.y) var aspect_ratio = get_viewport_rect().size.x/(0.00001 if get_viewport_rect().size.y == 0 else get_viewport_rect().size.y)

View file

@ -161,7 +161,7 @@ func preference_update(prop : String) -> void:
if prop in ["fps_limit"]: if prop in ["fps_limit"]:
Engine.set_target_fps(Global.fps_limit) Engine.set_target_fps(Global.fps_limit)
if prop in ["fps_limit_focus"]: if prop in ["fps_limit_focus"]:
idle_fps_spinbox.editable = !idle_fps_spinbox.editable idle_fps_spinbox.editable = !idle_fps_spinbox.editable

View file

@ -168,6 +168,8 @@ func _input(event : InputEvent) -> void:
else: else:
zoom_camera(-1) zoom_camera(-1)
elif event is InputEventPanGesture: # Pan Gesture on a Latop touchpad elif event is InputEventPanGesture: # Pan Gesture on a Latop touchpad
if OS.get_name() == "Android":
return
offset = offset + event.delta * zoom * 7 # for moving the canvas offset = offset + event.delta * zoom * 7 # for moving the canvas
elif event is InputEventMouseMotion && drag: elif event is InputEventMouseMotion && drag:
offset = offset - event.relative * zoom offset = offset - event.relative * zoom