mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +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:
parent
306d74a38b
commit
721cab8765
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -19,3 +19,6 @@ mono_crash.*.json
|
||||||
|
|
||||||
# macOS ignores
|
# macOS ignores
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# Android ignores
|
||||||
|
android/
|
||||||
|
|
|
@ -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]
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue