summaryrefslogtreecommitdiff
path: root/demos/2d
diff options
context:
space:
mode:
Diffstat (limited to 'demos/2d')
-rw-r--r--demos/2d/kinematic_char/engine.cfg7
-rw-r--r--demos/2d/lights_shadows/engine.cfg3
-rw-r--r--demos/2d/lookat/arrow.pngbin0 -> 2528 bytes
-rw-r--r--demos/2d/lookat/engine.cfg4
-rw-r--r--demos/2d/lookat/lookat.gd43
-rw-r--r--demos/2d/lookat/lookat.scnbin0 -> 1622 bytes
-rw-r--r--demos/2d/motion/car.pngbin0 -> 2086 bytes
-rw-r--r--demos/2d/motion/engine.cfg4
-rw-r--r--demos/2d/motion/motion.gd38
-rw-r--r--demos/2d/motion/motion.scnbin0 -> 2845 bytes
-rw-r--r--demos/2d/navpoly/engine.cfg7
-rw-r--r--demos/2d/normalmaps/engine.cfg7
-rw-r--r--demos/2d/screen_space_shaders/engine.cfg6
-rw-r--r--demos/2d/screen_space_shaders/screen_shaders.scnbin5896 -> 5936 bytes
-rw-r--r--demos/2d/texscreen/bubbles.scnbin1456 -> 1551 bytes
-rw-r--r--demos/2d/texscreen/engine.cfg7
16 files changed, 126 insertions, 0 deletions
diff --git a/demos/2d/kinematic_char/engine.cfg b/demos/2d/kinematic_char/engine.cfg
index 0132442c18..4ce8f836ae 100644
--- a/demos/2d/kinematic_char/engine.cfg
+++ b/demos/2d/kinematic_char/engine.cfg
@@ -4,6 +4,13 @@ name="Kinematic Collision"
main_scene="res://colworld.scn"
icon="res://icon.png"
+[display]
+
+width=800
+height=600
+stretch_mode="2d"
+stretch_aspect="keep"
+
[input]
move_up=[key(Up)]
diff --git a/demos/2d/lights_shadows/engine.cfg b/demos/2d/lights_shadows/engine.cfg
index 7e028c3556..771288c209 100644
--- a/demos/2d/lights_shadows/engine.cfg
+++ b/demos/2d/lights_shadows/engine.cfg
@@ -6,6 +6,9 @@ main_scene="res://light_shadows.scn"
[display]
stretch_mode="2d"
+width=800
+height=600
+stretch_aspect="keep"
[rasterizer]
diff --git a/demos/2d/lookat/arrow.png b/demos/2d/lookat/arrow.png
new file mode 100644
index 0000000000..25db91e8d1
--- /dev/null
+++ b/demos/2d/lookat/arrow.png
Binary files differ
diff --git a/demos/2d/lookat/engine.cfg b/demos/2d/lookat/engine.cfg
new file mode 100644
index 0000000000..56917a39ec
--- /dev/null
+++ b/demos/2d/lookat/engine.cfg
@@ -0,0 +1,4 @@
+[application]
+
+name="Look At Pointer"
+main_scene="res://lookat.scn"
diff --git a/demos/2d/lookat/lookat.gd b/demos/2d/lookat/lookat.gd
new file mode 100644
index 0000000000..742c5b0671
--- /dev/null
+++ b/demos/2d/lookat/lookat.gd
@@ -0,0 +1,43 @@
+
+extends Sprite
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+
+const MODE_DIRECT=0
+const MODE_CONSTANT=1
+const MODE_SMOOTH=2
+
+const ROTATION_SPEED = 1
+const SMOOTH_SPEED = 2.0
+
+export(int,"Direct","Constant","Smooth") var mode=MODE_DIRECT
+
+func _process(delta):
+ var mpos = get_viewport().get_mouse_pos()
+
+ if (mode==MODE_DIRECT):
+
+ look_at(mpos)
+
+ elif (mode==MODE_CONSTANT):
+
+ var ang = get_angle_to(mpos)
+ var s = sign(ang)
+ ang=abs(ang)
+
+ rotate( min(ang,ROTATION_SPEED*delta)*s )
+
+ elif (mode==MODE_SMOOTH):
+
+ var ang = get_angle_to(mpos)
+
+ rotate( ang*delta*SMOOTH_SPEED )
+
+func _ready():
+ # Initialization here
+ set_process(true)
+ pass
+
+
diff --git a/demos/2d/lookat/lookat.scn b/demos/2d/lookat/lookat.scn
new file mode 100644
index 0000000000..880070b4c7
--- /dev/null
+++ b/demos/2d/lookat/lookat.scn
Binary files differ
diff --git a/demos/2d/motion/car.png b/demos/2d/motion/car.png
new file mode 100644
index 0000000000..7ea973ceeb
--- /dev/null
+++ b/demos/2d/motion/car.png
Binary files differ
diff --git a/demos/2d/motion/engine.cfg b/demos/2d/motion/engine.cfg
new file mode 100644
index 0000000000..064de6b331
--- /dev/null
+++ b/demos/2d/motion/engine.cfg
@@ -0,0 +1,4 @@
+[application]
+
+name="Motion Test"
+main_scene="res://motion.scn"
diff --git a/demos/2d/motion/motion.gd b/demos/2d/motion/motion.gd
new file mode 100644
index 0000000000..8f8f56a889
--- /dev/null
+++ b/demos/2d/motion/motion.gd
@@ -0,0 +1,38 @@
+
+extends Sprite
+
+
+export var use_idle=true
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+const BEGIN = -113
+const END = 907
+const TIME = 5.0 # seconds
+const SPEED = (END-BEGIN)/TIME
+
+func _process(delta):
+ var ofs = get_pos()
+ ofs.x+=delta*SPEED
+ if (ofs.x>END):
+ ofs.x=BEGIN
+ set_pos(ofs)
+
+func _fixed_process(delta):
+ var ofs = get_pos()
+ ofs.x+=delta*SPEED
+ if (ofs.x>END):
+ ofs.x=BEGIN
+ set_pos(ofs)
+
+
+func _ready():
+ # Initialization here
+ if (use_idle):
+ set_process(true)
+ else:
+ set_fixed_process(true)
+ pass
+
+
diff --git a/demos/2d/motion/motion.scn b/demos/2d/motion/motion.scn
new file mode 100644
index 0000000000..6c5b5307ac
--- /dev/null
+++ b/demos/2d/motion/motion.scn
Binary files differ
diff --git a/demos/2d/navpoly/engine.cfg b/demos/2d/navpoly/engine.cfg
index 51eefd7b77..40515dd3d2 100644
--- a/demos/2d/navpoly/engine.cfg
+++ b/demos/2d/navpoly/engine.cfg
@@ -2,3 +2,10 @@
name="Navigation Polygon (2D)"
main_scene="res://navigation.scn"
+
+[display]
+
+width=800
+height=600
+stretch_mode="2d"
+stretch_aspect="keep"
diff --git a/demos/2d/normalmaps/engine.cfg b/demos/2d/normalmaps/engine.cfg
index 3fc2048716..f0002dc2b8 100644
--- a/demos/2d/normalmaps/engine.cfg
+++ b/demos/2d/normalmaps/engine.cfg
@@ -2,3 +2,10 @@
name="2D Normal Mapping"
main_scene="res://normalmap.scn"
+
+[display]
+
+stretch_mode="2d"
+width=800
+height=600
+stretch_aspect="ignore"
diff --git a/demos/2d/screen_space_shaders/engine.cfg b/demos/2d/screen_space_shaders/engine.cfg
index 108fdeba34..527e2f8f0a 100644
--- a/demos/2d/screen_space_shaders/engine.cfg
+++ b/demos/2d/screen_space_shaders/engine.cfg
@@ -3,3 +3,9 @@
name="Screen-Space Shaders"
main_scene="res://screen_shaders.scn"
+[display]
+
+width=780
+height=600
+stretch_mode="2d"
+stretch_aspect="keep"
diff --git a/demos/2d/screen_space_shaders/screen_shaders.scn b/demos/2d/screen_space_shaders/screen_shaders.scn
index cc62ac8203..fc2be96fc9 100644
--- a/demos/2d/screen_space_shaders/screen_shaders.scn
+++ b/demos/2d/screen_space_shaders/screen_shaders.scn
Binary files differ
diff --git a/demos/2d/texscreen/bubbles.scn b/demos/2d/texscreen/bubbles.scn
index 779cba6930..41026aceed 100644
--- a/demos/2d/texscreen/bubbles.scn
+++ b/demos/2d/texscreen/bubbles.scn
Binary files differ
diff --git a/demos/2d/texscreen/engine.cfg b/demos/2d/texscreen/engine.cfg
index 58193c8c4a..fb683dfc1d 100644
--- a/demos/2d/texscreen/engine.cfg
+++ b/demos/2d/texscreen/engine.cfg
@@ -2,3 +2,10 @@
name="Glass Bubbles (Texscreen)"
main_scene="res://bubbles.scn"
+
+[display]
+
+width=800
+height=600
+stretch_mode="2d"
+stretch_aspect="keep"