Port remaining misc demos to 3.0
android_iap, threads, tween, window_management
@@ -15,7 +15,7 @@ signal consume_not_required
|
||||
signal sku_details_complete
|
||||
signal sku_details_error
|
||||
|
||||
onready var payment = Globals.get_singleton("GodotPayments")
|
||||
onready var payment = GlobalConfig.get_singleton("GodotPayments")
|
||||
|
||||
func _ready():
|
||||
if payment:
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
23
misc/android_iap/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
130
misc/android_iap/main.tscn
Normal file
@@ -0,0 +1,130 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://iap_demo.gd" type="Script" id=1]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
|
||||
anchor_right = 1
|
||||
anchor_bottom = 1
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="purchase" type="Button" parent="."]
|
||||
|
||||
margin_left = 40.0
|
||||
margin_top = 40.0
|
||||
margin_right = 250.0
|
||||
margin_bottom = 120.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Purchase in app"
|
||||
flat = false
|
||||
|
||||
[node name="consume" type="Button" parent="."]
|
||||
|
||||
margin_left = 40.0
|
||||
margin_top = 150.0
|
||||
margin_right = 250.0
|
||||
margin_bottom = 230.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Consume in app"
|
||||
flat = false
|
||||
|
||||
[node name="request" type="Button" parent="."]
|
||||
|
||||
margin_left = 40.0
|
||||
margin_top = 260.0
|
||||
margin_right = 250.0
|
||||
margin_bottom = 340.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Request purchased"
|
||||
flat = false
|
||||
|
||||
[node name="query" type="Button" parent="."]
|
||||
|
||||
margin_left = 40.0
|
||||
margin_top = 370.0
|
||||
margin_right = 250.0
|
||||
margin_bottom = 450.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Query in app items"
|
||||
flat = false
|
||||
|
||||
[node name="alert" type="AcceptDialog" parent="."]
|
||||
|
||||
visible = false
|
||||
margin_left = 290.0
|
||||
margin_top = 60.0
|
||||
margin_right = 700.0
|
||||
margin_bottom = 290.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
popup_exclusive = false
|
||||
window_title = "Alert!"
|
||||
resizable = false
|
||||
dialog_hide_on_ok = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
|
||||
margin_left = 300.0
|
||||
margin_top = 40.0
|
||||
margin_right = 932.0
|
||||
margin_bottom = 207.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "\"iap\" is located in Autoloads. See Scene > Project Settings > AutoLoad
|
||||
|
||||
To enable IAP module
|
||||
|
||||
1. Scene > Project Settings
|
||||
2. write [Category : android] / [Property : modules] / [Type : String] and click Add
|
||||
3. Click \"Android\" on left panel
|
||||
4. double click on right filed of \"modules\"
|
||||
5. write \"org/godotengine/godot/GodotPaymentV3\"
|
||||
|
||||
To test in-app purchase on android device,
|
||||
|
||||
1. Need to add \"com.android.vending.BILLING\" permission at Export > Android > User Permissions
|
||||
2. Export APK and upload it as alpha or beta stage to Google Play Developer Console and publish it.
|
||||
(It's not published to public, but you and tester can access it.)
|
||||
3. There should be activated in-app item
|
||||
4. Any changes on Developer console will take 2~3 hours to take effect"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
|
||||
14
misc/android_iap/project.godot
Normal file
@@ -0,0 +1,14 @@
|
||||
[android]
|
||||
|
||||
modules = "org/godotengine/godot/GodotPaymentV3"
|
||||
|
||||
[application]
|
||||
|
||||
icon = "res://icon.png"
|
||||
main_scene = "res://main.tscn"
|
||||
name = "Android IAP"
|
||||
|
||||
[autoload]
|
||||
|
||||
iap = "*res://iap.gd"
|
||||
|
||||
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
23
misc/threads/mona.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/mona.png-a5ce9963ac8c7ef765aeb0f5428366a9.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
9
misc/threads/project.godot
Normal file
@@ -0,0 +1,9 @@
|
||||
config_version=3
|
||||
[application]
|
||||
|
||||
name="Loading in a Thread"
|
||||
main_scene="res://thread.tscn"
|
||||
|
||||
[memory]
|
||||
|
||||
multithread/thread_rid_pool_prealloc=60
|
||||
@@ -1,10 +1,8 @@
|
||||
|
||||
extends Node2D
|
||||
|
||||
# Member variables
|
||||
var thread = Thread.new()
|
||||
|
||||
|
||||
# This function runs in a thread!
|
||||
# Threads always take one userdata argument
|
||||
func _bg_load(path):
|
||||
33
misc/threads/thread.tscn
Normal file
@@ -0,0 +1,33 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://thread.gd" type="Script" id=1]
|
||||
|
||||
[node name="node" type="Node2D"]
|
||||
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="load" type="Button" parent="."]
|
||||
|
||||
margin_left = 192.0
|
||||
margin_top = 32.0
|
||||
margin_right = 320.0
|
||||
margin_bottom = 64.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Load in Thread"
|
||||
flat = false
|
||||
|
||||
[node name="sprite" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 248, 256 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[connection signal="pressed" from="load" to="." method="_on_load_pressed"]
|
||||
|
||||
|
||||
BIN
misc/tween/godot.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
23
misc/tween/godot.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/godot.png-5e0da45ed3d6786d5794553e04f58a8c.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
23
misc/tween/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
@@ -25,10 +25,10 @@ func _ready():
|
||||
var name = modes[index]
|
||||
get_node("modes/" + name).connect("pressed", self, "on_modes_changed", [name])
|
||||
|
||||
get_node("color/color_from").set_color(Color(1, 0, 0, 1))
|
||||
get_node("color/color_from").set_pick_color(Color(1, 0, 0, 1))
|
||||
get_node("color/color_from").connect("color_changed", self, "on_color_changed")
|
||||
|
||||
get_node("color/color_to").set_color(Color(0, 1, 1, 1))
|
||||
get_node("color/color_to").set_pick_color(Color(0, 1, 1, 1))
|
||||
get_node("color/color_to").connect("color_changed", self, "on_color_changed")
|
||||
|
||||
get_node("trans/linear").set_pressed(true)
|
||||
@@ -45,7 +45,7 @@ func on_trans_changed(name, index):
|
||||
var btn = get_node("trans/" + trans[index])
|
||||
|
||||
btn.set_pressed(pressed)
|
||||
btn.set_ignore_mouse(pressed)
|
||||
set_mouse_filter(Control.MOUSE_FILTER_IGNORE if pressed else Control.MOUSE_FILTER_PASS)
|
||||
|
||||
state.trans = index
|
||||
reset_tween()
|
||||
@@ -57,7 +57,7 @@ func on_eases_changed(name, index):
|
||||
var btn = get_node("eases/" + eases[index])
|
||||
|
||||
btn.set_pressed(pressed)
|
||||
btn.set_ignore_mouse(pressed)
|
||||
set_mouse_filter(Control.MOUSE_FILTER_IGNORE if pressed else Control.MOUSE_FILTER_PASS)
|
||||
|
||||
state.eases = index
|
||||
reset_tween()
|
||||
@@ -68,10 +68,10 @@ func on_modes_changed(name):
|
||||
if name == "pause":
|
||||
if get_node("modes/pause").is_pressed():
|
||||
tween.stop_all()
|
||||
get_node("timeline").set_ignore_mouse(false)
|
||||
get_node("timeline").set_mouse_filter(Control.MOUSE_FILTER_PASS)
|
||||
else:
|
||||
tween.resume_all()
|
||||
get_node("timeline").set_ignore_mouse(true)
|
||||
get_node("timeline").set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
|
||||
else:
|
||||
reset_tween()
|
||||
|
||||
@@ -92,12 +92,12 @@ func reset_tween():
|
||||
var size = get_node("tween/area").get_size()
|
||||
|
||||
if get_node("modes/move").is_pressed():
|
||||
tween.interpolate_method(sprite, "set_pos", Vector2(0, 0), Vector2(size.width, size.height), 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "transform/pos", Vector2(size.width, size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)
|
||||
tween.interpolate_method(sprite, "set_position", Vector2(0, 0), Vector2(size.width, size.height), 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "transform/position", Vector2(size.width, size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)
|
||||
|
||||
if get_node("modes/color").is_pressed():
|
||||
tween.interpolate_method(sprite, "set_modulate", get_node("color/color_from").get_color(), get_node("color/color_to").get_color(), 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "modulate", get_node("color/color_to").get_color(), get_node("color/color_from").get_color(), 2, state.trans, state.eases, 2)
|
||||
tween.interpolate_method(sprite, "set_modulate", get_node("color/color_from").get_pick_color(), get_node("color/color_to").get_pick_color(), 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "modulate", get_node("color/color_to").get_pick_color(), get_node("color/color_from").get_pick_color(), 2, state.trans, state.eases, 2)
|
||||
else:
|
||||
sprite.set_modulate(Color(1,1,1,1))
|
||||
|
||||
@@ -108,8 +108,8 @@ func reset_tween():
|
||||
sprite.set_scale(Vector2(1,1))
|
||||
|
||||
if get_node("modes/rotate").is_pressed():
|
||||
tween.interpolate_method(sprite, "set_rotd", 0, 360, 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "transform/rot", 360, 0, 2, state.trans, state.eases, 2)
|
||||
tween.interpolate_method(sprite, "set_rotation_deg", 0, 360, 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "transform/rotation_deg", 360, 0, 2, state.trans, state.eases, 2)
|
||||
|
||||
if get_node("modes/callback").is_pressed():
|
||||
tween.interpolate_callback(self, 0.5, "on_callback", "0.5 second's after")
|
||||
@@ -119,11 +119,11 @@ func reset_tween():
|
||||
follow.show()
|
||||
follow_2.show()
|
||||
|
||||
tween.follow_method(follow, "set_pos", Vector2(0, size.height), sprite, "get_pos", 2, state.trans, state.eases)
|
||||
tween.targeting_method(follow, "set_pos", sprite, "get_pos", Vector2(0, size.height), 2, state.trans, state.eases, 2)
|
||||
tween.follow_method(follow, "set_position", Vector2(0, size.height), sprite, "get_position", 2, state.trans, state.eases)
|
||||
tween.targeting_method(follow, "set_position", sprite, "get_position", Vector2(0, size.height), 2, state.trans, state.eases, 2)
|
||||
|
||||
tween.targeting_property(follow_2, "transform/pos", sprite, "transform/pos", Vector2(size.width, 0), 2, state.trans, state.eases)
|
||||
tween.follow_property(follow_2, "transform/pos", Vector2(size.width, 0), sprite, "transform/pos", 2, state.trans, state.eases, 2)
|
||||
tween.targeting_property(follow_2, "transform/position", sprite, "transform/position", Vector2(size.width, 0), 2, state.trans, state.eases)
|
||||
tween.follow_property(follow_2, "transform/position", Vector2(size.width, 0), sprite, "transform/position", 2, state.trans, state.eases, 2)
|
||||
else:
|
||||
follow.hide()
|
||||
follow_2.hide()
|
||||
@@ -134,11 +134,11 @@ func reset_tween():
|
||||
|
||||
if get_node("modes/pause").is_pressed():
|
||||
tween.stop_all()
|
||||
get_node("timeline").set_ignore_mouse(false)
|
||||
#get_node("timeline").set_ignore_mouse(false)
|
||||
get_node("timeline").set_value(0)
|
||||
else:
|
||||
tween.resume_all()
|
||||
get_node("timeline").set_ignore_mouse(true)
|
||||
#get_node("timeline").set_ignore_mouse(true)
|
||||
|
||||
|
||||
func _on_tween_step(object, key, elapsed, value):
|
||||
583
misc/tween/main.tscn
Normal file
@@ -0,0 +1,583 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://main.gd" type="Script" id=1]
|
||||
[ext_resource path="res://godot.png" type="Texture" id=2]
|
||||
|
||||
[node name="main" type="Control"]
|
||||
|
||||
margin_right = 800.0
|
||||
margin_bottom = 600.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="trans" type="VBoxContainer" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
margin_left = 56.0
|
||||
margin_top = 256.0
|
||||
margin_right = 129.0
|
||||
margin_bottom = 582.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
alignment = 0
|
||||
|
||||
[node name="linear" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 12.0
|
||||
margin_top = 3.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 23.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "linear"
|
||||
flat = false
|
||||
|
||||
[node name="sine" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 17.0
|
||||
margin_top = 33.0
|
||||
margin_right = 56.0
|
||||
margin_bottom = 53.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "sine"
|
||||
flat = false
|
||||
|
||||
[node name="quint" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 14.0
|
||||
margin_top = 63.0
|
||||
margin_right = 59.0
|
||||
margin_bottom = 83.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "quint"
|
||||
flat = false
|
||||
|
||||
[node name="quart" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 14.0
|
||||
margin_top = 93.0
|
||||
margin_right = 59.0
|
||||
margin_bottom = 113.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "quart"
|
||||
flat = false
|
||||
|
||||
[node name="quad" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 15.0
|
||||
margin_top = 123.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 143.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "quad"
|
||||
flat = false
|
||||
|
||||
[node name="expo" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 15.0
|
||||
margin_top = 153.0
|
||||
margin_right = 58.0
|
||||
margin_bottom = 173.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "expo"
|
||||
flat = false
|
||||
|
||||
[node name="elastic" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 9.0
|
||||
margin_top = 183.0
|
||||
margin_right = 63.0
|
||||
margin_bottom = 203.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "elastic"
|
||||
flat = false
|
||||
|
||||
[node name="cubic" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 13.0
|
||||
margin_top = 213.0
|
||||
margin_right = 59.0
|
||||
margin_bottom = 233.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "cubic"
|
||||
flat = false
|
||||
|
||||
[node name="circ" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 19.0
|
||||
margin_top = 243.0
|
||||
margin_right = 54.0
|
||||
margin_bottom = 263.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "circ"
|
||||
flat = false
|
||||
|
||||
[node name="bounce" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 7.0
|
||||
margin_top = 273.0
|
||||
margin_right = 66.0
|
||||
margin_bottom = 293.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "bounce"
|
||||
flat = false
|
||||
|
||||
[node name="back" type="Button" parent="trans"]
|
||||
|
||||
margin_left = 16.0
|
||||
margin_top = 303.0
|
||||
margin_right = 57.0
|
||||
margin_bottom = 323.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "back"
|
||||
flat = false
|
||||
|
||||
[node name="eases" type="VBoxContainer" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
margin_left = 152.0
|
||||
margin_top = 256.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 372.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
alignment = 0
|
||||
|
||||
[node name="in" type="Button" parent="eases"]
|
||||
|
||||
margin_left = 19.0
|
||||
margin_top = 3.0
|
||||
margin_right = 43.0
|
||||
margin_bottom = 23.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "in"
|
||||
flat = false
|
||||
|
||||
[node name="out" type="Button" parent="eases"]
|
||||
|
||||
margin_left = 15.0
|
||||
margin_top = 33.0
|
||||
margin_right = 48.0
|
||||
margin_bottom = 53.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "out"
|
||||
flat = false
|
||||
|
||||
[node name="in_out" type="Button" parent="eases"]
|
||||
|
||||
margin_left = 6.0
|
||||
margin_top = 63.0
|
||||
margin_right = 57.0
|
||||
margin_bottom = 83.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "in_out"
|
||||
flat = false
|
||||
|
||||
[node name="out_in" type="Button" parent="eases"]
|
||||
|
||||
margin_left = 6.0
|
||||
margin_top = 93.0
|
||||
margin_right = 57.0
|
||||
margin_bottom = 113.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "out_in"
|
||||
flat = false
|
||||
|
||||
[node name="modes" type="VBoxContainer" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
margin_left = 240.0
|
||||
margin_top = 256.0
|
||||
margin_right = 317.0
|
||||
margin_bottom = 492.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
alignment = 0
|
||||
|
||||
[node name="move" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 14.0
|
||||
margin_top = 3.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 23.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "move"
|
||||
flat = false
|
||||
|
||||
[node name="color" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 16.0
|
||||
margin_top = 33.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 53.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "color"
|
||||
flat = false
|
||||
|
||||
[node name="scale" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 16.0
|
||||
margin_top = 63.0
|
||||
margin_right = 61.0
|
||||
margin_bottom = 83.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "scale"
|
||||
flat = false
|
||||
|
||||
[node name="rotate" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 13.0
|
||||
margin_top = 93.0
|
||||
margin_right = 63.0
|
||||
margin_bottom = 113.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "rotate"
|
||||
flat = false
|
||||
|
||||
[node name="callback" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 7.0
|
||||
margin_top = 123.0
|
||||
margin_right = 70.0
|
||||
margin_bottom = 143.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "callback"
|
||||
flat = false
|
||||
|
||||
[node name="follow" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 13.0
|
||||
margin_top = 153.0
|
||||
margin_right = 63.0
|
||||
margin_bottom = 173.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "follow"
|
||||
flat = false
|
||||
|
||||
[node name="repeat" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 12.0
|
||||
margin_top = 183.0
|
||||
margin_right = 65.0
|
||||
margin_bottom = 203.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "repeat"
|
||||
flat = false
|
||||
|
||||
[node name="pause" type="Button" parent="modes"]
|
||||
|
||||
margin_left = 13.0
|
||||
margin_top = 213.0
|
||||
margin_right = 63.0
|
||||
margin_bottom = 233.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "pause"
|
||||
flat = false
|
||||
|
||||
[node name="color" type="VBoxContainer" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
margin_left = 384.0
|
||||
margin_top = 240.0
|
||||
margin_right = 760.0
|
||||
margin_bottom = 592.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
alignment = 0
|
||||
|
||||
[node name="label_1" type="Label" parent="color"]
|
||||
|
||||
margin_left = 151.0
|
||||
margin_right = 225.0
|
||||
margin_bottom = 14.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Color From:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="color_from" type="ColorPicker" parent="color"]
|
||||
|
||||
margin_left = 71.0
|
||||
margin_top = 18.0
|
||||
margin_right = 304.0
|
||||
margin_bottom = 207.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
alignment = 0
|
||||
|
||||
[node name="label_2" type="Label" parent="color"]
|
||||
|
||||
margin_left = 160.0
|
||||
margin_top = 211.0
|
||||
margin_right = 216.0
|
||||
margin_bottom = 225.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Color To:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="color_to" type="ColorPicker" parent="color"]
|
||||
|
||||
margin_left = 71.0
|
||||
margin_top = 229.0
|
||||
margin_right = 304.0
|
||||
margin_bottom = 418.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
alignment = 0
|
||||
|
||||
[node name="tween" type="Tween" parent="."]
|
||||
|
||||
playback_process_mode = 1
|
||||
playback/active = true
|
||||
playback/repeat = true
|
||||
playback/speed = 1.0
|
||||
|
||||
[node name="area" type="Panel" parent="tween"]
|
||||
|
||||
margin_left = 32.0
|
||||
margin_top = 32.0
|
||||
margin_right = 768.0
|
||||
margin_bottom = 216.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
|
||||
[node name="label" type="RichTextLabel" parent="tween/area"]
|
||||
|
||||
margin_left = 176.0
|
||||
margin_top = 24.0
|
||||
margin_right = 552.0
|
||||
margin_bottom = 160.0
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
bbcode_enabled = false
|
||||
bbcode_text = ""
|
||||
visible_characters = -1
|
||||
|
||||
[node name="sprite" type="Sprite" parent="tween/area"]
|
||||
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="follow" type="Sprite" parent="tween/area"]
|
||||
|
||||
position = Vector2( 0, 185 )
|
||||
texture = ExtResource( 2 )
|
||||
_sections_unfolded = [ "Animation", "Offset", "Region" ]
|
||||
|
||||
[node name="follow_2" type="Sprite" parent="tween/area"]
|
||||
|
||||
position = Vector2( 736, 0 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="timeline" type="HSlider" parent="."]
|
||||
|
||||
margin_left = 40.0
|
||||
margin_top = 224.0
|
||||
margin_right = 760.0
|
||||
margin_bottom = 240.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
min_value = 0.0
|
||||
max_value = 100.0
|
||||
step = 1.0
|
||||
page = 0.0
|
||||
value = 1.0
|
||||
exp_edit = false
|
||||
rounded = false
|
||||
tick_count = 0
|
||||
ticks_on_borders = false
|
||||
focus_mode = 2
|
||||
|
||||
[connection signal="tween_step" from="tween" to="." method="_on_tween_step"]
|
||||
|
||||
[connection signal="value_changed" from="timeline" to="." method="_on_timeline_value_changed"]
|
||||
|
||||
|
||||
17
misc/tween/project.godot
Normal file
@@ -0,0 +1,17 @@
|
||||
config_version=3
|
||||
[application]
|
||||
|
||||
name="Tween Demo"
|
||||
main_scene="res://main.tscn"
|
||||
icon="res://icon.png"
|
||||
target_fps=60
|
||||
|
||||
[display]
|
||||
|
||||
stretch/aspect="keep_width"
|
||||
stretch/mode="2d"
|
||||
window/height=768
|
||||
|
||||
[memory]
|
||||
|
||||
multithread/thread_rid_pool_prealloc=60
|
||||
203
misc/window_management/control.gd
Normal file
@@ -0,0 +1,203 @@
|
||||
extends Control
|
||||
|
||||
# Member variables
|
||||
var mousepos
|
||||
|
||||
onready var observer = $"../Observer"
|
||||
|
||||
func _fixed_process(delta):
|
||||
var modetext = "Mode:\n"
|
||||
|
||||
if (OS.is_window_fullscreen()):
|
||||
modetext += "Fullscreen\n"
|
||||
else:
|
||||
modetext += "Windowed\n"
|
||||
|
||||
if (!OS.is_window_resizable()):
|
||||
modetext += "FixedSize\n"
|
||||
|
||||
if (OS.is_window_minimized()):
|
||||
modetext += "Minimized\n"
|
||||
|
||||
if (OS.is_window_maximized()):
|
||||
modetext += "Maximized\n"
|
||||
|
||||
if (Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):
|
||||
modetext += "MouseGrab\n"
|
||||
$Label_MouseModeCaptured_KeyInfo.show()
|
||||
else:
|
||||
$Label_MouseModeCaptured_KeyInfo.hide()
|
||||
|
||||
$Label_Mode.text = modetext
|
||||
$Label_Position.text = str("Position:\n", OS.get_window_position())
|
||||
$Label_Size.text = str("Size:\n", OS.get_window_size())
|
||||
$Label_MousePosition.text = str("Mouse Position:\n", mousepos)
|
||||
$Label_Screen_Count.text = str("Screen_Count:\n", OS.get_screen_count())
|
||||
$Label_Screen_Current.text = str("Screen:\n", OS.get_current_screen())
|
||||
$Label_Screen0_Resolution.text = str("Screen0 Resolution:\n", OS.get_screen_size())
|
||||
$Label_Screen0_Position.text = str("Screen0 Position:\n", OS.get_screen_position())
|
||||
$Label_Screen0_DPI.text = str("Screen0 DPI:\n", OS.get_screen_dpi())
|
||||
|
||||
if (OS.get_screen_count() > 1):
|
||||
$Button_Screen0.show()
|
||||
$Button_Screen1.show()
|
||||
$Label_Screen1_Resolution.show()
|
||||
$Label_Screen1_Position.show()
|
||||
$Label_Screen1_DPI.show()
|
||||
$Label_Screen1_Resolution.text = str("Screen1 Resolution:\n", OS.get_screen_size(1))
|
||||
$Label_Screen1_Position.text = str("Screen1 Position:\n", OS.get_screen_position(1))
|
||||
$Label_Screen1_DPI.text = str("Screen1 DPI:\n", OS.get_screen_dpi(1))
|
||||
else:
|
||||
$Button_Screen0.hide()
|
||||
$Button_Screen1.hide()
|
||||
$Label_Screen1_Resolution.hide()
|
||||
$Label_Screen1_Position.hide()
|
||||
$Label_Screen1_DPI.hide()
|
||||
|
||||
$Button_Fullscreen.set_pressed(OS.is_window_fullscreen())
|
||||
$Button_FixedSize.set_pressed(!OS.is_window_resizable())
|
||||
$Button_Minimized.set_pressed(OS.is_window_minimized())
|
||||
$Button_Maximized.set_pressed(OS.is_window_maximized())
|
||||
$Button_MouseModeVisible.set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE)
|
||||
$Button_MouseModeHidden.set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_HIDDEN)
|
||||
$Button_MouseModeCaptured.set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
func check_wm_api():
|
||||
var s = ""
|
||||
if (!OS.has_method("get_screen_count")):
|
||||
s += " - get_screen_count()\n"
|
||||
|
||||
if (!OS.has_method("get_current_screen")):
|
||||
s += " - get_current_screen()\n"
|
||||
|
||||
if (!OS.has_method("set_current_screen")):
|
||||
s += " - set_current_screen()\n"
|
||||
|
||||
if (!OS.has_method("get_screen_position")):
|
||||
s += " - get_screen_position()\n"
|
||||
|
||||
if (!OS.has_method("get_screen_size")):
|
||||
s += " - get_screen_size()\n"
|
||||
|
||||
if (!OS.has_method("get_window_position")):
|
||||
s += " - get_window_position()\n"
|
||||
|
||||
if (!OS.has_method("set_window_position")):
|
||||
s += " - set_window_position()\n"
|
||||
|
||||
if (!OS.has_method("get_window_size")):
|
||||
s += " - get_window_size()\n"
|
||||
|
||||
if (!OS.has_method("set_window_size")):
|
||||
s += " - set_window_size()\n"
|
||||
|
||||
if (!OS.has_method("set_window_fullscreen")):
|
||||
s += " - set_window_fullscreen()\n"
|
||||
|
||||
if (!OS.has_method("is_window_fullscreen")):
|
||||
s += " - is_window_fullscreen()\n"
|
||||
|
||||
if (!OS.has_method("set_window_resizable")):
|
||||
s += " - set_window_resizable()\n"
|
||||
|
||||
if (!OS.has_method("is_window_resizable")):
|
||||
s += " - is_window_resizable()\n"
|
||||
|
||||
if (!OS.has_method("set_window_minimized")):
|
||||
s += " - set_window_minimized()\n"
|
||||
|
||||
if (!OS.has_method("is_window_minimized")):
|
||||
s += " - is_window_minimized()\n"
|
||||
|
||||
if (!OS.has_method("set_window_maximized")):
|
||||
s += " - set_window_maximized()\n"
|
||||
|
||||
if (!OS.has_method("is_window_maximized")):
|
||||
s += " - is_window_maximized()\n"
|
||||
|
||||
if (s.length() == 0):
|
||||
return true
|
||||
else:
|
||||
$"ImplementationDialog/Text".text += s
|
||||
$ImplementationDialog.show()
|
||||
return false
|
||||
|
||||
|
||||
func _ready():
|
||||
if (not check_wm_api()):
|
||||
set_fixed_process(false)
|
||||
set_process_input(false)
|
||||
|
||||
|
||||
func _input(event):
|
||||
if (event is InputEventMouseMotion):
|
||||
mousepos = event.position
|
||||
|
||||
if (event is InputEventKey):
|
||||
if Input.is_action_pressed("mouse_mode_visible"):
|
||||
observer.state = observer.STATE_MENU
|
||||
_on_Button_MouseModeVisible_pressed()
|
||||
|
||||
if Input.is_action_pressed("mouse_mode_hidden"):
|
||||
observer.state = observer.STATE_MENU
|
||||
_on_Button_MouseModeHidden_pressed()
|
||||
|
||||
if Input.is_action_pressed("mouse_mode_captured"):
|
||||
_on_Button_MouseModeCaptured_pressed()
|
||||
|
||||
|
||||
func _on_Button_MoveTo_pressed():
|
||||
OS.set_window_position(Vector2(100, 100))
|
||||
|
||||
|
||||
func _on_Button_Resize_pressed():
|
||||
OS.set_window_size(Vector2(1024, 768))
|
||||
|
||||
|
||||
func _on_Button_Screen0_pressed():
|
||||
OS.set_current_screen(0)
|
||||
|
||||
|
||||
func _on_Button_Screen1_pressed():
|
||||
OS.set_current_screen(1)
|
||||
|
||||
|
||||
func _on_Button_Fullscreen_pressed():
|
||||
if (OS.is_window_fullscreen()):
|
||||
OS.set_window_fullscreen(false)
|
||||
else:
|
||||
OS.set_window_fullscreen(true)
|
||||
|
||||
|
||||
func _on_Button_FixedSize_pressed():
|
||||
if (OS.is_window_resizable()):
|
||||
OS.set_window_resizable(false)
|
||||
else:
|
||||
OS.set_window_resizable(true)
|
||||
|
||||
|
||||
func _on_Button_Minimized_pressed():
|
||||
if (OS.is_window_minimized()):
|
||||
OS.set_window_minimized(false)
|
||||
else:
|
||||
OS.set_window_minimized(true)
|
||||
|
||||
|
||||
func _on_Button_Maximized_pressed():
|
||||
if (OS.is_window_maximized()):
|
||||
OS.set_window_maximized(false)
|
||||
else:
|
||||
OS.set_window_maximized(true)
|
||||
|
||||
|
||||
func _on_Button_MouseModeVisible_pressed():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
||||
func _on_Button_MouseModeHidden_pressed():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
|
||||
|
||||
func _on_Button_MouseModeCaptured_pressed():
|
||||
observer.state = observer.STATE_GRAB
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
23
misc/window_management/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
59
misc/window_management/observer/observer.gd
Normal file
@@ -0,0 +1,59 @@
|
||||
extends Spatial
|
||||
|
||||
# Constants
|
||||
const STATE_MENU = 0
|
||||
const STATE_GRAB = 1
|
||||
|
||||
# Member variables
|
||||
var r_pos = Vector2()
|
||||
var state = STATE_MENU
|
||||
|
||||
|
||||
func direction(vector):
|
||||
var v = $Camera.get_global_transform().basis * vector
|
||||
v = v.normalized()
|
||||
return v
|
||||
|
||||
|
||||
func _fixed_process(delta):
|
||||
if (state != STATE_GRAB):
|
||||
return
|
||||
|
||||
if (Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
var dir = Vector3()
|
||||
if (Input.is_action_pressed("move_forward")):
|
||||
dir += direction(Vector3(0, 0, -1))
|
||||
if (Input.is_action_pressed("move_backwards")):
|
||||
dir += direction(Vector3(0, 0, 1))
|
||||
if (Input.is_action_pressed("move_left")):
|
||||
dir += direction(Vector3(-1, 0, 0))
|
||||
if (Input.is_action_pressed("move_right")):
|
||||
dir += direction(Vector3(1, 0, 0))
|
||||
|
||||
dir = dir.normalized()
|
||||
|
||||
move(dir * 10 * delta)
|
||||
var d = delta * 0.1
|
||||
|
||||
var yaw = get_transform().rotated(Vector3(0, 1, 0), d * r_pos.x)
|
||||
set_transform(yaw)
|
||||
|
||||
var pitch = $Camera.get_transform().rotated(Vector3(1, 0, 0), d * r_pos.y)
|
||||
$Camera.set_transform(pitch)
|
||||
|
||||
r_pos = Vector2()
|
||||
|
||||
|
||||
func _input(event):
|
||||
if (event is InputEventMouseMotion):
|
||||
r_pos = event.relative
|
||||
|
||||
if (event.is_action("ui_cancel") and event.is_pressed() and !event.is_echo()):
|
||||
if (state == STATE_GRAB):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
state = STATE_MENU
|
||||
else:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
state = STATE_GRAB
|
||||
@@ -1,22 +1,21 @@
|
||||
[gd_scene load_steps=2 format=1]
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://observer/observer.gd" type="Script" id=1]
|
||||
|
||||
[node name="Observer" type="KinematicBody"]
|
||||
|
||||
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
|
||||
input/ray_pickable = true
|
||||
input/capture_on_drag = false
|
||||
input_ray_pickable = true
|
||||
input_capture_on_drag = false
|
||||
shape_count = 0
|
||||
collision/layers = 1
|
||||
collision/mask = 1
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
collide_with/static = true
|
||||
collide_with/kinematic = true
|
||||
collide_with/rigid = true
|
||||
collide_with/character = true
|
||||
collision/margin = 0.001
|
||||
script/script = ExtResource( 1 )
|
||||
__meta__ = { "__editor_plugin_screen__":"3D" }
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
|
||||
@@ -52,5 +51,3 @@ projector = null
|
||||
operator = 0
|
||||
params/radius = 100.0
|
||||
params/attenuation = 1.0
|
||||
|
||||
|
||||
23
misc/window_management/project.godot
Normal file
@@ -0,0 +1,23 @@
|
||||
[application]
|
||||
|
||||
icon = "res://icon.png"
|
||||
main_scene = "res://window_management.tscn"
|
||||
name = "Window Management"
|
||||
|
||||
[display]
|
||||
|
||||
window/fullscreen = false
|
||||
window/height = 600
|
||||
window/resizable = true
|
||||
window/width = 800
|
||||
|
||||
[input]
|
||||
|
||||
mouse_mode_captured = [ InputEvent(KEY,16777246) ]
|
||||
mouse_mode_hidden = [ InputEvent(KEY,16777245) ]
|
||||
mouse_mode_visible = [ InputEvent(KEY,16777244) ]
|
||||
move_backwards = [ InputEvent(KEY,83) ]
|
||||
move_forward = [ InputEvent(KEY,87) ]
|
||||
move_left = [ InputEvent(KEY,65) ]
|
||||
move_right = [ InputEvent(KEY,68) ]
|
||||
|
||||
549
misc/window_management/window_management.tscn
Normal file
@@ -0,0 +1,549 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://observer/observer.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://control.gd" type="Script" id=2]
|
||||
|
||||
[node name="Spatial" type="Spatial"]
|
||||
|
||||
[node name="Observer" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
transform = Transform( 0.910685, 0, -0.4131, 0, 1, 0, 0.4131, 0, 0.910685, -4.81287, -0.152566, 9.90641 )
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
|
||||
anchor_right = 1
|
||||
anchor_bottom = 1
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Button_Fullscreen" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 20.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 45.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Fullscreen"
|
||||
flat = false
|
||||
|
||||
[node name="Button_FixedSize" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 60.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 85.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "FixedSize"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Minimized" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 100.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 125.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Minimized"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Maximized" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 140.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 165.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Maximized"
|
||||
flat = false
|
||||
|
||||
[node name="Button_MoveTo" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 178.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 203.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "MoveTo"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Resize" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 218.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 243.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Resize"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Screen0" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 258.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 283.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Screen0"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Screen1" type="Button" parent="Control"]
|
||||
|
||||
margin_left = 20.0
|
||||
margin_top = 298.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 323.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Screen1"
|
||||
flat = false
|
||||
|
||||
[node name="Button_MouseModeVisible" type="Button" parent="Control"]
|
||||
|
||||
anchor_top = 1
|
||||
anchor_bottom = 1
|
||||
margin_left = 20.0
|
||||
margin_top = 221.0
|
||||
margin_right = 225.0
|
||||
margin_bottom = 196.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "[F1] MOUSE_MODE_VISIBLE"
|
||||
flat = false
|
||||
align = 0
|
||||
|
||||
[node name="Button_MouseModeHidden" type="Button" parent="Control"]
|
||||
|
||||
anchor_top = 1
|
||||
anchor_bottom = 1
|
||||
margin_left = 20.0
|
||||
margin_top = 186.0
|
||||
margin_right = 225.0
|
||||
margin_bottom = 161.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "[F2] MOUSE_MODE_HIDDEN"
|
||||
flat = false
|
||||
align = 0
|
||||
|
||||
[node name="Button_MouseModeCaptured" type="Button" parent="Control"]
|
||||
|
||||
anchor_top = 1
|
||||
anchor_bottom = 1
|
||||
margin_left = 20.0
|
||||
margin_top = 151.0
|
||||
margin_right = 225.0
|
||||
margin_bottom = 126.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "[F3] MOUSE_MODE_CAPTURED"
|
||||
flat = false
|
||||
align = 0
|
||||
|
||||
[node name="Label_Mode" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 140.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 153.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Mode:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Position" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 60.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 73.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Position:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Size" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 100.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 113.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Size:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_MousePosition" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 220.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 153.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Mouse Position:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen_Count" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 300.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 317.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen_Count:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen_Current" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 20.0
|
||||
margin_right = 20.0
|
||||
margin_bottom = 40.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen0_Resolution" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 340.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 353.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen0 Resolution: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen0_Position" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 380.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 396.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen0 Position: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen0_DPI" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 416.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 432.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen0 DPI:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen1_Resolution" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 451.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 467.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen1 Resolution: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen1_Position" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 489.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 505.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen1 Position: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen1_DPI" type="Label" parent="Control"]
|
||||
|
||||
anchor_left = 1
|
||||
anchor_right = 1
|
||||
margin_left = 140.0
|
||||
margin_top = 524.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 540.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "Screen1 DPI:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_KeyInfo" type="Label" parent="Control"]
|
||||
|
||||
anchor_top = 1
|
||||
anchor_bottom = 1
|
||||
margin_left = 20.0
|
||||
margin_top = 122.0
|
||||
margin_right = 286.0
|
||||
margin_bottom = 63.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "F1: activate MOUSE_MODE_VISIBLE
|
||||
F2: activate MOUSE_MODE_HIDDEN
|
||||
F3: activate MOUSE_MODE_CAPTURED"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_MouseModeCaptured_KeyInfo" type="Label" parent="Control"]
|
||||
|
||||
anchor_top = 1
|
||||
anchor_bottom = 1
|
||||
margin_left = 20.0
|
||||
margin_top = 65.0
|
||||
margin_right = 286.0
|
||||
margin_bottom = 11.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "ESC: deactivate MOUSE_MODE_CAPTURED
|
||||
W, S: move forward, backward
|
||||
A, D: strafe left, right"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_MouseModes" type="Label" parent="Control"]
|
||||
|
||||
anchor_top = 1
|
||||
anchor_bottom = 1
|
||||
margin_left = 20.0
|
||||
margin_top = 249.0
|
||||
margin_right = 286.0
|
||||
margin_bottom = 227.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "MouseModes:"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="ImplementationDialog" type="AcceptDialog" parent="Control"]
|
||||
|
||||
visible = false
|
||||
margin_left = 200.0
|
||||
margin_top = 100.0
|
||||
margin_right = 600.0
|
||||
margin_bottom = 450.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
popup_exclusive = false
|
||||
window_title = "Please be advised..."
|
||||
resizable = false
|
||||
dialog_hide_on_ok = true
|
||||
|
||||
[node name="Text" type="Label" parent="Control/ImplementationDialog"]
|
||||
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 392.0
|
||||
margin_bottom = 314.0
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
text = "This is an Implementation-Test-Demo
|
||||
|
||||
It is used to help implementing a new window handling api
|
||||
across platforms.
|
||||
|
||||
Your platform lacks at the moment the following methods:
|
||||
"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Fullscreen" to="Control" method="_on_Button_Fullscreen_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_FixedSize" to="Control" method="_on_Button_FixedSize_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Minimized" to="Control" method="_on_Button_Minimized_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Maximized" to="Control" method="_on_Button_Maximized_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MoveTo" to="Control" method="_on_Button_MoveTo_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Resize" to="Control" method="_on_Button_Resize_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Screen0" to="Control" method="_on_Button_Screen0_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Screen1" to="Control" method="_on_Button_Screen1_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MouseModeVisible" to="Control" method="_on_Button_MouseModeVisible_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MouseModeHidden" to="Control" method="_on_Button_MouseModeHidden_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MouseModeCaptured" to="Control" method="_on_Button_MouseModeCaptured_pressed"]
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
[android]
|
||||
|
||||
modules="org/godotengine/godot/GodotPaymentV3"
|
||||
|
||||
[application]
|
||||
|
||||
name="Android IAP"
|
||||
main_scene="res://main.tscn"
|
||||
icon="res://icon.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
iap="*res://iap.gd"
|
||||
@@ -1,283 +0,0 @@
|
||||
[convert_images]
|
||||
|
||||
action="none"
|
||||
compress_quality=0.7
|
||||
formats="png"
|
||||
shrink=1.0
|
||||
|
||||
[convert_samples]
|
||||
|
||||
action="none"
|
||||
max_hz=44100
|
||||
trim=false
|
||||
|
||||
[convert_scenes]
|
||||
|
||||
convert_text_scenes=true
|
||||
|
||||
[export_filter]
|
||||
|
||||
filter=""
|
||||
filter_exclude=""
|
||||
type="resources"
|
||||
|
||||
[platform:Android]
|
||||
|
||||
apk_expansion/SALT=""
|
||||
apk_expansion/enable=false
|
||||
apk_expansion/public_key=""
|
||||
architecture/arm=true
|
||||
architecture/x86=false
|
||||
command_line/extra_args=""
|
||||
custom_package/debug=""
|
||||
custom_package/release=""
|
||||
debug/debugging_enabled=true
|
||||
keystore/release=""
|
||||
keystore/release_password=""
|
||||
keystore/release_user=""
|
||||
one_click_deploy/clear_previous_install=true
|
||||
package/icon=""
|
||||
package/name=""
|
||||
package/signed=true
|
||||
package/unique_name="org.godotengine.$genname"
|
||||
permissions/access_checkin_properties=false
|
||||
permissions/access_coarse_location=false
|
||||
permissions/access_fine_location=false
|
||||
permissions/access_location_extra_commands=false
|
||||
permissions/access_mock_location=false
|
||||
permissions/access_network_state=false
|
||||
permissions/access_surface_flinger=false
|
||||
permissions/access_wifi_state=false
|
||||
permissions/account_manager=false
|
||||
permissions/add_voicemail=false
|
||||
permissions/authenticate_accounts=false
|
||||
permissions/battery_stats=false
|
||||
permissions/bind_accessibility_service=false
|
||||
permissions/bind_appwidget=false
|
||||
permissions/bind_device_admin=false
|
||||
permissions/bind_input_method=false
|
||||
permissions/bind_nfc_service=false
|
||||
permissions/bind_notification_listener_service=false
|
||||
permissions/bind_print_service=false
|
||||
permissions/bind_remoteviews=false
|
||||
permissions/bind_text_service=false
|
||||
permissions/bind_vpn_service=false
|
||||
permissions/bind_wallpaper=false
|
||||
permissions/bluetooth=false
|
||||
permissions/bluetooth_admin=false
|
||||
permissions/bluetooth_privileged=false
|
||||
permissions/brick=false
|
||||
permissions/broadcast_package_removed=false
|
||||
permissions/broadcast_sms=false
|
||||
permissions/broadcast_sticky=false
|
||||
permissions/broadcast_wap_push=false
|
||||
permissions/call_phone=false
|
||||
permissions/call_privileged=false
|
||||
permissions/camera=false
|
||||
permissions/capture_audio_output=false
|
||||
permissions/capture_secure_video_output=false
|
||||
permissions/capture_video_output=false
|
||||
permissions/change_component_enabled_state=false
|
||||
permissions/change_configuration=false
|
||||
permissions/change_network_state=false
|
||||
permissions/change_wifi_multicast_state=false
|
||||
permissions/change_wifi_state=false
|
||||
permissions/clear_app_cache=false
|
||||
permissions/clear_app_user_data=false
|
||||
permissions/control_location_updates=false
|
||||
permissions/delete_cache_files=false
|
||||
permissions/delete_packages=false
|
||||
permissions/device_power=false
|
||||
permissions/diagnostic=false
|
||||
permissions/disable_keyguard=false
|
||||
permissions/dump=false
|
||||
permissions/expand_status_bar=false
|
||||
permissions/factory_test=false
|
||||
permissions/flashlight=false
|
||||
permissions/force_back=false
|
||||
permissions/get_accounts=false
|
||||
permissions/get_package_size=false
|
||||
permissions/get_tasks=false
|
||||
permissions/get_top_activity_info=false
|
||||
permissions/global_search=false
|
||||
permissions/hardware_test=false
|
||||
permissions/inject_events=false
|
||||
permissions/install_location_provider=false
|
||||
permissions/install_packages=false
|
||||
permissions/install_shortcut=false
|
||||
permissions/internal_system_window=false
|
||||
permissions/internet=false
|
||||
permissions/kill_background_processes=false
|
||||
permissions/location_hardware=false
|
||||
permissions/manage_accounts=false
|
||||
permissions/manage_app_tokens=false
|
||||
permissions/manage_documents=false
|
||||
permissions/master_clear=false
|
||||
permissions/media_content_control=false
|
||||
permissions/modify_audio_settings=false
|
||||
permissions/modify_phone_state=false
|
||||
permissions/mount_format_filesystems=false
|
||||
permissions/mount_unmount_filesystems=false
|
||||
permissions/nfc=false
|
||||
permissions/persistent_activity=false
|
||||
permissions/process_outgoing_calls=false
|
||||
permissions/read_calendar=false
|
||||
permissions/read_call_log=false
|
||||
permissions/read_contacts=false
|
||||
permissions/read_external_storage=false
|
||||
permissions/read_frame_buffer=false
|
||||
permissions/read_history_bookmarks=false
|
||||
permissions/read_input_state=false
|
||||
permissions/read_logs=false
|
||||
permissions/read_phone_state=false
|
||||
permissions/read_profile=false
|
||||
permissions/read_sms=false
|
||||
permissions/read_social_stream=false
|
||||
permissions/read_sync_settings=false
|
||||
permissions/read_sync_stats=false
|
||||
permissions/read_user_dictionary=false
|
||||
permissions/reboot=false
|
||||
permissions/receive_boot_completed=false
|
||||
permissions/receive_mms=false
|
||||
permissions/receive_sms=false
|
||||
permissions/receive_wap_push=false
|
||||
permissions/record_audio=false
|
||||
permissions/reorder_tasks=false
|
||||
permissions/restart_packages=false
|
||||
permissions/send_respond_via_message=false
|
||||
permissions/send_sms=false
|
||||
permissions/set_activity_watcher=false
|
||||
permissions/set_alarm=false
|
||||
permissions/set_always_finish=false
|
||||
permissions/set_animation_scale=false
|
||||
permissions/set_debug_app=false
|
||||
permissions/set_orientation=false
|
||||
permissions/set_pointer_speed=false
|
||||
permissions/set_preferred_applications=false
|
||||
permissions/set_process_limit=false
|
||||
permissions/set_time=false
|
||||
permissions/set_time_zone=false
|
||||
permissions/set_wallpaper=false
|
||||
permissions/set_wallpaper_hints=false
|
||||
permissions/signal_persistent_processes=false
|
||||
permissions/status_bar=false
|
||||
permissions/subscribed_feeds_read=false
|
||||
permissions/subscribed_feeds_write=false
|
||||
permissions/system_alert_window=false
|
||||
permissions/transmit_ir=false
|
||||
permissions/uninstall_shortcut=false
|
||||
permissions/update_device_stats=false
|
||||
permissions/use_credentials=false
|
||||
permissions/use_sip=false
|
||||
permissions/vibrate=false
|
||||
permissions/wake_lock=false
|
||||
permissions/write_apn_settings=false
|
||||
permissions/write_calendar=false
|
||||
permissions/write_call_log=false
|
||||
permissions/write_contacts=false
|
||||
permissions/write_external_storage=false
|
||||
permissions/write_gservices=false
|
||||
permissions/write_history_bookmarks=false
|
||||
permissions/write_profile=false
|
||||
permissions/write_secure_settings=false
|
||||
permissions/write_settings=false
|
||||
permissions/write_sms=false
|
||||
permissions/write_social_stream=false
|
||||
permissions/write_sync_settings=false
|
||||
permissions/write_user_dictionary=false
|
||||
screen/immersive_mode=true
|
||||
screen/orientation=0
|
||||
screen/support_large=true
|
||||
screen/support_normal=true
|
||||
screen/support_small=true
|
||||
screen/support_xlarge=true
|
||||
screen/use_32_bits_view=true
|
||||
user_permissions/0="com.android.vending.BILLING"
|
||||
user_permissions/1=""
|
||||
user_permissions/10=""
|
||||
user_permissions/11=""
|
||||
user_permissions/12=""
|
||||
user_permissions/13=""
|
||||
user_permissions/14=""
|
||||
user_permissions/15=""
|
||||
user_permissions/16=""
|
||||
user_permissions/17=""
|
||||
user_permissions/18=""
|
||||
user_permissions/19=""
|
||||
user_permissions/2=""
|
||||
user_permissions/3=""
|
||||
user_permissions/4=""
|
||||
user_permissions/5=""
|
||||
user_permissions/6=""
|
||||
user_permissions/7=""
|
||||
user_permissions/8=""
|
||||
user_permissions/9=""
|
||||
version/code=1
|
||||
version/name="1.0"
|
||||
|
||||
[platform:BlackBerry 10]
|
||||
|
||||
debug/debugging_enabled=true
|
||||
package/category="core.games"
|
||||
package/custom_template=""
|
||||
package/description="Game made with Godot Engine"
|
||||
package/icon=""
|
||||
package/name=""
|
||||
package/unique_name="com.godot.noname"
|
||||
release/author="Cert. Name"
|
||||
release/author_id="Cert. ID"
|
||||
version/code=1
|
||||
version/name="1.0"
|
||||
|
||||
[platform:HTML5]
|
||||
|
||||
browser/enable_run=false
|
||||
custom_package/debug=""
|
||||
custom_package/release=""
|
||||
debug/debugging_enabled=true
|
||||
html/controls_enabled=true
|
||||
html/font_family="arial,sans-serif"
|
||||
html/head_include=""
|
||||
html/style_include=""
|
||||
html/title=""
|
||||
options/memory_size=3
|
||||
|
||||
[platform:Linux X11]
|
||||
|
||||
binary/64_bits=true
|
||||
custom_binary/debug=""
|
||||
custom_binary/release=""
|
||||
debug/debugging_enabled=true
|
||||
resources/bundle_dependencies_(for_optical_disc)=false
|
||||
resources/pack_mode=1
|
||||
|
||||
[platform:Mac OSX]
|
||||
|
||||
application/64_bits=false
|
||||
application/copyright=""
|
||||
application/fat_bits=false
|
||||
application/icon=""
|
||||
application/identifier="com.godot.macgame"
|
||||
application/info="This Game is Nice"
|
||||
application/name=""
|
||||
application/short_version="1.0"
|
||||
application/signature="godotmacgame"
|
||||
application/version="1.0"
|
||||
custom_package/debug=""
|
||||
custom_package/release=""
|
||||
debug/debugging_enabled=true
|
||||
display/high_res=false
|
||||
|
||||
[platform:Windows Desktop]
|
||||
|
||||
binary/64_bits=true
|
||||
custom_binary/debug=""
|
||||
custom_binary/release=""
|
||||
debug/debugging_enabled=true
|
||||
resources/bundle_dependencies_(for_optical_disc)=false
|
||||
resources/pack_mode=1
|
||||
|
||||
[script]
|
||||
|
||||
action="compile"
|
||||
encrypt_key=""
|
||||
@@ -1 +0,0 @@
|
||||
gen_mipmaps=false
|
||||
@@ -1,113 +0,0 @@
|
||||
[gd_scene load_steps=2 format=1]
|
||||
|
||||
[ext_resource path="res://iap_demo.gd" type="Script" id=1]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
|
||||
anchor/right = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 0.0
|
||||
margin/top = 0.0
|
||||
margin/right = 0.0
|
||||
margin/bottom = 0.0
|
||||
script/script = ExtResource( 1 )
|
||||
|
||||
[node name="purchase" type="Button" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 40.0
|
||||
margin/top = 40.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 120.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Purchase in app"
|
||||
flat = false
|
||||
|
||||
[node name="consume" type="Button" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 40.0
|
||||
margin/top = 150.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 230.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Consume in app"
|
||||
flat = false
|
||||
|
||||
[node name="request" type="Button" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 40.0
|
||||
margin/top = 260.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 340.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Request purchased"
|
||||
flat = false
|
||||
|
||||
[node name="query" type="Button" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 40.0
|
||||
margin/top = 370.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 450.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Query in app items"
|
||||
flat = false
|
||||
|
||||
[node name="alert" type="AcceptDialog" parent="."]
|
||||
|
||||
visibility/visible = false
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 290.0
|
||||
margin/top = 60.0
|
||||
margin/right = 700.0
|
||||
margin/bottom = 290.0
|
||||
popup/exclusive = false
|
||||
window/title = "Alert!"
|
||||
dialog/hide_on_ok = true
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 300.0
|
||||
margin/top = 40.0
|
||||
margin/right = 932.0
|
||||
margin/bottom = 207.0
|
||||
text = "\"iap\" is located in Autoloads. See Scene > Project Settings > AutoLoad\n\nTo enable IAP module\n\n1. Scene > Project Settings\n2. write [Category : android] / [Property : modules] / [Type : String] and click Add\n3. Click \"Android\" on left panel\n4. double click on right filed of \"modules\"\n5. write \"org/godotengine/godot/GodotPaymentV3\"\n\nTo test in-app purchase on android device,\n\n1. Need to add \"com.android.vending.BILLING\" permission at Export > Android > User Permissions\n2. Export APK and upload it as alpha or beta stage to Google Play Developer Console and publish it.\n (It\'s not published to public, but you and tester can access it.)\n3. There should be activated in-app item\n4. Any changes on Developer console will take 2~3 hours to take effect"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Loading in a Thread"
|
||||
main_scene="res://thread.scn"
|
||||
@@ -1,11 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Tween Demo"
|
||||
main_scene="res://main.scn"
|
||||
icon="res://icon.png"
|
||||
target_fps=60
|
||||
|
||||
[display]
|
||||
|
||||
stretch_mode="2d"
|
||||
stretch_aspect="keep_width"
|
||||
@@ -1,212 +0,0 @@
|
||||
extends Control
|
||||
|
||||
# Member variables
|
||||
var mousepos
|
||||
|
||||
onready var observer = get_node("../Observer")
|
||||
|
||||
func _fixed_process(delta):
|
||||
var modetext = "Mode:\n"
|
||||
|
||||
if(OS.is_window_fullscreen()):
|
||||
modetext += "Fullscreen\n"
|
||||
else:
|
||||
modetext += "Windowed\n"
|
||||
|
||||
if(!OS.is_window_resizable()):
|
||||
modetext += "FixedSize\n"
|
||||
|
||||
if(OS.is_window_minimized()):
|
||||
modetext += "Minimized\n"
|
||||
|
||||
if(OS.is_window_maximized()):
|
||||
modetext += "Maximized\n"
|
||||
|
||||
if(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):
|
||||
modetext += "MouseGrab\n"
|
||||
get_node("Label_MouseModeCaptured_KeyInfo").show()
|
||||
else:
|
||||
get_node("Label_MouseModeCaptured_KeyInfo").hide()
|
||||
|
||||
get_node("Label_Mode").set_text(modetext)
|
||||
|
||||
get_node("Label_Position").set_text(str("Position:\n", OS.get_window_position()))
|
||||
|
||||
get_node("Label_Size").set_text(str("Size:\n", OS.get_window_size()))
|
||||
|
||||
get_node("Label_MousePosition").set_text(str("Mouse Position:\n", mousepos))
|
||||
|
||||
get_node("Label_Screen_Count").set_text(str("Screen_Count:\n", OS.get_screen_count()))
|
||||
|
||||
get_node("Label_Screen_Current").set_text(str("Screen:\n", OS.get_current_screen()))
|
||||
|
||||
get_node("Label_Screen0_Resolution").set_text(str("Screen0 Resolution:\n", OS.get_screen_size()))
|
||||
|
||||
get_node("Label_Screen0_Position").set_text(str("Screen0 Position:\n", OS.get_screen_position()))
|
||||
|
||||
get_node("Label_Screen0_DPI").set_text(str("Screen0 DPI:\n", OS.get_screen_dpi()))
|
||||
|
||||
if(OS.get_screen_count() > 1):
|
||||
get_node("Button_Screen0").show()
|
||||
get_node("Button_Screen1").show()
|
||||
get_node("Label_Screen1_Resolution").show()
|
||||
get_node("Label_Screen1_Position").show()
|
||||
get_node("Label_Screen1_DPI").show()
|
||||
get_node("Label_Screen1_Resolution").set_text(str("Screen1 Resolution:\n", OS.get_screen_size(1)))
|
||||
get_node("Label_Screen1_Position").set_text(str("Screen1 Position:\n", OS.get_screen_position(1)))
|
||||
get_node("Label_Screen1_DPI").set_text(str("Screen1 DPI:\n", OS.get_screen_dpi(1)))
|
||||
else:
|
||||
get_node("Button_Screen0").hide()
|
||||
get_node("Button_Screen1").hide()
|
||||
get_node("Label_Screen1_Resolution").hide()
|
||||
get_node("Label_Screen1_Position").hide()
|
||||
get_node("Label_Screen1_DPI").hide()
|
||||
|
||||
get_node("Button_Fullscreen").set_pressed(OS.is_window_fullscreen())
|
||||
get_node("Button_FixedSize").set_pressed(!OS.is_window_resizable())
|
||||
get_node("Button_Minimized").set_pressed(OS.is_window_minimized())
|
||||
get_node("Button_Maximized").set_pressed(OS.is_window_maximized())
|
||||
get_node("Button_MouseModeVisible").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE)
|
||||
get_node("Button_MouseModeHidden").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_HIDDEN)
|
||||
get_node("Button_MouseModeCaptured").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
func check_wm_api():
|
||||
var s = ""
|
||||
if(!OS.has_method("get_screen_count")):
|
||||
s += " - get_screen_count()\n"
|
||||
|
||||
if(!OS.has_method("get_current_screen")):
|
||||
s += " - get_current_screen()\n"
|
||||
|
||||
if(!OS.has_method("set_current_screen")):
|
||||
s += " - set_current_screen()\n"
|
||||
|
||||
if(!OS.has_method("get_screen_position")):
|
||||
s += " - get_screen_position()\n"
|
||||
|
||||
if(!OS.has_method("get_screen_size")):
|
||||
s += " - get_screen_size()\n"
|
||||
|
||||
if(!OS.has_method("get_window_position")):
|
||||
s += " - get_window_position()\n"
|
||||
|
||||
if(!OS.has_method("set_window_position")):
|
||||
s += " - set_window_position()\n"
|
||||
|
||||
if(!OS.has_method("get_window_size")):
|
||||
s += " - get_window_size()\n"
|
||||
|
||||
if(!OS.has_method("set_window_size")):
|
||||
s += " - set_window_size()\n"
|
||||
|
||||
if(!OS.has_method("set_window_fullscreen")):
|
||||
s += " - set_window_fullscreen()\n"
|
||||
|
||||
if(!OS.has_method("is_window_fullscreen")):
|
||||
s += " - is_window_fullscreen()\n"
|
||||
|
||||
if(!OS.has_method("set_window_resizable")):
|
||||
s += " - set_window_resizable()\n"
|
||||
|
||||
if(!OS.has_method("is_window_resizable")):
|
||||
s += " - is_window_resizable()\n"
|
||||
|
||||
if(!OS.has_method("set_window_minimized")):
|
||||
s += " - set_window_minimized()\n"
|
||||
|
||||
if(!OS.has_method("is_window_minimized")):
|
||||
s += " - is_window_minimized()\n"
|
||||
|
||||
if(!OS.has_method("set_window_maximized")):
|
||||
s += " - set_window_maximized()\n"
|
||||
|
||||
if(!OS.has_method("is_window_maximized")):
|
||||
s += " - is_window_maximized()\n"
|
||||
|
||||
if(s.length() == 0):
|
||||
return true
|
||||
else:
|
||||
var text = get_node("ImplementationDialog/Text").get_text()
|
||||
get_node("ImplementationDialog/Text").set_text(text + s)
|
||||
get_node("ImplementationDialog").show()
|
||||
return false
|
||||
|
||||
|
||||
func _ready():
|
||||
if(check_wm_api()):
|
||||
set_fixed_process(true)
|
||||
set_process_input(true)
|
||||
|
||||
|
||||
func _input(event):
|
||||
if (event.type == InputEvent.MOUSE_MOTION):
|
||||
mousepos = event.pos
|
||||
|
||||
if (event.type == InputEvent.KEY):
|
||||
if Input.is_action_pressed("mouse_mode_visible"):
|
||||
observer.state = observer.STATE_MENU
|
||||
_on_Button_MouseModeVisible_pressed()
|
||||
|
||||
if Input.is_action_pressed("mouse_mode_hidden"):
|
||||
observer.state = observer.STATE_MENU
|
||||
_on_Button_MouseModeHidden_pressed()
|
||||
|
||||
if Input.is_action_pressed("mouse_mode_captured"):
|
||||
_on_Button_MouseModeCaptured_pressed()
|
||||
|
||||
|
||||
func _on_Button_MoveTo_pressed():
|
||||
OS.set_window_position(Vector2(100, 100))
|
||||
|
||||
|
||||
func _on_Button_Resize_pressed():
|
||||
OS.set_window_size(Vector2(1024, 768))
|
||||
|
||||
|
||||
func _on_Button_Screen0_pressed():
|
||||
OS.set_current_screen(0)
|
||||
|
||||
|
||||
func _on_Button_Screen1_pressed():
|
||||
OS.set_current_screen(1)
|
||||
|
||||
|
||||
func _on_Button_Fullscreen_pressed():
|
||||
if(OS.is_window_fullscreen()):
|
||||
OS.set_window_fullscreen(false)
|
||||
else:
|
||||
OS.set_window_fullscreen(true)
|
||||
|
||||
|
||||
func _on_Button_FixedSize_pressed():
|
||||
if(OS.is_window_resizable()):
|
||||
OS.set_window_resizable(false)
|
||||
else:
|
||||
OS.set_window_resizable(true)
|
||||
|
||||
|
||||
func _on_Button_Minimized_pressed():
|
||||
if(OS.is_window_minimized()):
|
||||
OS.set_window_minimized(false)
|
||||
else:
|
||||
OS.set_window_minimized(true)
|
||||
|
||||
|
||||
func _on_Button_Maximized_pressed():
|
||||
if(OS.is_window_maximized()):
|
||||
OS.set_window_maximized(false)
|
||||
else:
|
||||
OS.set_window_maximized(true)
|
||||
|
||||
|
||||
func _on_Button_MouseModeVisible_pressed():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
||||
func _on_Button_MouseModeHidden_pressed():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
|
||||
|
||||
func _on_Button_MouseModeCaptured_pressed():
|
||||
observer.state = observer.STATE_GRAB
|
||||
@@ -1,22 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Window Management"
|
||||
main_scene="res://window_management.tscn"
|
||||
icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
fullscreen=false
|
||||
resizable=true
|
||||
width=800
|
||||
height=600
|
||||
|
||||
[input]
|
||||
|
||||
mouse_mode_visible=[key(F1)]
|
||||
mouse_mode_hidden=[key(F2)]
|
||||
mouse_mode_captured=[key(F3)]
|
||||
move_forward=[key(W)]
|
||||
move_backwards=[key(S)]
|
||||
move_left=[key(A)]
|
||||
move_right=[key(D)]
|
||||
@@ -1,79 +0,0 @@
|
||||
|
||||
extends Spatial
|
||||
|
||||
# Member variables
|
||||
var r_pos = Vector2()
|
||||
var state
|
||||
|
||||
const STATE_MENU = 0
|
||||
const STATE_GRAB = 1
|
||||
|
||||
|
||||
func direction(vector):
|
||||
var v = get_node("Camera").get_global_transform().basis*vector
|
||||
v = v.normalized()
|
||||
return v
|
||||
|
||||
|
||||
func impulse(event, action):
|
||||
if(event.is_action(action) && event.is_pressed() && !event.is_echo()):
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
|
||||
func _fixed_process(delta):
|
||||
if(state != STATE_GRAB):
|
||||
return
|
||||
|
||||
if(Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
var dir = Vector3()
|
||||
var cam = get_global_transform()
|
||||
var org = get_translation()
|
||||
|
||||
if (Input.is_action_pressed("move_forward")):
|
||||
dir += direction(Vector3(0, 0, -1))
|
||||
if (Input.is_action_pressed("move_backwards")):
|
||||
dir += direction(Vector3(0, 0, 1))
|
||||
if (Input.is_action_pressed("move_left")):
|
||||
dir += direction(Vector3(-1, 0, 0))
|
||||
if (Input.is_action_pressed("move_right")):
|
||||
dir += direction(Vector3(1, 0, 0))
|
||||
|
||||
dir = dir.normalized()
|
||||
|
||||
move(dir*10*delta)
|
||||
var d = delta*0.1
|
||||
|
||||
var yaw = get_transform().rotated(Vector3(0, 1, 0), d*r_pos.x)
|
||||
set_transform(yaw)
|
||||
|
||||
var cam = get_node("Camera")
|
||||
var pitch = cam.get_transform().rotated(Vector3(1, 0, 0), d*r_pos.y)
|
||||
cam.set_transform(pitch)
|
||||
|
||||
r_pos.x = 0.0
|
||||
r_pos.y = 0.0
|
||||
|
||||
|
||||
func _input(event):
|
||||
if(event.type == InputEvent.MOUSE_MOTION):
|
||||
r_pos = event.relative_pos
|
||||
|
||||
|
||||
if(impulse(event, "ui_cancel")):
|
||||
if(state == STATE_GRAB):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
state = STATE_MENU
|
||||
else:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
state = STATE_GRAB
|
||||
|
||||
|
||||
func _ready():
|
||||
set_fixed_process(true)
|
||||
set_process_input(true)
|
||||
|
||||
state = STATE_MENU
|
||||
@@ -1,551 +0,0 @@
|
||||
[gd_scene load_steps=3 format=1]
|
||||
|
||||
[ext_resource path="res://observer/observer.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://control.gd" type="Script" id=2]
|
||||
|
||||
[node name="Spatial" type="Spatial"]
|
||||
|
||||
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
|
||||
|
||||
[node name="Observer" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
transform/local = Transform( 0.910685, 0, -0.4131, 0, 1, 0, 0.4131, 0, 0.910685, -4.81287, -0.152566, 9.90641 )
|
||||
|
||||
[node name="TestCube" type="TestCube" parent="."]
|
||||
|
||||
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
|
||||
layers = 1
|
||||
geometry/visible = true
|
||||
geometry/material_override = null
|
||||
geometry/cast_shadow = 1
|
||||
geometry/receive_shadows = true
|
||||
geometry/range_begin = 0.0
|
||||
geometry/range_end = 0.0
|
||||
geometry/extra_cull_margin = 0.0
|
||||
geometry/billboard = false
|
||||
geometry/billboard_y = false
|
||||
geometry/depth_scale = false
|
||||
geometry/visible_in_all_rooms = false
|
||||
geometry/use_baked_light = false
|
||||
geometry/baked_light_tex_id = 0
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
|
||||
anchor/right = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 0.0
|
||||
margin/top = 0.0
|
||||
margin/right = 0.0
|
||||
margin/bottom = 0.0
|
||||
script/script = ExtResource( 2 )
|
||||
|
||||
[node name="Button_Fullscreen" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 20.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 45.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Fullscreen"
|
||||
flat = false
|
||||
|
||||
[node name="Button_FixedSize" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 60.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 85.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "FixedSize"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Minimized" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 100.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 125.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Minimized"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Maximized" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 140.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 165.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Maximized"
|
||||
flat = false
|
||||
|
||||
[node name="Button_MoveTo" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 178.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 203.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "MoveTo"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Resize" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 218.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 243.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Resize"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Screen0" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 258.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 283.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Screen0"
|
||||
flat = false
|
||||
|
||||
[node name="Button_Screen1" type="Button" parent="Control"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 298.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 323.0
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Screen1"
|
||||
flat = false
|
||||
|
||||
[node name="Button_MouseModeVisible" type="Button" parent="Control"]
|
||||
|
||||
anchor/top = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 221.0
|
||||
margin/right = 225.0
|
||||
margin/bottom = 196.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "[F1] MOUSE_MODE_VISIBLE"
|
||||
flat = false
|
||||
align = 0
|
||||
|
||||
[node name="Button_MouseModeHidden" type="Button" parent="Control"]
|
||||
|
||||
anchor/top = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 186.0
|
||||
margin/right = 225.0
|
||||
margin/bottom = 161.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "[F2] MOUSE_MODE_HIDDEN"
|
||||
flat = false
|
||||
align = 0
|
||||
|
||||
[node name="Button_MouseModeCaptured" type="Button" parent="Control"]
|
||||
|
||||
anchor/top = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 151.0
|
||||
margin/right = 225.0
|
||||
margin/bottom = 126.0
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "[F3] MOUSE_MODE_CAPTURED"
|
||||
flat = false
|
||||
align = 0
|
||||
|
||||
[node name="Label_Mode" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 140.0
|
||||
margin/right = 20.0
|
||||
margin/bottom = 153.0
|
||||
text = "Mode:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Position" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 60.0
|
||||
margin/right = 20.0
|
||||
margin/bottom = 73.0
|
||||
text = "Position:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Size" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 100.0
|
||||
margin/right = 20.0
|
||||
margin/bottom = 113.0
|
||||
text = "Size:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_MousePosition" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 220.0
|
||||
margin/right = 20.0
|
||||
margin/bottom = 153.0
|
||||
text = "Mouse Position:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen_Count" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 300.0
|
||||
margin/right = 20.0
|
||||
margin/bottom = 317.0
|
||||
text = "Screen_Count:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen_Current" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 20.0
|
||||
margin/right = 20.0
|
||||
margin/bottom = 40.0
|
||||
text = "Screen:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen0_Resolution" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 340.0
|
||||
margin/right = 16.0
|
||||
margin/bottom = 353.0
|
||||
text = "Screen0 Resolution: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen0_Position" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 380.0
|
||||
margin/right = 16.0
|
||||
margin/bottom = 396.0
|
||||
text = "Screen0 Position: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen0_DPI" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 416.0
|
||||
margin/right = 16.0
|
||||
margin/bottom = 432.0
|
||||
text = "Screen0 DPI:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen1_Resolution" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 451.0
|
||||
margin/right = 16.0
|
||||
margin/bottom = 467.0
|
||||
text = "Screen1 Resolution: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen1_Position" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 489.0
|
||||
margin/right = 16.0
|
||||
margin/bottom = 505.0
|
||||
text = "Screen1 Position: "
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Screen1_DPI" type="Label" parent="Control"]
|
||||
|
||||
anchor/left = 1
|
||||
anchor/right = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 140.0
|
||||
margin/top = 524.0
|
||||
margin/right = 16.0
|
||||
margin/bottom = 540.0
|
||||
text = "Screen1 DPI:"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_KeyInfo" type="Label" parent="Control"]
|
||||
|
||||
anchor/top = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 20.0
|
||||
margin/top = 122.0
|
||||
margin/right = 286.0
|
||||
margin/bottom = 63.0
|
||||
text = "F1: activate MOUSE_MODE_VISIBLE\nF2: activate MOUSE_MODE_HIDDEN\nF3: activate MOUSE_MODE_CAPTURED"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_MouseModeCaptured_KeyInfo" type="Label" parent="Control"]
|
||||
|
||||
anchor/top = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 20.0
|
||||
margin/top = 65.0
|
||||
margin/right = 286.0
|
||||
margin/bottom = 11.0
|
||||
text = "ESC: deactivate MOUSE_MODE_CAPTURED\nW, S: move forward, backward\nA, D: strafe left, right"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_MouseModes" type="Label" parent="Control"]
|
||||
|
||||
anchor/top = 1
|
||||
anchor/bottom = 1
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 20.0
|
||||
margin/top = 249.0
|
||||
margin/right = 286.0
|
||||
margin/bottom = 227.0
|
||||
text = "MouseModes:"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="ImplementationDialog" type="AcceptDialog" parent="Control"]
|
||||
|
||||
visibility/visible = false
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 200.0
|
||||
margin/top = 100.0
|
||||
margin/right = 600.0
|
||||
margin/bottom = 450.0
|
||||
popup/exclusive = false
|
||||
window/title = "Please be advised..."
|
||||
dialog/hide_on_ok = true
|
||||
|
||||
[node name="Text" type="Label" parent="Control/ImplementationDialog"]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 16.0
|
||||
margin/top = 20.0
|
||||
margin/right = 378.0
|
||||
margin/bottom = 298.0
|
||||
text = "This is an Implementation-Test-Demo\n\nIt is used to help implementing a new window handling api\nacross platforms.\n\nYour platform lacks at the moment the following methods:\n"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Fullscreen" to="Control" method="_on_Button_Fullscreen_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_FixedSize" to="Control" method="_on_Button_FixedSize_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Minimized" to="Control" method="_on_Button_Minimized_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Maximized" to="Control" method="_on_Button_Maximized_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MoveTo" to="Control" method="_on_Button_MoveTo_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Resize" to="Control" method="_on_Button_Resize_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Screen0" to="Control" method="_on_Button_Screen0_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_Screen1" to="Control" method="_on_Button_Screen1_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MouseModeVisible" to="Control" method="_on_Button_MouseModeVisible_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MouseModeHidden" to="Control" method="_on_Button_MouseModeHidden_pressed"]
|
||||
|
||||
[connection signal="pressed" from="Control/Button_MouseModeCaptured" to="Control" method="_on_Button_MouseModeCaptured_pressed"]
|
||||
|
||||
|
||||