begun porting demos, platformer is working (mostly)
@@ -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,124 +0,0 @@
|
||||
|
||||
extends Node
|
||||
|
||||
signal purchase_success(item_name)
|
||||
signal purchase_fail
|
||||
signal purchase_cancel
|
||||
signal purchase_owned(item_name)
|
||||
|
||||
signal has_purchased(item_name)
|
||||
|
||||
signal consume_success(item_name)
|
||||
signal consume_fail
|
||||
signal consume_not_required
|
||||
|
||||
signal sku_details_complete
|
||||
signal sku_details_error
|
||||
|
||||
onready var payment = Globals.get_singleton("GodotPayments")
|
||||
|
||||
func _ready():
|
||||
if payment:
|
||||
# set callback with this script instance
|
||||
payment.setPurchaseCallbackId(get_instance_ID())
|
||||
|
||||
# set consume purchased item automatically after purchase, defulat value is true
|
||||
func set_auto_consume(auto):
|
||||
if payment:
|
||||
payment.setAutoConsume(auto)
|
||||
|
||||
|
||||
# request user owned item, callback : has_purchased
|
||||
func request_purchased():
|
||||
if payment:
|
||||
payment.requestPurchased()
|
||||
|
||||
func has_purchased(receipt, signature, sku):
|
||||
if sku == "":
|
||||
print("has_purchased : nothing")
|
||||
emit_signal("has_purchased", null)
|
||||
else:
|
||||
print("has_purchased : ", sku)
|
||||
emit_signal("has_purchased", sku)
|
||||
|
||||
|
||||
# purchase item
|
||||
# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned
|
||||
func purchase(item_name):
|
||||
if payment:
|
||||
# transaction_id could be any string that used for validation internally in java
|
||||
payment.purchase(item_name, "transaction_id")
|
||||
|
||||
func purchase_success(receipt, signature, sku):
|
||||
print("purchase_success : ", sku)
|
||||
emit_signal("purchase_success", sku)
|
||||
|
||||
func purchase_fail():
|
||||
print("purchase_fail")
|
||||
emit_signal("purchase_fail")
|
||||
|
||||
func purchase_cancel():
|
||||
print("purchase_cancel")
|
||||
emit_signal("purchase_cancel")
|
||||
|
||||
func purchase_owned(sku):
|
||||
print("purchase_owned : ", sku)
|
||||
emit_signal("purchase_owned", sku)
|
||||
|
||||
|
||||
# consume purchased item
|
||||
# callback : consume_success, consume_fail
|
||||
func consume(item_name):
|
||||
if payment:
|
||||
payment.consume(item_name)
|
||||
|
||||
# consume all purchased items
|
||||
func consume_all():
|
||||
if payment:
|
||||
payment.consumeUnconsumedPurchases()
|
||||
|
||||
func consume_success(receipt, signature, sku):
|
||||
print("consume_success : ", sku)
|
||||
emit_signal("consume_success", sku)
|
||||
|
||||
# if consume fail, need to call request_purchased() to get purchase token from google
|
||||
# then try to consume again
|
||||
func consume_fail():
|
||||
emit_signal("consume_fail")
|
||||
|
||||
# no purchased item to consume
|
||||
func consume_not_required():
|
||||
emit_signal("consume_not_required")
|
||||
|
||||
|
||||
# detail info of IAP items
|
||||
# sku_details = {
|
||||
# product_id (String) : {
|
||||
# type (String),
|
||||
# product_id (String),
|
||||
# title (String),
|
||||
# description (String),
|
||||
# price (String), # this can be used to display price for each country with their own currency
|
||||
# price_currency_code (String),
|
||||
# price_amount (float)
|
||||
# },
|
||||
# ...
|
||||
# }
|
||||
var sku_details = {}
|
||||
|
||||
# query for details of IAP items
|
||||
# callback : sku_details_complete
|
||||
func sku_details_query(list):
|
||||
if payment:
|
||||
var sku_list = StringArray(list)
|
||||
payment.querySkuDetails(sku_list)
|
||||
|
||||
func sku_details_complete(result):
|
||||
print("sku_details_complete : ", result)
|
||||
for key in result.keys():
|
||||
sku_details[key] = result[key]
|
||||
emit_signal("sku_details_complete")
|
||||
|
||||
func sku_details_error(error_message):
|
||||
print("error_sku_details = ", error_message)
|
||||
emit_signal("sku_details_error")
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
extends Control
|
||||
|
||||
onready var alert = get_node("alert")
|
||||
|
||||
func _ready():
|
||||
iap.set_auto_consume(false)
|
||||
iap.connect("purchase_success", self, "on_purchase_success")
|
||||
iap.connect("purchase_fail", self, "on_purchase_fail")
|
||||
iap.connect("purchase_cancel", self, "on_purchase_cancel")
|
||||
iap.connect("purchase_owned", self, "on_purchase_owned")
|
||||
iap.connect("has_purchased", self, "on_has_purchased")
|
||||
iap.connect("consume_success", self, "on_consume_success")
|
||||
iap.connect("consume_fail", self, "on_consume_fail")
|
||||
iap.connect("sku_details_complete", self, "on_sku_details_complete")
|
||||
|
||||
get_node("purchase").connect("pressed", self, "button_purchase")
|
||||
get_node("consume").connect("pressed", self, "button_consume")
|
||||
get_node("request").connect("pressed", self, "button_request")
|
||||
get_node("query").connect("pressed", self, "button_query")
|
||||
|
||||
|
||||
func on_purchase_success(item_name):
|
||||
alert.set_text("Purchase success : "+item_name)
|
||||
alert.popup()
|
||||
|
||||
func on_purchase_fail():
|
||||
alert.set_text("Purchase fail")
|
||||
alert.popup()
|
||||
|
||||
func on_purchase_cancel():
|
||||
alert.set_text("Purchase cancel")
|
||||
alert.popup()
|
||||
|
||||
func on_purchase_owned(item_name):
|
||||
alert.set_text("Purchase owned : "+item_name)
|
||||
alert.popup()
|
||||
|
||||
func on_has_purchased(item_name):
|
||||
if item_name == null:
|
||||
alert.set_text("Don't have purchased item")
|
||||
else:
|
||||
alert.set_text("Has purchased : "+item_name)
|
||||
alert.popup()
|
||||
|
||||
func on_consume_success(item_name):
|
||||
alert.set_text("Consume success : "+item_name)
|
||||
alert.popup()
|
||||
|
||||
func on_consume_fail():
|
||||
alert.set_text("Try to request purchased first")
|
||||
alert.popup()
|
||||
|
||||
func on_sku_details_complete():
|
||||
alert.set_text("Got detail info : "+iap.sku_details["item_test_a"].to_json())
|
||||
alert.popup()
|
||||
|
||||
|
||||
func button_purchase():
|
||||
iap.purchase("item_tess")
|
||||
|
||||
func button_consume():
|
||||
iap.consume("item_tess")
|
||||
|
||||
func button_request():
|
||||
iap.request_purchased()
|
||||
|
||||
func button_query():
|
||||
iap.sku_details_query(["item_test_a", "item_test_b"])
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -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,8 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Autoload (Singletons)"
|
||||
main_scene="res://scene_a.scn"
|
||||
|
||||
[autoload]
|
||||
|
||||
global="res://global.gd"
|
||||
@@ -1,36 +0,0 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Changing scenes is most easily done using the functions `change_scene`
|
||||
# and `change_scene_to` of the SceneTree. This script demonstrates how to
|
||||
# change scenes without those helpers.
|
||||
|
||||
|
||||
func goto_scene(path):
|
||||
# This function will usually be called from a signal callback,
|
||||
# or some other function from the running scene.
|
||||
# Deleting the current scene at this point might be
|
||||
# a bad idea, because it may be inside of a callback or function of it.
|
||||
# The worst case will be a crash or unexpected behavior.
|
||||
|
||||
# The way around this is deferring the load to a later time, when
|
||||
# it is ensured that no code from the current scene is running:
|
||||
|
||||
call_deferred("_deferred_goto_scene",path)
|
||||
|
||||
|
||||
func _deferred_goto_scene(path):
|
||||
# Immediately free the current scene, there is no risk here.
|
||||
get_tree().get_current_scene().free()
|
||||
|
||||
# Load new scene
|
||||
var packed_scene = ResourceLoader.load(path)
|
||||
|
||||
# Instance the new scene
|
||||
var instanced_scene = packed_scene.instance()
|
||||
|
||||
# Add it to the scene tree, as direct child of root
|
||||
get_tree().get_root().add_child(instanced_scene)
|
||||
|
||||
# Set it as the current scene, only after it has been added to the tree
|
||||
get_tree().set_current_scene(instanced_scene)
|
||||
@@ -1,5 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_node("/root/global").goto_scene("res://scene_b.scn")
|
||||
@@ -1,5 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_node("/root/global").goto_scene("res://scene_a.scn")
|
||||
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,9 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Scene Instancing Demo"
|
||||
main_scene="res://container.scn"
|
||||
icon="res://icon.png"
|
||||
|
||||
[physics_2d]
|
||||
|
||||
default_gravity=300
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 168 KiB |
@@ -1,10 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Joysticks"
|
||||
main_scene="res://joysticks.tscn"
|
||||
icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
height=450
|
||||
width=550
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1,71 +0,0 @@
|
||||
|
||||
extends Node2D
|
||||
|
||||
# Joysticks demo, written by Dana Olson <dana@shineuponthee.com>
|
||||
#
|
||||
# This is a demo of joystick support, and doubles as a testing application
|
||||
# inspired by and similar to jstest-gtk.
|
||||
#
|
||||
# Licensed under the MIT license
|
||||
|
||||
# Member variables
|
||||
var joy_num
|
||||
var cur_joy
|
||||
var axis_value
|
||||
|
||||
const DEADZONE = 0.2
|
||||
|
||||
func _fixed_process(delta):
|
||||
# Get the joystick device number from the spinbox
|
||||
joy_num = get_node("joy_num").get_value()
|
||||
|
||||
# Display the name of the joystick if we haven't already
|
||||
if joy_num != cur_joy:
|
||||
cur_joy = joy_num
|
||||
get_node("joy_name").set_text(Input.get_joy_name(joy_num))
|
||||
|
||||
# Loop through the axes and show their current values
|
||||
for axis in range(JOY_ANALOG_0_X, JOY_AXIS_MAX):
|
||||
axis_value = Input.get_joy_axis(joy_num, axis)
|
||||
get_node("axis_prog" + str(axis)).set_value(100*axis_value)
|
||||
get_node("axis_val" + str(axis)).set_text(str(axis_value))
|
||||
# Show joystick direction indicators
|
||||
if (axis <= JOY_ANALOG_1_Y):
|
||||
if (abs(axis_value) < DEADZONE):
|
||||
get_node("diagram/axes/" + str(axis) + "+").hide()
|
||||
get_node("diagram/axes/" + str(axis) + "-").hide()
|
||||
elif (axis_value > 0):
|
||||
get_node("diagram/axes/" + str(axis) + "+").show()
|
||||
else:
|
||||
get_node("diagram/axes/" + str(axis) + "-").show()
|
||||
|
||||
# Loop through the buttons and highlight the ones that are pressed
|
||||
for btn in range(JOY_BUTTON_0, JOY_BUTTON_MAX):
|
||||
if (Input.is_joy_button_pressed(joy_num, btn)):
|
||||
get_node("btn" + str(btn)).add_color_override("font_color", Color(1, 1, 1, 1))
|
||||
get_node("diagram/buttons/" + str(btn)).show()
|
||||
else:
|
||||
get_node("btn" + str(btn)).add_color_override("font_color", Color(0.2, 0.1, 0.3, 1))
|
||||
get_node("diagram/buttons/" + str(btn)).hide()
|
||||
|
||||
func _ready():
|
||||
set_fixed_process(true)
|
||||
Input.connect("joy_connection_changed", self, "_on_joy_connection_changed")
|
||||
|
||||
#Called whenever a joystick has been connected or disconnected.
|
||||
func _on_joy_connection_changed(device_id, connected):
|
||||
if device_id == cur_joy:
|
||||
if connected:
|
||||
get_node("joy_name").set_text(Input.get_joy_name(device_id))
|
||||
else:
|
||||
get_node("joy_name").set_text("")
|
||||
|
||||
func _on_start_vibration_pressed():
|
||||
var weak = get_node("Vibration_weak_value").get_value()
|
||||
var strong = get_node("Vibration_strong_value").get_value()
|
||||
var duration = get_node("Vibration_duration_value").get_value()
|
||||
|
||||
Input.start_joy_vibration(cur_joy, weak, strong, duration)
|
||||
|
||||
func _on_stop_vibration_pressed():
|
||||
Input.stop_joy_vibration(cur_joy)
|
||||
@@ -1,854 +0,0 @@
|
||||
[gd_scene load_steps=3 format=1]
|
||||
|
||||
[ext_resource path="res://joysticks.gd" type="Script" id=1]
|
||||
[ext_resource path="res://jsdiagram.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="joysticks" type="Node2D"]
|
||||
|
||||
script/script = ExtResource( 1 )
|
||||
__meta__ = { "__editor_plugin_screen__":"Script" }
|
||||
|
||||
[node name="label_buttons" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 235.0
|
||||
margin/right = 65.0
|
||||
margin/bottom = 248.0
|
||||
text = "Buttons:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn0" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 255.0
|
||||
margin/right = 45.0
|
||||
margin/bottom = 268.0
|
||||
text = "0"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn1" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 45.0
|
||||
margin/top = 255.0
|
||||
margin/right = 70.0
|
||||
margin/bottom = 268.0
|
||||
text = "1"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn2" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 70.0
|
||||
margin/top = 255.0
|
||||
margin/right = 95.0
|
||||
margin/bottom = 268.0
|
||||
text = "2"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn3" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 95.0
|
||||
margin/top = 255.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 268.0
|
||||
text = "3"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn4" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 120.0
|
||||
margin/top = 255.0
|
||||
margin/right = 145.0
|
||||
margin/bottom = 268.0
|
||||
text = "4"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn5" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 145.0
|
||||
margin/top = 255.0
|
||||
margin/right = 170.0
|
||||
margin/bottom = 268.0
|
||||
text = "5"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn6" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 170.0
|
||||
margin/top = 255.0
|
||||
margin/right = 195.0
|
||||
margin/bottom = 268.0
|
||||
text = "6"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn7" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 195.0
|
||||
margin/top = 255.0
|
||||
margin/right = 220.0
|
||||
margin/bottom = 268.0
|
||||
text = "7"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn8" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 220.0
|
||||
margin/top = 255.0
|
||||
margin/right = 245.0
|
||||
margin/bottom = 268.0
|
||||
text = "8"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn9" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 20.0
|
||||
margin/top = 275.0
|
||||
margin/right = 45.0
|
||||
margin/bottom = 288.0
|
||||
text = "9"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn10" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 45.0
|
||||
margin/top = 275.0
|
||||
margin/right = 70.0
|
||||
margin/bottom = 288.0
|
||||
text = "10"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn11" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 70.0
|
||||
margin/top = 275.0
|
||||
margin/right = 95.0
|
||||
margin/bottom = 288.0
|
||||
text = "11"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn12" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 95.0
|
||||
margin/top = 275.0
|
||||
margin/right = 120.0
|
||||
margin/bottom = 288.0
|
||||
text = "12"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn13" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 120.0
|
||||
margin/top = 275.0
|
||||
margin/right = 145.0
|
||||
margin/bottom = 288.0
|
||||
text = "13"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn14" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 145.0
|
||||
margin/top = 275.0
|
||||
margin/right = 170.0
|
||||
margin/bottom = 288.0
|
||||
text = "14"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="btn15" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 170.0
|
||||
margin/top = 275.0
|
||||
margin/right = 195.0
|
||||
margin/bottom = 288.0
|
||||
text = "15"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_prog0" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 60.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 76.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog1" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 80.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 96.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog2" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 100.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 116.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog3" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 120.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 136.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog4" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 140.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 156.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog5" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 160.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 176.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog6" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 180.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 196.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_prog7" type="ProgressBar" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 200.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 216.0
|
||||
range/min = -100.0
|
||||
range/max = 100.0
|
||||
range/step = 0.0001
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
percent/visible = false
|
||||
|
||||
[node name="axis_val0" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 60.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 75.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val1" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 80.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 95.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val2" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 100.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 115.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val3" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 120.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 135.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val4" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 140.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 155.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val5" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 160.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 175.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val6" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 180.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 195.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="axis_val7" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 50.0
|
||||
margin/top = 200.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 215.0
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis0" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 60.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 75.0
|
||||
text = "Axis 0"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis1" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 80.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 95.0
|
||||
text = "Axis 1"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis2" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 100.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 115.0
|
||||
text = "Axis 2"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis3" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 120.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 135.0
|
||||
text = "Axis 3"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis4" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 140.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 155.0
|
||||
text = "Axis 4"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis5" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 160.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 175.0
|
||||
text = "Axis 5"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis6" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 180.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 195.0
|
||||
text = "Axis 6"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_axis7" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 200.0
|
||||
margin/right = 51.0
|
||||
margin/bottom = 215.0
|
||||
text = "Axis 7"
|
||||
valign = 2
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="label_device" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 10.0
|
||||
margin/right = 60.0
|
||||
margin/bottom = 30.0
|
||||
text = "Device"
|
||||
valign = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="joy_num" type="SpinBox" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 65.0
|
||||
margin/top = 10.0
|
||||
margin/right = 127.0
|
||||
margin/bottom = 33.0
|
||||
range/min = 0.0
|
||||
range/max = 16.0
|
||||
range/step = 1.0
|
||||
range/page = 0.0
|
||||
range/value = 0.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
editable = true
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[node name="joy_name" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 10.0
|
||||
margin/top = 35.0
|
||||
margin/right = 250.0
|
||||
margin/bottom = 50.0
|
||||
custom_colors/font_color = Color( 0.229156, 1, 0.239205, 1 )
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Vibration_weak_value" type="SpinBox" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 163.0
|
||||
margin/top = 324.0
|
||||
margin/right = 237.0
|
||||
margin/bottom = 348.0
|
||||
range/min = 0.0
|
||||
range/max = 1.0
|
||||
range/step = 0.05
|
||||
range/page = 0.0
|
||||
range/value = 1.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
editable = true
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[node name="Vibration_strong_value" type="SpinBox" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 163.0
|
||||
margin/top = 362.0
|
||||
margin/right = 237.0
|
||||
margin/bottom = 386.0
|
||||
range/min = 0.0
|
||||
range/max = 1.0
|
||||
range/step = 0.05
|
||||
range/page = 0.0
|
||||
range/value = 1.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
editable = true
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[node name="Vibration_duration_value" type="SpinBox" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 163.0
|
||||
margin/top = 403.0
|
||||
margin/right = 237.0
|
||||
margin/bottom = 427.0
|
||||
range/min = 0.0
|
||||
range/max = 10.0
|
||||
range/step = 0.1
|
||||
range/page = 0.0
|
||||
range/value = 1.0
|
||||
range/exp_edit = false
|
||||
range/rounded = false
|
||||
editable = true
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[node name="start_vibration" type="Button" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 288.0
|
||||
margin/top = 352.0
|
||||
margin/right = 389.0
|
||||
margin/bottom = 372.0
|
||||
toggle_mode = false
|
||||
click_on_press = true
|
||||
enabled_focus_mode = 0
|
||||
shortcut = null
|
||||
text = "Start Vibration"
|
||||
flat = false
|
||||
|
||||
[node name="stop_vibration" type="Button" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 406.0
|
||||
margin/top = 352.0
|
||||
margin/right = 507.0
|
||||
margin/bottom = 372.0
|
||||
toggle_mode = false
|
||||
click_on_press = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Stop Vibration"
|
||||
flat = false
|
||||
|
||||
[node name="Weak_label" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 8.0
|
||||
margin/top = 329.0
|
||||
margin/right = 150.0
|
||||
margin/bottom = 343.0
|
||||
text = "Vibration Weak Motor:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Strong_label" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 8.0
|
||||
margin/top = 367.0
|
||||
margin/right = 150.0
|
||||
margin/bottom = 381.0
|
||||
text = "Vibration Strong Motor:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Duration_label" type="Label" parent="."]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
margin/left = 8.0
|
||||
margin/top = 408.0
|
||||
margin/right = 155.0
|
||||
margin/bottom = 439.0
|
||||
text = "Vibration Duration:"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="diagram" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
transform/pos = Vector2( 403.304, 161.318 )
|
||||
|
||||
[connection signal="pressed" from="start_vibration" to="." method="_on_start_vibration_pressed"]
|
||||
|
||||
[connection signal="pressed" from="stop_vibration" to="." method="_on_stop_vibration_pressed"]
|
||||
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
[gd_scene load_steps=3 format=1]
|
||||
|
||||
[ext_resource path="res://diagram.png" type="Texture" id=1]
|
||||
[ext_resource path="res://indicators.png" type="Texture" id=2]
|
||||
|
||||
[node name="diagram" type="Sprite"]
|
||||
|
||||
transform/pos = Vector2( 368.635, 155.289 )
|
||||
transform/scale = Vector2( 0.432859, 0.446287 )
|
||||
texture = ExtResource( 1 )
|
||||
__meta__ = { "__editor_plugin_screen__":"2D" }
|
||||
|
||||
[node name="buttons" type="Node2D" parent="."]
|
||||
|
||||
__meta__ = { "_editor_collapsed":true }
|
||||
|
||||
[node name="0" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 147.73, 120.925 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="1" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 185.769, 82.4874 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="2" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 112.377, 82.4874 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="3" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 149.073, 47.3293 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="4" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -161.038, -158.037 )
|
||||
transform/scale = Vector2( 5.3348, 3.35512 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 10, 10, 10, 10 )
|
||||
|
||||
[node name="5" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 159.362, -156.977 )
|
||||
transform/scale = Vector2( 5.3348, 3.35512 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 10, 10, 10, 10 )
|
||||
|
||||
[node name="6" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -159.349, -221.878 )
|
||||
transform/scale = Vector2( 1.0458, 2.16952 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_h = true
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 22 )
|
||||
|
||||
[node name="7" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 156.677, -220.11 )
|
||||
transform/scale = Vector2( 1.0458, 2.16952 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 22 )
|
||||
|
||||
[node name="8" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -67.5308, 164.422 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="9" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 75.8825, 167.363 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="10" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -46.6707, 52.702 )
|
||||
transform/scale = Vector2( 0.810497, 0.57205 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="11" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( 56.2581, 54.4382 )
|
||||
transform/scale = Vector2( 0.810497, 0.57205 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 0, 0, 45, 45 )
|
||||
|
||||
[node name="12" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -139.402, 46.8295 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 54, 14 )
|
||||
|
||||
[node name="13" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -139.838, 115.789 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_v = true
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 54, 14 )
|
||||
|
||||
[node name="14" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -172.262, 81.8793 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 14, 54 )
|
||||
|
||||
[node name="15" type="Sprite" parent="buttons"]
|
||||
|
||||
transform/pos = Vector2( -105.085, 81.0326 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_h = true
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 14, 54 )
|
||||
|
||||
[node name="axes" type="Node2D" parent="."]
|
||||
|
||||
[node name="0-" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( -94.4295, 164.932 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 14, 54 )
|
||||
|
||||
[node name="0+" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( -40.3475, 164.509 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_h = true
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 14, 54 )
|
||||
|
||||
[node name="1-" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( -67.6802, 137.926 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 54, 14 )
|
||||
|
||||
[node name="1+" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( -67.4618, 192.915 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_v = true
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 54, 14 )
|
||||
|
||||
[node name="3-" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( 76.6557, 140.986 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 54, 14 )
|
||||
|
||||
[node name="3+" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( 76.0009, 195.339 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_v = true
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 54, 14 )
|
||||
|
||||
[node name="2-" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( 48.8152, 167.145 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 14, 54 )
|
||||
|
||||
[node name="2+" type="Sprite" parent="axes"]
|
||||
|
||||
transform/pos = Vector2( 102.899, 167.857 )
|
||||
transform/scale = Vector2( 0.9, 0.9 )
|
||||
texture = ExtResource( 2 )
|
||||
flip_h = true
|
||||
region = true
|
||||
region_rect = Rect2( 50, 0, 14, 54 )
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Pause"
|
||||
main_scene="res://spinpause.scn"
|
||||
icon="res://icon.png"
|
||||
|
Before Width: | Height: | Size: 5.1 KiB |
@@ -1,13 +0,0 @@
|
||||
|
||||
extends Spatial
|
||||
|
||||
|
||||
func _on_pause_pressed():
|
||||
get_node("pause_popup").set_exclusive(true)
|
||||
get_node("pause_popup").popup()
|
||||
get_tree().set_pause(true)
|
||||
|
||||
|
||||
func _on_unpause_pressed():
|
||||
get_node("pause_popup").hide()
|
||||
get_tree().set_pause(false)
|
||||
@@ -1,5 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="RegEx"
|
||||
main_scene="res://regex.scn"
|
||||
icon="res://icon.png"
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -1,28 +0,0 @@
|
||||
|
||||
extends VBoxContainer
|
||||
|
||||
# Member variables
|
||||
var regex = RegEx.new()
|
||||
|
||||
|
||||
func update_expression(text):
|
||||
regex.compile(text)
|
||||
update_text()
|
||||
|
||||
|
||||
func update_text():
|
||||
var text = get_node("Text").get_text()
|
||||
var list = get_node("List")
|
||||
for child in list.get_children():
|
||||
child.queue_free()
|
||||
if regex.is_valid():
|
||||
regex.find(text)
|
||||
for res in regex.get_captures():
|
||||
var label = Label.new()
|
||||
label.set_text(res)
|
||||
list.add_child(label)
|
||||
|
||||
|
||||
func _ready():
|
||||
get_node("Text").set_text("They asked me \"What's going on \\\"in the manor\\\"?\"")
|
||||
update_expression(get_node("Expression").get_text())
|
||||
@@ -1,4 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Scene Changer"
|
||||
main_scene="res://scene_a.scn"
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
|
||||
func _ready():
|
||||
# Initalization here
|
||||
pass
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_tree().change_scene("res://scene_b.scn")
|
||||
pass # Replace with function body
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
extends Panel
|
||||
|
||||
# Member variables here, example:
|
||||
# var a=2
|
||||
# var b="textvar"
|
||||
|
||||
|
||||
func _ready():
|
||||
# Initalization here
|
||||
pass
|
||||
|
||||
|
||||
func _on_goto_scene_pressed():
|
||||
get_tree().change_scene("res://scene_a.scn")
|
||||
pass # Replace with function body
|
||||
@@ -1,4 +0,0 @@
|
||||
[application]
|
||||
|
||||
name="Loading in a Thread"
|
||||
main_scene="res://thread.scn"
|
||||
|
Before Width: | Height: | Size: 97 KiB |
@@ -1,31 +0,0 @@
|
||||
|
||||
extends Node2D
|
||||
|
||||
# Member variables
|
||||
var thread = Thread.new()
|
||||
|
||||
|
||||
# This function runs in a thread!
|
||||
# Threads always take one userdata argument
|
||||
func _bg_load(path):
|
||||
print("THREAD FUNC!")
|
||||
# Load the resource
|
||||
var tex = ResourceLoader.load(path)
|
||||
# Call _bg_load_done on main thread
|
||||
call_deferred("_bg_load_done")
|
||||
return tex # return it
|
||||
|
||||
|
||||
func _bg_load_done():
|
||||
# Wait for the thread to complete, get the returned value
|
||||
var tex = thread.wait_to_finish()
|
||||
# Set to the sprite
|
||||
get_node("sprite").set_texture(tex)
|
||||
|
||||
|
||||
func _on_load_pressed():
|
||||
if (thread.is_active()):
|
||||
# Already working
|
||||
return
|
||||
print("START THREAD!")
|
||||
thread.start(self, "_bg_load", "res://mona.png")
|
||||
@@ -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"
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -1,165 +0,0 @@
|
||||
|
||||
extends Control
|
||||
|
||||
# Member variables
|
||||
var trans = ["linear", "sine", "quint", "quart", "quad", "expo", "elastic", "cubic", "circ", "bounce", "back"]
|
||||
var eases = ["in", "out", "in_out", "out_in"]
|
||||
var modes = ["move", "color", "scale", "rotate", "callback", "follow", "repeat", "pause"]
|
||||
|
||||
var state = {
|
||||
trans = Tween.TRANS_LINEAR,
|
||||
eases = Tween.EASE_IN,
|
||||
}
|
||||
|
||||
|
||||
func _ready():
|
||||
for index in range(trans.size()):
|
||||
var name = trans[index]
|
||||
get_node("trans/" + name).connect("pressed", self, "on_trans_changed", [name, index])
|
||||
|
||||
for index in range(eases.size()):
|
||||
var name = eases[index]
|
||||
get_node("eases/" + name).connect("pressed", self, "on_eases_changed", [name, index])
|
||||
|
||||
for index in range(modes.size()):
|
||||
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").connect("color_changed", self, "on_color_changed")
|
||||
|
||||
get_node("color/color_to").set_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)
|
||||
get_node("eases/in").set_pressed(true)
|
||||
get_node("modes/move").set_pressed(true)
|
||||
get_node("modes/repeat").set_pressed(true)
|
||||
|
||||
reset_tween()
|
||||
|
||||
|
||||
func on_trans_changed(name, index):
|
||||
for index in range(trans.size()):
|
||||
var pressed = trans[index] == name
|
||||
var btn = get_node("trans/" + trans[index])
|
||||
|
||||
btn.set_pressed(pressed)
|
||||
btn.set_ignore_mouse(pressed)
|
||||
|
||||
state.trans = index
|
||||
reset_tween()
|
||||
|
||||
|
||||
func on_eases_changed(name, index):
|
||||
for index in range(eases.size()):
|
||||
var pressed = eases[index] == name
|
||||
var btn = get_node("eases/" + eases[index])
|
||||
|
||||
btn.set_pressed(pressed)
|
||||
btn.set_ignore_mouse(pressed)
|
||||
|
||||
state.eases = index
|
||||
reset_tween()
|
||||
|
||||
|
||||
func on_modes_changed(name):
|
||||
var tween = get_node("tween")
|
||||
if name == "pause":
|
||||
if get_node("modes/pause").is_pressed():
|
||||
tween.stop_all()
|
||||
get_node("timeline").set_ignore_mouse(false)
|
||||
else:
|
||||
tween.resume_all()
|
||||
get_node("timeline").set_ignore_mouse(true)
|
||||
else:
|
||||
reset_tween()
|
||||
|
||||
|
||||
func on_color_changed(color):
|
||||
reset_tween()
|
||||
|
||||
|
||||
func reset_tween():
|
||||
var tween = get_node("tween")
|
||||
var pos = tween.tell()
|
||||
tween.reset_all()
|
||||
tween.remove_all()
|
||||
|
||||
var sprite = get_node("tween/area/sprite")
|
||||
var follow = get_node("tween/area/follow")
|
||||
var follow_2 = get_node("tween/area/follow_2")
|
||||
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)
|
||||
|
||||
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)
|
||||
else:
|
||||
sprite.set_modulate(Color(1,1,1,1))
|
||||
|
||||
if get_node("modes/scale").is_pressed():
|
||||
tween.interpolate_method(sprite, "set_scale", Vector2(0.5, 0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)
|
||||
tween.interpolate_property(sprite, "transform/scale", Vector2(1.5, 1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)
|
||||
else:
|
||||
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)
|
||||
|
||||
if get_node("modes/callback").is_pressed():
|
||||
tween.interpolate_callback(self, 0.5, "on_callback", "0.5 second's after")
|
||||
tween.interpolate_callback(self, 0.2, "on_callback", "1.2 second's after")
|
||||
|
||||
if get_node("modes/follow").is_pressed():
|
||||
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.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)
|
||||
else:
|
||||
follow.hide()
|
||||
follow_2.hide()
|
||||
|
||||
tween.set_repeat(get_node("modes/repeat").is_pressed())
|
||||
tween.start()
|
||||
tween.seek(pos)
|
||||
|
||||
if get_node("modes/pause").is_pressed():
|
||||
tween.stop_all()
|
||||
get_node("timeline").set_ignore_mouse(false)
|
||||
get_node("timeline").set_value(0)
|
||||
else:
|
||||
tween.resume_all()
|
||||
get_node("timeline").set_ignore_mouse(true)
|
||||
|
||||
|
||||
func _on_tween_step(object, key, elapsed, value):
|
||||
var timeline = get_node("timeline")
|
||||
|
||||
var tween = get_node("tween")
|
||||
var runtime = tween.get_runtime()
|
||||
|
||||
var ratio = 100*(elapsed/runtime)
|
||||
timeline.set_value(ratio)
|
||||
|
||||
|
||||
func _on_timeline_value_changed(value):
|
||||
if !get_node("modes/pause").is_pressed():
|
||||
return
|
||||
|
||||
var tween = get_node("tween")
|
||||
var runtime = tween.get_runtime()
|
||||
tween.seek(runtime*value/100)
|
||||
|
||||
|
||||
func on_callback(arg):
|
||||
var label = get_node("tween/area/label")
|
||||
label.add_text("on_callback -> " + arg + "\n")
|
||||
@@ -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)]
|
||||
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -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,56 +0,0 @@
|
||||
[gd_scene load_steps=2 format=1]
|
||||
|
||||
[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
|
||||
shape_count = 0
|
||||
collision/layers = 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" }
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
|
||||
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
|
||||
projection = 0
|
||||
fov = 60.0
|
||||
near = 0.1
|
||||
far = 1000.0
|
||||
keep_aspect = 1
|
||||
current = false
|
||||
visible_layers = 1048575
|
||||
environment = null
|
||||
h_offset = 0.0
|
||||
v_offset = 0.0
|
||||
|
||||
[node name="OmniLight" type="OmniLight" parent="."]
|
||||
|
||||
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
|
||||
layers = 1
|
||||
params/enabled = true
|
||||
params/editor_only = false
|
||||
params/bake_mode = 0
|
||||
params/energy = 1.0
|
||||
colors/diffuse = Color( 1, 1, 1, 1 )
|
||||
colors/specular = Color( 1, 1, 1, 1 )
|
||||
shadow/shadow = false
|
||||
shadow/darkening = 0.0
|
||||
shadow/z_offset = 0.001
|
||||
shadow/z_slope_scale = 0.0
|
||||
shadow/esm_multiplier = 60.0
|
||||
shadow/blur_passes = 1.0
|
||||
projector = null
|
||||
operator = 0
|
||||
params/radius = 100.0
|
||||
params/attenuation = 1.0
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||