summaryrefslogtreecommitdiff
path: root/demos/2d/texscreen
diff options
context:
space:
mode:
Diffstat (limited to 'demos/2d/texscreen')
-rw-r--r--demos/2d/texscreen/OpenCV_Chessboard.pngbin0 -> 44884 bytes
-rw-r--r--demos/2d/texscreen/bubble.pngbin0 -> 18619 bytes
-rw-r--r--demos/2d/texscreen/bubbles.gd17
-rw-r--r--demos/2d/texscreen/bubbles.scnbin0 -> 1456 bytes
-rw-r--r--demos/2d/texscreen/burano.pngbin0 -> 974437 bytes
-rw-r--r--demos/2d/texscreen/engine.cfg4
-rw-r--r--demos/2d/texscreen/lens.gd37
-rw-r--r--demos/2d/texscreen/lens.scnbin0 -> 1805 bytes
8 files changed, 58 insertions, 0 deletions
diff --git a/demos/2d/texscreen/OpenCV_Chessboard.png b/demos/2d/texscreen/OpenCV_Chessboard.png
new file mode 100644
index 0000000000..31b7f8ccd8
--- /dev/null
+++ b/demos/2d/texscreen/OpenCV_Chessboard.png
Binary files differ
diff --git a/demos/2d/texscreen/bubble.png b/demos/2d/texscreen/bubble.png
new file mode 100644
index 0000000000..021abba601
--- /dev/null
+++ b/demos/2d/texscreen/bubble.png
Binary files differ
diff --git a/demos/2d/texscreen/bubbles.gd b/demos/2d/texscreen/bubbles.gd
new file mode 100644
index 0000000000..2ee227a928
--- /dev/null
+++ b/demos/2d/texscreen/bubbles.gd
@@ -0,0 +1,17 @@
+
+extends Control
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+
+const MAX_BUBBLES=10
+
+func _ready():
+ # Initialization here
+ for i in range(MAX_BUBBLES):
+ var bubble = preload("res://lens.scn").instance()
+ add_child(bubble)
+ pass
+
+
diff --git a/demos/2d/texscreen/bubbles.scn b/demos/2d/texscreen/bubbles.scn
new file mode 100644
index 0000000000..779cba6930
--- /dev/null
+++ b/demos/2d/texscreen/bubbles.scn
Binary files differ
diff --git a/demos/2d/texscreen/burano.png b/demos/2d/texscreen/burano.png
new file mode 100644
index 0000000000..6eec09d585
--- /dev/null
+++ b/demos/2d/texscreen/burano.png
Binary files differ
diff --git a/demos/2d/texscreen/engine.cfg b/demos/2d/texscreen/engine.cfg
new file mode 100644
index 0000000000..58193c8c4a
--- /dev/null
+++ b/demos/2d/texscreen/engine.cfg
@@ -0,0 +1,4 @@
+[application]
+
+name="Glass Bubbles (Texscreen)"
+main_scene="res://bubbles.scn"
diff --git a/demos/2d/texscreen/lens.gd b/demos/2d/texscreen/lens.gd
new file mode 100644
index 0000000000..2ccbfba497
--- /dev/null
+++ b/demos/2d/texscreen/lens.gd
@@ -0,0 +1,37 @@
+
+extends BackBufferCopy
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+const MOTION_SPEED=150
+
+var vsize;
+var dir;
+
+func _process(delta):
+ var pos = get_pos() + dir * delta * MOTION_SPEED
+
+ if (pos.x<0):
+ dir.x=abs(dir.x)
+ elif (pos.x>vsize.x):
+ dir.x=-abs(dir.x)
+
+ if (pos.y<0):
+ dir.y=abs(dir.y)
+ elif (pos.y>vsize.y):
+ dir.y=-abs(dir.y)
+
+ set_pos(pos)
+
+func _ready():
+ vsize = get_viewport_rect().size
+ var pos = vsize * Vector2(randf(),randf());
+ set_pos(pos);
+ dir = Vector2(randf()*2.0-1,randf()*2.0-1).normalized()
+ set_process(true)
+
+ # Initialization here
+ pass
+
+
diff --git a/demos/2d/texscreen/lens.scn b/demos/2d/texscreen/lens.scn
new file mode 100644
index 0000000000..5c6f8b7af8
--- /dev/null
+++ b/demos/2d/texscreen/lens.scn
Binary files differ