summaryrefslogtreecommitdiff
path: root/demos/misc/threads
diff options
context:
space:
mode:
Diffstat (limited to 'demos/misc/threads')
-rw-r--r--demos/misc/threads/engine.cfg4
-rw-r--r--demos/misc/threads/mona.pngbin98894 -> 0 bytes
-rw-r--r--demos/misc/threads/thread.gd31
-rw-r--r--demos/misc/threads/thread.scnbin1586 -> 0 bytes
4 files changed, 0 insertions, 35 deletions
diff --git a/demos/misc/threads/engine.cfg b/demos/misc/threads/engine.cfg
deleted file mode 100644
index 6f19936c9d..0000000000
--- a/demos/misc/threads/engine.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-[application]
-
-name="Loading in a Thread"
-main_scene="res://thread.scn"
diff --git a/demos/misc/threads/mona.png b/demos/misc/threads/mona.png
deleted file mode 100644
index 0bcda570b4..0000000000
--- a/demos/misc/threads/mona.png
+++ /dev/null
Binary files differ
diff --git a/demos/misc/threads/thread.gd b/demos/misc/threads/thread.gd
deleted file mode 100644
index 1ef67e403c..0000000000
--- a/demos/misc/threads/thread.gd
+++ /dev/null
@@ -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")
diff --git a/demos/misc/threads/thread.scn b/demos/misc/threads/thread.scn
deleted file mode 100644
index eea93615c7..0000000000
--- a/demos/misc/threads/thread.scn
+++ /dev/null
Binary files differ