From e393e66a94d88335f9c4011d1c6c85aa83da4bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 19 Nov 2015 22:46:32 +0100 Subject: Rename polygon_path_finder demo and add icon --- demos/2d/polygon_path_finder/engine.cfg | 5 ++ demos/2d/polygon_path_finder/icon.png | Bin 0 -> 712 bytes demos/2d/polygon_path_finder/poly_with_holes.scn | Bin 0 -> 2974 bytes demos/2d/polygon_path_finder/polygonpathfinder.gd | 80 +++++++++++++++++++++ demos/2d/polygon_path_finder_demo/engine.cfg | 5 -- demos/2d/polygon_path_finder_demo/icon.png | Bin 3639 -> 0 bytes demos/2d/polygon_path_finder_demo/icon.png.flags | 1 - .../new_scene_poly_with_holes.scn | Bin 2609 -> 0 bytes .../polygon_path_finder_demo/polygonpathfinder.gd | 80 --------------------- 9 files changed, 85 insertions(+), 86 deletions(-) create mode 100644 demos/2d/polygon_path_finder/engine.cfg create mode 100644 demos/2d/polygon_path_finder/icon.png create mode 100644 demos/2d/polygon_path_finder/poly_with_holes.scn create mode 100644 demos/2d/polygon_path_finder/polygonpathfinder.gd delete mode 100644 demos/2d/polygon_path_finder_demo/engine.cfg delete mode 100644 demos/2d/polygon_path_finder_demo/icon.png delete mode 100644 demos/2d/polygon_path_finder_demo/icon.png.flags delete mode 100644 demos/2d/polygon_path_finder_demo/new_scene_poly_with_holes.scn delete mode 100644 demos/2d/polygon_path_finder_demo/polygonpathfinder.gd (limited to 'demos/2d') diff --git a/demos/2d/polygon_path_finder/engine.cfg b/demos/2d/polygon_path_finder/engine.cfg new file mode 100644 index 0000000000..47450408af --- /dev/null +++ b/demos/2d/polygon_path_finder/engine.cfg @@ -0,0 +1,5 @@ +[application] + +name="Polygon Pathfinder" +main_scene="res://poly_with_holes.scn" +icon="res://icon.png" diff --git a/demos/2d/polygon_path_finder/icon.png b/demos/2d/polygon_path_finder/icon.png new file mode 100644 index 0000000000..643f5595ee Binary files /dev/null and b/demos/2d/polygon_path_finder/icon.png differ diff --git a/demos/2d/polygon_path_finder/poly_with_holes.scn b/demos/2d/polygon_path_finder/poly_with_holes.scn new file mode 100644 index 0000000000..6b340377b7 Binary files /dev/null and b/demos/2d/polygon_path_finder/poly_with_holes.scn differ diff --git a/demos/2d/polygon_path_finder/polygonpathfinder.gd b/demos/2d/polygon_path_finder/polygonpathfinder.gd new file mode 100644 index 0000000000..a0e71dd127 --- /dev/null +++ b/demos/2d/polygon_path_finder/polygonpathfinder.gd @@ -0,0 +1,80 @@ + +extends Spatial + +func _ready(): + var pf = PolygonPathFinder.new() + + var points = Vector2Array() + var connections = IntArray() + + # poly 1 + points.push_back(Vector2(0, 0)) #0 + points.push_back(Vector2(10, 0)) #1 + points.push_back(Vector2(10, 10)) #2 + points.push_back(Vector2(0, 10)) #3 + + connections.push_back(0) # connect vertex 0 ... + connections.push_back(1) # ... to 1 + drawLine(points[0], points[1], get_node("/root/Spatial/Polys")) + connections.push_back(1) # connect vertex 1 ... + connections.push_back(2) # ... to 2 + drawLine(points[1], points[2], get_node("/root/Spatial/Polys")) + connections.push_back(2) # etc. + connections.push_back(3) + drawLine(points[2], points[3], get_node("/root/Spatial/Polys")) + connections.push_back(3) # connect vertex 3 ... + connections.push_back(0) # back to vertex 0, to close the polygon + drawLine(points[3], points[0], get_node("/root/Spatial/Polys")) + + # poly 2, as obstacle inside poly 1 + points.push_back(Vector2(2, 0.5)) #4 + points.push_back(Vector2(4, 0.5)) #5 + points.push_back(Vector2(4, 9.5)) #6 + points.push_back(Vector2(2, 9.5)) #7 + + connections.push_back(4) + connections.push_back(5) + drawLine(points[4], points[5], get_node("/root/Spatial/Polys")) + connections.push_back(5) + connections.push_back(6) + drawLine(points[5], points[6], get_node("/root/Spatial/Polys")) + connections.push_back(6) + connections.push_back(7) + drawLine(points[6], points[7], get_node("/root/Spatial/Polys")) + connections.push_back(7) + connections.push_back(4) + drawLine(points[7], points[4], get_node("/root/Spatial/Polys")) + + + print("points: ",points) + print("connections: ",connections) + + pf.setup(points, connections) + + var path = pf.find_path(Vector2(1, 5), Vector2(8, 5)) + + var lastStep = null + print("path: ",path) + for step in path: + print("step: ",step) + if (lastStep != null): + var currPathSegment = Vector2Array() + drawLine(lastStep, step, get_node("/root/Spatial/Path")) + lastStep = step + + + +func drawLine(pointA, pointB, immediateGeo): + var drawPosY = 0.1 + var im = immediateGeo + + im.begin(Mesh.PRIMITIVE_POINTS, null) + im.add_vertex(Vector3(pointA.x, drawPosY, pointA.y)) + im.add_vertex(Vector3(pointB.x, drawPosY, pointB.y)) + im.end() + im.begin(Mesh.PRIMITIVE_LINE_STRIP, null) + im.add_vertex(Vector3(pointA.x, drawPosY, pointA.y)) + im.add_vertex(Vector3(pointB.x, drawPosY, pointB.y)) + im.end() + + diff --git a/demos/2d/polygon_path_finder_demo/engine.cfg b/demos/2d/polygon_path_finder_demo/engine.cfg deleted file mode 100644 index de5593c417..0000000000 --- a/demos/2d/polygon_path_finder_demo/engine.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[application] - -name="polygon_path_finder_demo" -main_scene="res://new_scene_poly_with_holes.scn" -icon="res://icon.png" diff --git a/demos/2d/polygon_path_finder_demo/icon.png b/demos/2d/polygon_path_finder_demo/icon.png deleted file mode 100644 index 0c422e37b0..0000000000 Binary files a/demos/2d/polygon_path_finder_demo/icon.png and /dev/null differ diff --git a/demos/2d/polygon_path_finder_demo/icon.png.flags b/demos/2d/polygon_path_finder_demo/icon.png.flags deleted file mode 100644 index dbef2209e8..0000000000 --- a/demos/2d/polygon_path_finder_demo/icon.png.flags +++ /dev/null @@ -1 +0,0 @@ -gen_mipmaps=true diff --git a/demos/2d/polygon_path_finder_demo/new_scene_poly_with_holes.scn b/demos/2d/polygon_path_finder_demo/new_scene_poly_with_holes.scn deleted file mode 100644 index 07838be41e..0000000000 Binary files a/demos/2d/polygon_path_finder_demo/new_scene_poly_with_holes.scn and /dev/null differ diff --git a/demos/2d/polygon_path_finder_demo/polygonpathfinder.gd b/demos/2d/polygon_path_finder_demo/polygonpathfinder.gd deleted file mode 100644 index a0e71dd127..0000000000 --- a/demos/2d/polygon_path_finder_demo/polygonpathfinder.gd +++ /dev/null @@ -1,80 +0,0 @@ - -extends Spatial - -func _ready(): - var pf = PolygonPathFinder.new() - - var points = Vector2Array() - var connections = IntArray() - - # poly 1 - points.push_back(Vector2(0, 0)) #0 - points.push_back(Vector2(10, 0)) #1 - points.push_back(Vector2(10, 10)) #2 - points.push_back(Vector2(0, 10)) #3 - - connections.push_back(0) # connect vertex 0 ... - connections.push_back(1) # ... to 1 - drawLine(points[0], points[1], get_node("/root/Spatial/Polys")) - connections.push_back(1) # connect vertex 1 ... - connections.push_back(2) # ... to 2 - drawLine(points[1], points[2], get_node("/root/Spatial/Polys")) - connections.push_back(2) # etc. - connections.push_back(3) - drawLine(points[2], points[3], get_node("/root/Spatial/Polys")) - connections.push_back(3) # connect vertex 3 ... - connections.push_back(0) # back to vertex 0, to close the polygon - drawLine(points[3], points[0], get_node("/root/Spatial/Polys")) - - # poly 2, as obstacle inside poly 1 - points.push_back(Vector2(2, 0.5)) #4 - points.push_back(Vector2(4, 0.5)) #5 - points.push_back(Vector2(4, 9.5)) #6 - points.push_back(Vector2(2, 9.5)) #7 - - connections.push_back(4) - connections.push_back(5) - drawLine(points[4], points[5], get_node("/root/Spatial/Polys")) - connections.push_back(5) - connections.push_back(6) - drawLine(points[5], points[6], get_node("/root/Spatial/Polys")) - connections.push_back(6) - connections.push_back(7) - drawLine(points[6], points[7], get_node("/root/Spatial/Polys")) - connections.push_back(7) - connections.push_back(4) - drawLine(points[7], points[4], get_node("/root/Spatial/Polys")) - - - print("points: ",points) - print("connections: ",connections) - - pf.setup(points, connections) - - var path = pf.find_path(Vector2(1, 5), Vector2(8, 5)) - - var lastStep = null - print("path: ",path) - for step in path: - print("step: ",step) - if (lastStep != null): - var currPathSegment = Vector2Array() - drawLine(lastStep, step, get_node("/root/Spatial/Path")) - lastStep = step - - - -func drawLine(pointA, pointB, immediateGeo): - var drawPosY = 0.1 - var im = immediateGeo - - im.begin(Mesh.PRIMITIVE_POINTS, null) - im.add_vertex(Vector3(pointA.x, drawPosY, pointA.y)) - im.add_vertex(Vector3(pointB.x, drawPosY, pointB.y)) - im.end() - im.begin(Mesh.PRIMITIVE_LINE_STRIP, null) - im.add_vertex(Vector3(pointA.x, drawPosY, pointA.y)) - im.add_vertex(Vector3(pointB.x, drawPosY, pointB.y)) - im.end() - - -- cgit v1.2.3 From 9d225016304f14ed0391622d96a32d2ff9ead724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 19 Nov 2015 23:45:19 +0100 Subject: Add icons to all demos that can have a meaningful one --- demos/2d/fog_of_war/icon.png.flags | 1 - demos/2d/lookat/engine.cfg | 1 + demos/2d/lookat/icon.png | Bin 0 -> 1495 bytes demos/2d/motion/engine.cfg | 1 + demos/2d/motion/icon.png | Bin 0 -> 2621 bytes demos/2d/texscreen/engine.cfg | 1 + demos/2d/texscreen/icon.png | Bin 0 -> 9245 bytes 7 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 demos/2d/fog_of_war/icon.png.flags create mode 100644 demos/2d/lookat/icon.png create mode 100644 demos/2d/motion/icon.png create mode 100644 demos/2d/texscreen/icon.png (limited to 'demos/2d') diff --git a/demos/2d/fog_of_war/icon.png.flags b/demos/2d/fog_of_war/icon.png.flags deleted file mode 100644 index dbef2209e8..0000000000 --- a/demos/2d/fog_of_war/icon.png.flags +++ /dev/null @@ -1 +0,0 @@ -gen_mipmaps=true diff --git a/demos/2d/lookat/engine.cfg b/demos/2d/lookat/engine.cfg index 56917a39ec..81df107f0e 100644 --- a/demos/2d/lookat/engine.cfg +++ b/demos/2d/lookat/engine.cfg @@ -2,3 +2,4 @@ name="Look At Pointer" main_scene="res://lookat.scn" +icon="res://icon.png" diff --git a/demos/2d/lookat/icon.png b/demos/2d/lookat/icon.png new file mode 100644 index 0000000000..442cc1799f Binary files /dev/null and b/demos/2d/lookat/icon.png differ diff --git a/demos/2d/motion/engine.cfg b/demos/2d/motion/engine.cfg index 261111904c..6e660572d6 100644 --- a/demos/2d/motion/engine.cfg +++ b/demos/2d/motion/engine.cfg @@ -2,6 +2,7 @@ name="Motion Test" main_scene="res://motion.scn" +icon="res://icon.png" [display] diff --git a/demos/2d/motion/icon.png b/demos/2d/motion/icon.png new file mode 100644 index 0000000000..9e64961d3c Binary files /dev/null and b/demos/2d/motion/icon.png differ diff --git a/demos/2d/texscreen/engine.cfg b/demos/2d/texscreen/engine.cfg index fb683dfc1d..92d0e98d5b 100644 --- a/demos/2d/texscreen/engine.cfg +++ b/demos/2d/texscreen/engine.cfg @@ -2,6 +2,7 @@ name="Glass Bubbles (Texscreen)" main_scene="res://bubbles.scn" +icon="res://icon.png" [display] diff --git a/demos/2d/texscreen/icon.png b/demos/2d/texscreen/icon.png new file mode 100644 index 0000000000..d74d025ced Binary files /dev/null and b/demos/2d/texscreen/icon.png differ -- cgit v1.2.3 From b6c6e2f5e5daa1203807aef6be1b2e44af7f5392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 23 Nov 2015 00:19:00 +0100 Subject: Make all demo icons 8-bit/color RGB(A) Godot does not seem to like 8-bit colormaps. Fixes #2874. --- demos/2d/area_input/icon.png | Bin 1684 -> 3416 bytes demos/2d/dynamic_collision_shapes/icon.png | Bin 844 -> 1563 bytes demos/2d/hdr/icon.png | Bin 2670 -> 3962 bytes demos/2d/isometric_light/icon.png | Bin 3638 -> 7675 bytes demos/2d/light_mask/icon.png | Bin 3344 -> 6285 bytes demos/2d/lights_shadows/icon.png | Bin 2733 -> 3988 bytes demos/2d/navpoly/icon.png | Bin 2420 -> 3642 bytes demos/2d/normalmaps/icon.png | Bin 4876 -> 10402 bytes demos/2d/screen_space_shaders/icon.png | Bin 3341 -> 7479 bytes demos/2d/sdf_font/icon.png | Bin 1534 -> 3560 bytes demos/2d/splash/icon.png | Bin 3408 -> 7041 bytes demos/2d/sprite_shaders/icon.png | Bin 3934 -> 8209 bytes 12 files changed, 0 insertions(+), 0 deletions(-) (limited to 'demos/2d') diff --git a/demos/2d/area_input/icon.png b/demos/2d/area_input/icon.png index d9bb881693..2f412ecf68 100644 Binary files a/demos/2d/area_input/icon.png and b/demos/2d/area_input/icon.png differ diff --git a/demos/2d/dynamic_collision_shapes/icon.png b/demos/2d/dynamic_collision_shapes/icon.png index ac01d401ba..b47506d7c8 100644 Binary files a/demos/2d/dynamic_collision_shapes/icon.png and b/demos/2d/dynamic_collision_shapes/icon.png differ diff --git a/demos/2d/hdr/icon.png b/demos/2d/hdr/icon.png index 2df0ec38e9..461cd4638a 100644 Binary files a/demos/2d/hdr/icon.png and b/demos/2d/hdr/icon.png differ diff --git a/demos/2d/isometric_light/icon.png b/demos/2d/isometric_light/icon.png index 3de9749729..0801f78ea5 100644 Binary files a/demos/2d/isometric_light/icon.png and b/demos/2d/isometric_light/icon.png differ diff --git a/demos/2d/light_mask/icon.png b/demos/2d/light_mask/icon.png index c12b045e62..34a6b709f6 100644 Binary files a/demos/2d/light_mask/icon.png and b/demos/2d/light_mask/icon.png differ diff --git a/demos/2d/lights_shadows/icon.png b/demos/2d/lights_shadows/icon.png index c7f9e13bae..554f01bb46 100644 Binary files a/demos/2d/lights_shadows/icon.png and b/demos/2d/lights_shadows/icon.png differ diff --git a/demos/2d/navpoly/icon.png b/demos/2d/navpoly/icon.png index df7fb43633..7a28a367c6 100644 Binary files a/demos/2d/navpoly/icon.png and b/demos/2d/navpoly/icon.png differ diff --git a/demos/2d/normalmaps/icon.png b/demos/2d/normalmaps/icon.png index 4e5d835005..11ff5de829 100644 Binary files a/demos/2d/normalmaps/icon.png and b/demos/2d/normalmaps/icon.png differ diff --git a/demos/2d/screen_space_shaders/icon.png b/demos/2d/screen_space_shaders/icon.png index 65247f9ae7..e3cc049081 100644 Binary files a/demos/2d/screen_space_shaders/icon.png and b/demos/2d/screen_space_shaders/icon.png differ diff --git a/demos/2d/sdf_font/icon.png b/demos/2d/sdf_font/icon.png index be9fefa8b0..0c700ad77c 100644 Binary files a/demos/2d/sdf_font/icon.png and b/demos/2d/sdf_font/icon.png differ diff --git a/demos/2d/splash/icon.png b/demos/2d/splash/icon.png index 88620eb35b..b8e24f209e 100644 Binary files a/demos/2d/splash/icon.png and b/demos/2d/splash/icon.png differ diff --git a/demos/2d/sprite_shaders/icon.png b/demos/2d/sprite_shaders/icon.png index b044b31f93..8b13ef6bb4 100644 Binary files a/demos/2d/sprite_shaders/icon.png and b/demos/2d/sprite_shaders/icon.png differ -- cgit v1.2.3