-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.gd
77 lines (69 loc) · 2.12 KB
/
root.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class_name GStart
extends Control
#@onready
var test_scene = preload("res://game/scenes/origins_test.tscn")
@onready var rootW = $"/root"
# Called when the node enters the scene tree for the first time.
func _ready():
set_name.call_deferred("Iroot")
var t
#print(al[0])
#var c
#print_debug(DisplayServer.screen_get_dpi())
rootW.content_scale_factor = 96.0/DisplayServer.screen_get_dpi()
if OS.has_feature("mobile"): #if mobile (should be used for enabeling touch controls)
#https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.htmls
#https://docs.godotengine.org/en/latest/classes/class_inputeventscreentouch.html
#top left conner drag to open console
#$"/root".size = Vector2i(256,256)
#TODO: add these as setting to change
rootW.scaling_3d_scale = 0.25
#rootW.content_scale_factor = 3.0
var l = Console.new()
add_child(l)
else:
pass
#rootW.content_scale_factor = 1.0
#rootW.content_scale_aspect = 1.0
#rootW.content_scale_mode = rootW.CONTENT_SCALE_MODE_DISABLED
#rootW.content_scale_mode = rootW.CONTENT_SCALE_MODE_CANVAS_ITEMS
#rootW.content_scale_size = Vector2(1280.0,720.0)
t = test_scene.instantiate()
add_child(t)
#var w = WorldEnvironment.new()
#add_child(w)
#t = Camera3D.new()
#t.keep_aspect = Camera3D.KEEP_WIDTH
#w.add_child(t)
#t = MeshInstance3D.new()
#t.position = Vector3(-.75, -.75, -3.)
#t.mesh = PlaneMesh.new()
#w.add_child(t)
#t = SubViewportContainer.new()
#t.anchor_top = 0.0
#t.anchor_left = 0.0
#t.anchor_bottom = .5
#t.anchor_right = .5
#t.stretch = true
#add_child(t)
#c = t
#t = Window.new()
#t.transparent_bg = true
#t.size = floor(size*0.5)
#t.position = size*0.25
#t.render_target_update_mode = SubViewport.UPDATE_ALWAYS
#add_child(t)
#c = t
#t = Camera3D.new()
#t.keep_aspect = Camera3D.KEEP_WIDTH
#c.add_child(t)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
#if event is InputEventKey and event.is_pressed():
if event.is_action_pressed("toggle_console"): #`
var ctrlwnd = Console.new()
ctrlwnd.size = size*.5
ctrlwnd.position = size*.25
add_child(ctrlwnd)