From 107d2a373a4a66bc237cc47128f815c2624c35bb Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sun, 11 Jan 2015 20:30:57 +0800 Subject: Demo misc/window_management added --- demos/misc/window_management/control.gd | 39 +++++++++++++++++++++ demos/misc/window_management/engine.cfg | 5 +++ demos/misc/window_management/icon.png | Bin 0 -> 3639 bytes demos/misc/window_management/icon.png.flags | 1 + demos/misc/window_management/window_management.scn | Bin 0 -> 3276 bytes 5 files changed, 45 insertions(+) create mode 100644 demos/misc/window_management/control.gd create mode 100644 demos/misc/window_management/engine.cfg create mode 100644 demos/misc/window_management/icon.png create mode 100644 demos/misc/window_management/icon.png.flags create mode 100644 demos/misc/window_management/window_management.scn (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd new file mode 100644 index 0000000000..3e74f24e42 --- /dev/null +++ b/demos/misc/window_management/control.gd @@ -0,0 +1,39 @@ + +extends Control + +func _fixed_process(delta): + if(OS.is_fullscreen()): + get_node("Label_Fullscreen").set_text("Mode:\nFullscreen") + else: + get_node("Label_Fullscreen").set_text("Mode:\nWindowed") + + 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_Screen_Count").set_text( str("Screens:\n", OS.get_screen_count() ) ) + + get_node("Label_Screen0_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size() ) ) + + if(OS.get_screen_count() > 1): + get_node("Label_Screen1_Resolution").show() + get_node("Label_Screen1_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size(1) ) ) + + +func _ready(): + set_fixed_process(true) + + +func _on_Fullscreen_toggled( pressed ): + if(pressed): + OS.set_fullscreen(true) + else: + OS.set_fullscreen(false) + + +func _on_Button_MoveTo_pressed(): + OS.set_window_position( Vector2(100,100) ) + + +func _on_Button_Resize_pressed(): + OS.set_window_size( Vector2(1024,768) ) diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg new file mode 100644 index 0000000000..7b6dddce96 --- /dev/null +++ b/demos/misc/window_management/engine.cfg @@ -0,0 +1,5 @@ +[application] + +name="window_management" +main_scene="res://window_management.scn" +icon="icon.png" diff --git a/demos/misc/window_management/icon.png b/demos/misc/window_management/icon.png new file mode 100644 index 0000000000..0c422e37b0 Binary files /dev/null and b/demos/misc/window_management/icon.png differ diff --git a/demos/misc/window_management/icon.png.flags b/demos/misc/window_management/icon.png.flags new file mode 100644 index 0000000000..5130fd1aab --- /dev/null +++ b/demos/misc/window_management/icon.png.flags @@ -0,0 +1 @@ +gen_mipmaps=false diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn new file mode 100644 index 0000000000..6eaf62ff9f Binary files /dev/null and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From ce7c7a862ebe37fada7708c342c07d70fa80465a Mon Sep 17 00:00:00 2001 From: hurikhan Date: Tue, 13 Jan 2015 17:25:50 +0800 Subject: get_screen_position() added --- demos/misc/window_management/control.gd | 11 ++++++++--- demos/misc/window_management/window_management.scn | Bin 3276 -> 3582 bytes 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 3e74f24e42..ad15a74731 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -15,11 +15,16 @@ func _fixed_process(delta): 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())) + if(OS.get_screen_count() > 1): get_node("Label_Screen1_Resolution").show() - get_node("Label_Screen1_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size(1) ) ) - - + get_node("Label_Screen1_Resolution").set_text( str("Screen1 Resolution:\n", OS.get_screen_size(1) ) ) + get_node("Label_Screen1_Position").show() + get_node("Label_Screen1_Position").set_text( str("Screen1 Position:\n", OS.get_screen_size(1) ) ) + else: + get_node("Label_Screen1_Resolution").hide() + get_node("Label_Screen1_Position").hide() func _ready(): set_fixed_process(true) diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 6eaf62ff9f..3a6426f3ee 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From f55c0e928580de63af55ac22f045bb4380a1df2e Mon Sep 17 00:00:00 2001 From: hurikhan Date: Tue, 13 Jan 2015 21:01:24 +0800 Subject: Using Xinerama extension for getting screen info --- demos/misc/window_management/control.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index ad15a74731..34df5dd92c 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -21,7 +21,7 @@ func _fixed_process(delta): get_node("Label_Screen1_Resolution").show() get_node("Label_Screen1_Resolution").set_text( str("Screen1 Resolution:\n", OS.get_screen_size(1) ) ) get_node("Label_Screen1_Position").show() - get_node("Label_Screen1_Position").set_text( str("Screen1 Position:\n", OS.get_screen_size(1) ) ) + get_node("Label_Screen1_Position").set_text( str("Screen1 Position:\n", OS.get_screen_position(1) ) ) else: get_node("Label_Screen1_Resolution").hide() get_node("Label_Screen1_Position").hide() -- cgit v1.2.3 From 790d8ecbb9a0a0ac67520b84fc621c34f910d817 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Wed, 14 Jan 2015 12:02:59 +0800 Subject: get_screen() + set_screen() added --- demos/misc/window_management/control.gd | 27 ++++++++++++++++++++- demos/misc/window_management/engine.cfg | 4 +++ demos/misc/window_management/window_management.scn | Bin 3582 -> 3787 bytes 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 34df5dd92c..ce17db6b00 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -13,18 +13,35 @@ func _fixed_process(delta): get_node("Label_Screen_Count").set_text( str("Screens:\n", OS.get_screen_count() ) ) + get_node("Label_Screen_Current").set_text( str("Current:\n", OS.get_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())) if(OS.get_screen_count() > 1): + get_node("Button_Screen1").show() get_node("Label_Screen1_Resolution").show() - get_node("Label_Screen1_Resolution").set_text( str("Screen1 Resolution:\n", OS.get_screen_size(1) ) ) get_node("Label_Screen1_Position").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) ) ) else: + get_node("Button_Screen1").hide() get_node("Label_Screen1_Resolution").hide() get_node("Label_Screen1_Position").hide() + + if( Input.is_action_pressed("ui_right")): + OS.set_screen(1) + + if( Input.is_action_pressed("ui_left")): + OS.set_screen(0) + + if( Input.is_action_pressed("ui_up")): + OS.set_fullscreen(true) + + if( Input.is_action_pressed("ui_down")): + OS.set_fullscreen(false) + func _ready(): set_fixed_process(true) @@ -42,3 +59,11 @@ func _on_Button_MoveTo_pressed(): func _on_Button_Resize_pressed(): OS.set_window_size( Vector2(1024,768) ) + + +func _on_Button_Screen0_pressed(): + OS.set_screen(0) + + +func _on_Button_Screen1_pressed(): + OS.set_screen(1) diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg index 7b6dddce96..44ad30ea14 100644 --- a/demos/misc/window_management/engine.cfg +++ b/demos/misc/window_management/engine.cfg @@ -3,3 +3,7 @@ name="window_management" main_scene="res://window_management.scn" icon="icon.png" + +[display] + +fullscreen=true diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 3a6426f3ee..9d55174dce 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From 2203ba5fe3f7cdca078dd557ec532b7f335d3670 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Wed, 14 Jan 2015 13:27:03 +0800 Subject: don't start demo in fullscreen mode --- demos/misc/window_management/engine.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'demos') diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg index 44ad30ea14..bdc8ec3ed7 100644 --- a/demos/misc/window_management/engine.cfg +++ b/demos/misc/window_management/engine.cfg @@ -6,4 +6,5 @@ icon="icon.png" [display] -fullscreen=true +fullscreen=false +resizable=false -- cgit v1.2.3 From 07b8d9136a6ccea1587d27ca30db1ec10aca0ed1 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Wed, 14 Jan 2015 15:44:47 +0800 Subject: demo window set to resizeable (need a bugfix her) --- demos/misc/window_management/engine.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos') diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg index bdc8ec3ed7..2accafe43e 100644 --- a/demos/misc/window_management/engine.cfg +++ b/demos/misc/window_management/engine.cfg @@ -7,4 +7,4 @@ icon="icon.png" [display] fullscreen=false -resizable=false +resizable=true -- cgit v1.2.3 From d269344bbd19d9653fff3c2a230261b8fa00d7f6 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Thu, 15 Jan 2015 22:50:23 +0900 Subject: WIP -- set_resizable() + is_resizable added --- demos/misc/window_management/control.gd | 28 +++++++++++++++++++-- demos/misc/window_management/window_management.scn | Bin 3787 -> 3897 bytes 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index ce17db6b00..c867bd21db 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -2,10 +2,18 @@ extends Control func _fixed_process(delta): + + var modetext = "Mode:\n" + if(OS.is_fullscreen()): - get_node("Label_Fullscreen").set_text("Mode:\nFullscreen") + modetext += "Fullscreen\n" else: - get_node("Label_Fullscreen").set_text("Mode:\nWindowed") + modetext += "Windowed\n" + + if(!OS.is_resizable()): + modetext += "FixedSize\n" + + get_node("Label_Mode").set_text(modetext) get_node("Label_Position").set_text( str("Position:\n", OS.get_window_position() ) ) @@ -19,6 +27,7 @@ func _fixed_process(delta): get_node("Label_Screen0_Position").set_text(str("Screen0 Position:\n",OS.get_screen_position())) + if(OS.get_screen_count() > 1): get_node("Button_Screen1").show() get_node("Label_Screen1_Resolution").show() @@ -42,6 +51,9 @@ func _fixed_process(delta): if( Input.is_action_pressed("ui_down")): OS.set_fullscreen(false) + get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) + + func _ready(): set_fixed_process(true) @@ -67,3 +79,15 @@ func _on_Button_Screen0_pressed(): func _on_Button_Screen1_pressed(): OS.set_screen(1) + + + + + +func _on_Button_FixedSize_pressed(): + if(OS.is_resizable()): + OS.set_resizable(false) + else: + OS.set_resizable(true) + + diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 9d55174dce..befc177b5e 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From d42fa511a51db582849470316dfd1f0eee459350 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Fri, 16 Jan 2015 13:49:46 +0900 Subject: rearrange the demo --- demos/misc/window_management/control.gd | 4 +--- demos/misc/window_management/window_management.scn | Bin 3897 -> 3931 bytes 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index c867bd21db..043db8d489 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -19,9 +19,7 @@ func _fixed_process(delta): get_node("Label_Size").set_text(str("Size:\n", OS.get_window_size() ) ) - get_node("Label_Screen_Count").set_text( str("Screens:\n", OS.get_screen_count() ) ) - - get_node("Label_Screen_Current").set_text( str("Current:\n", OS.get_screen() ) ) + get_node("Label_Screen_Info").set_text( str("Screens:\n", OS.get_screen_count(),"\n\nCurrent:\n", OS.get_screen() ) ) get_node("Label_Screen0_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size() ) ) diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index befc177b5e..a83897f9a0 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From 716971655eb9ab7909447e2f5d4911b6f45164bb Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sat, 17 Jan 2015 00:18:45 +0900 Subject: added the following methods: * set_minimized(bool) * bool is_minimized() * set_maximized(bool) * bool is_maximized() --- demos/misc/window_management/control.gd | 33 ++++++++++++++++----- demos/misc/window_management/window_management.scn | Bin 3931 -> 4111 bytes 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 043db8d489..fd746cf036 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -13,17 +13,25 @@ func _fixed_process(delta): if(!OS.is_resizable()): modetext += "FixedSize\n" + if(OS.is_minimized()): + modetext += "Minimized\n" + + if(OS.is_maximized()): + modetext += "Maximized\n" + 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_Screen_Info").set_text( str("Screens:\n", OS.get_screen_count(),"\n\nCurrent:\n", OS.get_screen() ) ) + get_node("Label_Screen_Count").set_text( str("Screens:\n", OS.get_screen_count() ) ) + + get_node("Label_Screen_Current").set_text( str("Current:\n", OS.get_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_Position").set_text(str("Screen0 Position:\n",OS.get_screen_position() ) ) if(OS.get_screen_count() > 1): @@ -50,8 +58,9 @@ func _fixed_process(delta): OS.set_fullscreen(false) get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) - - + get_node("Button_Minimized").set_pressed( OS.is_minimized() ) + get_node("Button_Maximized").set_pressed( OS.is_maximized() ) + func _ready(): set_fixed_process(true) @@ -79,9 +88,6 @@ func _on_Button_Screen1_pressed(): OS.set_screen(1) - - - func _on_Button_FixedSize_pressed(): if(OS.is_resizable()): OS.set_resizable(false) @@ -89,3 +95,16 @@ func _on_Button_FixedSize_pressed(): OS.set_resizable(true) + +func _on_Button_Minimized_pressed(): + if(OS.is_minimized()): + OS.set_minimized(false) + else: + OS.set_minimized(true) + + +func _on_Button_Maximized_pressed(): + if(OS.is_maximized()): + OS.set_maximized(false) + else: + OS.set_maximized(true) diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index a83897f9a0..635f6f6f28 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From f1dc00e380439078c93d00af2f85d138a9400b2e Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sat, 17 Jan 2015 19:43:12 +0900 Subject: * cleanup window state handling * first attemps in handling ALT+TABa (WIP) --- demos/misc/window_management/control.gd | 28 +++++++++++++-------- demos/misc/window_management/window_management.scn | Bin 4111 -> 4052 bytes 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index fd746cf036..4929b1376c 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -25,9 +25,9 @@ func _fixed_process(delta): get_node("Label_Size").set_text(str("Size:\n", OS.get_window_size() ) ) - get_node("Label_Screen_Count").set_text( str("Screens:\n", OS.get_screen_count() ) ) + get_node("Label_Screen_Count").set_text( str("Screen_Count:\n", OS.get_screen_count() ) ) - get_node("Label_Screen_Current").set_text( str("Current:\n", OS.get_screen() ) ) + get_node("Label_Screen_Current").set_text( str("Screen:\n", OS.get_screen() ) ) get_node("Label_Screen0_Resolution").set_text( str("Screen0 Resolution:\n", OS.get_screen_size() ) ) @@ -35,12 +35,14 @@ func _fixed_process(delta): 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_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) ) ) else: + get_node("Button_Screen0").hide() get_node("Button_Screen1").hide() get_node("Label_Screen1_Resolution").hide() get_node("Label_Screen1_Position").hide() @@ -57,19 +59,14 @@ func _fixed_process(delta): if( Input.is_action_pressed("ui_down")): OS.set_fullscreen(false) + get_node("Button_Fullscreen").set_pressed( OS.is_fullscreen() ) get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) get_node("Button_Minimized").set_pressed( OS.is_minimized() ) get_node("Button_Maximized").set_pressed( OS.is_maximized() ) - -func _ready(): - set_fixed_process(true) -func _on_Fullscreen_toggled( pressed ): - if(pressed): - OS.set_fullscreen(true) - else: - OS.set_fullscreen(false) +func _ready(): + set_fixed_process(true) func _on_Button_MoveTo_pressed(): @@ -88,12 +85,18 @@ func _on_Button_Screen1_pressed(): OS.set_screen(1) +func _on_Button_Fullscreen_pressed(): + if(OS.is_fullscreen()): + OS.set_fullscreen(false) + else: + OS.set_fullscreen(true) + + func _on_Button_FixedSize_pressed(): if(OS.is_resizable()): OS.set_resizable(false) else: OS.set_resizable(true) - func _on_Button_Minimized_pressed(): @@ -108,3 +111,6 @@ func _on_Button_Maximized_pressed(): OS.set_maximized(false) else: OS.set_maximized(true) + + + diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 635f6f6f28..3d62d4ecc1 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From dfb5a1d5e1318d91f26c0f7663afe861005104c8 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sun, 18 Jan 2015 00:28:04 +0900 Subject: * multi_screen testing + bugfixes * ALT-TAB is working * tested on Ubuntu 14.10 Unity + LXDE * minor cleanup --- demos/misc/window_management/engine.cfg | 2 ++ demos/misc/window_management/window_management.scn | Bin 4052 -> 4030 bytes 2 files changed, 2 insertions(+) (limited to 'demos') diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg index 2accafe43e..6ce3d51aee 100644 --- a/demos/misc/window_management/engine.cfg +++ b/demos/misc/window_management/engine.cfg @@ -8,3 +8,5 @@ icon="icon.png" fullscreen=false resizable=true +width=800 +height=600 diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 3d62d4ecc1..baf03bdfd1 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From 94d94a08558c83fb6e447c3e1ed858cf39c0e1ba Mon Sep 17 00:00:00 2001 From: hurikhan Date: Thu, 22 Jan 2015 01:14:50 +0900 Subject: * fix compilation without scons experimental_wm_api=yes * Extended the demo with an addional MouseGrab Test --- demos/misc/window_management/control.gd | 6 ++++-- demos/misc/window_management/engine.cfg | 7 +++++++ demos/misc/window_management/window_management.scn | Bin 4030 -> 4268 bytes 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 4929b1376c..6dc9282149 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -33,7 +33,6 @@ func _fixed_process(delta): get_node("Label_Screen0_Position").set_text(str("Screen0 Position:\n",OS.get_screen_position() ) ) - if(OS.get_screen_count() > 1): get_node("Button_Screen0").show() get_node("Button_Screen1").show() @@ -63,6 +62,7 @@ func _fixed_process(delta): get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) get_node("Button_Minimized").set_pressed( OS.is_minimized() ) get_node("Button_Maximized").set_pressed( OS.is_maximized() ) + get_node("Button_Mouse_Grab").set_pressed( Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED ) func _ready(): @@ -113,4 +113,6 @@ func _on_Button_Maximized_pressed(): OS.set_maximized(true) - +func _on_Button_Mouse_Grab_pressed(): + var observer = get_node("../Observer") + observer.state = observer.STATE_GRAB diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg index 6ce3d51aee..c53bd45fb7 100644 --- a/demos/misc/window_management/engine.cfg +++ b/demos/misc/window_management/engine.cfg @@ -10,3 +10,10 @@ fullscreen=false resizable=true width=800 height=600 + +[input] + +move_forward=[key(W)] +move_backwards=[key(S)] +move_left=[key(A)] +move_right=[key(D)] diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index baf03bdfd1..40e6e64cef 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From 2204914abfc939e16cc595a6b175ff74b6552a6c Mon Sep 17 00:00:00 2001 From: hurikhan Date: Thu, 22 Jan 2015 01:54:17 +0900 Subject: * observer scene for the demo --- demos/misc/window_management/observer/observer.gd | 78 ++++++++++++++++ demos/misc/window_management/observer/observer.scn | Bin 0 -> 1786 bytes .../window_management/observer/observer_hud.gd | 98 +++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 demos/misc/window_management/observer/observer.gd create mode 100644 demos/misc/window_management/observer/observer.scn create mode 100644 demos/misc/window_management/observer/observer_hud.gd (limited to 'demos') diff --git a/demos/misc/window_management/observer/observer.gd b/demos/misc/window_management/observer/observer.gd new file mode 100644 index 0000000000..7bec0f5301 --- /dev/null +++ b/demos/misc/window_management/observer/observer.gd @@ -0,0 +1,78 @@ + +extends Spatial + +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 diff --git a/demos/misc/window_management/observer/observer.scn b/demos/misc/window_management/observer/observer.scn new file mode 100644 index 0000000000..da29ad62b8 Binary files /dev/null and b/demos/misc/window_management/observer/observer.scn differ diff --git a/demos/misc/window_management/observer/observer_hud.gd b/demos/misc/window_management/observer/observer_hud.gd new file mode 100644 index 0000000000..24e81b02ba --- /dev/null +++ b/demos/misc/window_management/observer/observer_hud.gd @@ -0,0 +1,98 @@ +var parent + +func printdebug(): + + var s + + if(parent.state == parent.STATE_GAME): + s = str( "TIME_FPS: ", Performance.get_monitor(Performance.TIME_FPS), "\n") + s += str("OBJECT_COUNT: ", Performance.get_monitor(Performance.OBJECT_COUNT), "\n") + s += str("OBJECT_RESOURCE_COUNT : ", Performance.get_monitor(Performance.OBJECT_RESOURCE_COUNT), "\n") + s += str("OBJECT_NODE_COUNT : ", Performance.get_monitor(Performance.OBJECT_NODE_COUNT), "\n") + s += str("RENDER_OBJECTS_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_OBJECTS_IN_FRAME), "\n") + s += str("RENDER_VERTICES_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_VERTICES_IN_FRAME), "\n") + s += str("RENDER_DRAW_CALLS_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_DRAW_CALLS_IN_FRAME), "\n") + s += str("RENDER_VERTICES_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_VERTICES_IN_FRAME), "\n") + # s += str("RENDER_USAGE_VIDEO_MEM_TOTAL : ", Performance.get_monitor(Performance.RENDER_USAGE_VIDEO_MEM_TOTAL), "\n") + # s += str("RENDER_VIDEO_MEM_USED : ", Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED), "\n") + # s += str("RENDER_TEXTURE_MEM_USED : ", Performance.get_monitor(Performance.RENDER_TEXTURE_MEM_USED), "\n") + # s += str("RENDER_VERTEX_MEM_USED : ", Performance.get_monitor(Performance.RENDER_VERTEX_MEM_USED), "\n") + s += str("CUBES: ", get_node("/root/World").world.size(), "\n") + else: + s = "" + + get_node("Label_Debug").set_text(s) + + +func _fixed_process(delta): + parent = get_parent() + + printdebug() + + if( parent.state == parent.STATE_MENU ): + get_node("Menu").show() + else: + get_node("Menu").hide() + + + +func _ready(): + set_fixed_process(true) + + +func _on_Fullscreen_toggled( pressed ): + if( pressed ): + OS.set_fullscreen(true) + else: + OS.set_fullscreen(false) + + +func _on_DebugInfo_toggled( pressed ): + if( pressed ): + get_node("Label_Debug").show() + else: + get_node("Label_Debug").hide() + + +func _on_Save_pressed(): + var file_dialog = get_node("Menu/SaveDialog") + file_dialog.clear_filters() + file_dialog.add_filter("*.json") + file_dialog.set_mode(3) + file_dialog.show() + file_dialog._update_file_list() + + +func _on_SaveDialog_file_selected( path ): + get_node("/root/World").save_world( path ) + + +func _on_Load_pressed(): + var file_dialog = get_node("Menu/LoadDialog") + file_dialog.clear_filters() + file_dialog.add_filter("*.json") + file_dialog.set_mode(0) + file_dialog.show() + file_dialog._update_file_list() + + +func _on_LoadDialog_file_selected( path ): + get_node("/root/World").load_world( path ) + + +func _on_Server_toggled( pressed ): + if pressed: + get_node("/root/World/Server").start() + get_node("Menu/Client").hide() + else: + get_node("/root/World/Server").stop() + get_node("Menu/Client").show() + + +func _on_Client_toggled( pressed ): + if pressed: + get_node("/root/World/Client").start() + get_node("Menu/Server").hide() + else: + get_node("/root/World/Client").stop() + get_node("Menu/Server").show() \ No newline at end of file -- cgit v1.2.3 From 03c453ac7dc2b22bfb864e563b7f3b8424bbcff4 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Thu, 22 Jan 2015 05:35:39 +0900 Subject: * Cleanup for PR * Demo shows a Dialog with not implemented methods at startup --- demos/misc/window_management/control.gd | 68 +++++++++++++- demos/misc/window_management/observer/observer.gd | 1 + .../window_management/observer/observer_hud.gd | 98 --------------------- demos/misc/window_management/window_management.scn | Bin 4268 -> 4744 bytes 4 files changed, 68 insertions(+), 99 deletions(-) delete mode 100644 demos/misc/window_management/observer/observer_hud.gd (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 6dc9282149..d329237aed 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -19,6 +19,9 @@ func _fixed_process(delta): if(OS.is_maximized()): modetext += "Maximized\n" + if(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED): + modetext += "MouseGrab\n" + get_node("Label_Mode").set_text(modetext) get_node("Label_Position").set_text( str("Position:\n", OS.get_window_position() ) ) @@ -65,8 +68,71 @@ func _fixed_process(delta): get_node("Button_Mouse_Grab").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_screen") ): + s += " - get_screen()\n" + + if( !OS.has_method("set_screen") ): + s += " - set_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_fullscreen") ): + s += " - set_fullscreen()\n" + + if( !OS.has_method("is_fullscreen") ): + s += " - is_fullscreen()\n" + + if( !OS.has_method("set_resizable") ): + s += " - set_resizable()\n" + + if( !OS.has_method("is_resizable") ): + s += " - is_resizable()\n" + + if( !OS.has_method("set_minimized") ): + s += " - set_minimized()\n" + + if( !OS.has_method("is_minimized") ): + s += " - is_minimized()\n" + + if( !OS.has_method("set_maximized") ): + s += " - set_maximized()\n" + + if( !OS.has_method("is_maximized") ): + s += " - is_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(): - set_fixed_process(true) + if( check_wm_api() ): + set_fixed_process(true) func _on_Button_MoveTo_pressed(): diff --git a/demos/misc/window_management/observer/observer.gd b/demos/misc/window_management/observer/observer.gd index 7bec0f5301..d27912a670 100644 --- a/demos/misc/window_management/observer/observer.gd +++ b/demos/misc/window_management/observer/observer.gd @@ -76,3 +76,4 @@ func _ready(): set_process_input(true) state = STATE_MENU + diff --git a/demos/misc/window_management/observer/observer_hud.gd b/demos/misc/window_management/observer/observer_hud.gd deleted file mode 100644 index 24e81b02ba..0000000000 --- a/demos/misc/window_management/observer/observer_hud.gd +++ /dev/null @@ -1,98 +0,0 @@ -var parent - -func printdebug(): - - var s - - if(parent.state == parent.STATE_GAME): - s = str( "TIME_FPS: ", Performance.get_monitor(Performance.TIME_FPS), "\n") - s += str("OBJECT_COUNT: ", Performance.get_monitor(Performance.OBJECT_COUNT), "\n") - s += str("OBJECT_RESOURCE_COUNT : ", Performance.get_monitor(Performance.OBJECT_RESOURCE_COUNT), "\n") - s += str("OBJECT_NODE_COUNT : ", Performance.get_monitor(Performance.OBJECT_NODE_COUNT), "\n") - s += str("RENDER_OBJECTS_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_OBJECTS_IN_FRAME), "\n") - s += str("RENDER_VERTICES_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_VERTICES_IN_FRAME), "\n") - s += str("RENDER_DRAW_CALLS_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_DRAW_CALLS_IN_FRAME), "\n") - s += str("RENDER_VERTICES_IN_FRAME : ", Performance.get_monitor(Performance.RENDER_VERTICES_IN_FRAME), "\n") - # s += str("RENDER_USAGE_VIDEO_MEM_TOTAL : ", Performance.get_monitor(Performance.RENDER_USAGE_VIDEO_MEM_TOTAL), "\n") - # s += str("RENDER_VIDEO_MEM_USED : ", Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED), "\n") - # s += str("RENDER_TEXTURE_MEM_USED : ", Performance.get_monitor(Performance.RENDER_TEXTURE_MEM_USED), "\n") - # s += str("RENDER_VERTEX_MEM_USED : ", Performance.get_monitor(Performance.RENDER_VERTEX_MEM_USED), "\n") - s += str("CUBES: ", get_node("/root/World").world.size(), "\n") - else: - s = "" - - get_node("Label_Debug").set_text(s) - - -func _fixed_process(delta): - parent = get_parent() - - printdebug() - - if( parent.state == parent.STATE_MENU ): - get_node("Menu").show() - else: - get_node("Menu").hide() - - - -func _ready(): - set_fixed_process(true) - - -func _on_Fullscreen_toggled( pressed ): - if( pressed ): - OS.set_fullscreen(true) - else: - OS.set_fullscreen(false) - - -func _on_DebugInfo_toggled( pressed ): - if( pressed ): - get_node("Label_Debug").show() - else: - get_node("Label_Debug").hide() - - -func _on_Save_pressed(): - var file_dialog = get_node("Menu/SaveDialog") - file_dialog.clear_filters() - file_dialog.add_filter("*.json") - file_dialog.set_mode(3) - file_dialog.show() - file_dialog._update_file_list() - - -func _on_SaveDialog_file_selected( path ): - get_node("/root/World").save_world( path ) - - -func _on_Load_pressed(): - var file_dialog = get_node("Menu/LoadDialog") - file_dialog.clear_filters() - file_dialog.add_filter("*.json") - file_dialog.set_mode(0) - file_dialog.show() - file_dialog._update_file_list() - - -func _on_LoadDialog_file_selected( path ): - get_node("/root/World").load_world( path ) - - -func _on_Server_toggled( pressed ): - if pressed: - get_node("/root/World/Server").start() - get_node("Menu/Client").hide() - else: - get_node("/root/World/Server").stop() - get_node("Menu/Client").show() - - -func _on_Client_toggled( pressed ): - if pressed: - get_node("/root/World/Client").start() - get_node("Menu/Server").hide() - else: - get_node("/root/World/Client").stop() - get_node("Menu/Server").show() \ No newline at end of file diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 40e6e64cef..bf7a0871e7 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From 2db55ef6fc9ce73ecec35d2241d2faa4082f0441 Mon Sep 17 00:00:00 2001 From: fry- Date: Mon, 2 Feb 2015 23:08:57 +0100 Subject: added a demo for 2D fog of war --- demos/2d/fog_of_war/.fscache | 11 +++++ demos/2d/fog_of_war/engine.cfg | 12 ++++++ demos/2d/fog_of_war/floor.png | Bin 0 -> 572 bytes demos/2d/fog_of_war/fog.gd | 86 +++++++++++++++++++++++++++++++++++++ demos/2d/fog_of_war/fog.png | Bin 0 -> 31448 bytes demos/2d/fog_of_war/fog.scn | Bin 0 -> 3714 bytes demos/2d/fog_of_war/fog.xml | 29 +++++++++++++ demos/2d/fog_of_war/icon.png | Bin 0 -> 3639 bytes demos/2d/fog_of_war/icon.png.flags | 1 + demos/2d/fog_of_war/tile_edit.scn | Bin 0 -> 1443 bytes demos/2d/fog_of_war/troll.gd | 43 +++++++++++++++++++ demos/2d/fog_of_war/troll.png | Bin 0 -> 7246 bytes demos/2d/fog_of_war/troll.scn | Bin 0 -> 1839 bytes 13 files changed, 182 insertions(+) create mode 100644 demos/2d/fog_of_war/.fscache create mode 100644 demos/2d/fog_of_war/engine.cfg create mode 100644 demos/2d/fog_of_war/floor.png create mode 100644 demos/2d/fog_of_war/fog.gd create mode 100644 demos/2d/fog_of_war/fog.png create mode 100644 demos/2d/fog_of_war/fog.scn create mode 100644 demos/2d/fog_of_war/fog.xml create mode 100644 demos/2d/fog_of_war/icon.png create mode 100644 demos/2d/fog_of_war/icon.png.flags create mode 100644 demos/2d/fog_of_war/tile_edit.scn create mode 100644 demos/2d/fog_of_war/troll.gd create mode 100644 demos/2d/fog_of_war/troll.png create mode 100644 demos/2d/fog_of_war/troll.scn (limited to 'demos') diff --git a/demos/2d/fog_of_war/.fscache b/demos/2d/fog_of_war/.fscache new file mode 100644 index 0000000000..ba5e3995f3 --- /dev/null +++ b/demos/2d/fog_of_war/.fscache @@ -0,0 +1,11 @@ +::res://::1422910453 +floor.png::ImageTexture::1422910453:: +fog.gd::GDScript::1422910025:: +fog.png::ImageTexture::1422908128:: +fog.scn::PackedScene::1422909435:: +fog.xml::TileSet::1422909324:: +icon.png::ImageTexture::1422811193:: +tile_edit.scn::PackedScene::1422909313:: +troll.gd::GDScript::1422909940:: +troll.png::ImageTexture::1418669358:: +troll.scn::PackedScene::1418669358:: diff --git a/demos/2d/fog_of_war/engine.cfg b/demos/2d/fog_of_war/engine.cfg new file mode 100644 index 0000000000..5c4307b5bc --- /dev/null +++ b/demos/2d/fog_of_war/engine.cfg @@ -0,0 +1,12 @@ +[application] + +name="Fog of War" +main_scene="res://fog.scn" +icon="icon.png" + +[input] + +move_up=[key(Up)] +move_bottom=[key(Down)] +move_left=[key(Left)] +move_right=[key(Right)] diff --git a/demos/2d/fog_of_war/floor.png b/demos/2d/fog_of_war/floor.png new file mode 100644 index 0000000000..07b4f8c98f Binary files /dev/null and b/demos/2d/fog_of_war/floor.png differ diff --git a/demos/2d/fog_of_war/fog.gd b/demos/2d/fog_of_war/fog.gd new file mode 100644 index 0000000000..9da5680e4d --- /dev/null +++ b/demos/2d/fog_of_war/fog.gd @@ -0,0 +1,86 @@ + +extends TileMap + +# member variables here, example: +# var a=2 +# var b="textvar" + +# boundarys for the fog rectangle +var x_min = -20 # left start tile +var x_max = 20 # right end tile +var y_min = -20 # top start tile +var y_max = 20 # bottom end tile + +var position # players position + +# iteration variables +var x +var y + +# variable to check if player moved +var x_old +var y_old + +# array to build up the visible area like a square +# first value determines the width/height of the tip +# here it would be 2*2 + 1 = 5 tiles wide/high +# second value determines the total squares size +# here it would be 5*2 + 1 = 10 tiles wide/high +var l = range(2,5) + +# process that runs in realtime +func _fixed_process(delta): + position = get_node("../troll").get_pos() + + # calculate the corresponding tile + # from the players position + x = int(position.x/get_cell_size().x) + # switching from positive to negative tile positions + # causes problems because of rounding problems + if position.x < 0: + x -= 1 # correct negative values + + y = int(position.y/get_cell_size().y) + if position.y < 0: + y -= 1 + + # check if the player moved one tile further + if (x_old != x) or (y_old != y): + + # create the transparent part (visited area) + var end = l.size()-1 + var start = 0 + for steps in range(l.size()): + for m in range(x-l[end]-1,x+l[end]+2): + for n in range(y-l[start]-1,y+l[start]+2): + if get_cell(m,n) != 0: + set_cell(m,n,1,0,0) + end -= 1 + start += 1 + + # create the actual and active visible part + var end = l.size()-1 + var start = 0 + for steps in range(l.size()): + for m in range(x-l[end],x+l[end]+1): + for n in range(y-l[start],y+l[start]+1): + set_cell(m,n,-1) + end -= 1 + start += 1 + + x_old = x + y_old = y + + pass + +func _ready(): + # Initalization here + + # create a square filled with the 100% opaque fog + for x in range(x_min,x_max): + for y in range(y_min,y_max): + set_cell(x,y,0,0,0) + set_fixed_process(true) + pass + + diff --git a/demos/2d/fog_of_war/fog.png b/demos/2d/fog_of_war/fog.png new file mode 100644 index 0000000000..56980c298d Binary files /dev/null and b/demos/2d/fog_of_war/fog.png differ diff --git a/demos/2d/fog_of_war/fog.scn b/demos/2d/fog_of_war/fog.scn new file mode 100644 index 0000000000..4987f1ead5 Binary files /dev/null and b/demos/2d/fog_of_war/fog.scn differ diff --git a/demos/2d/fog_of_war/fog.xml b/demos/2d/fog_of_war/fog.xml new file mode 100644 index 0000000000..ed08d84a1f --- /dev/null +++ b/demos/2d/fog_of_war/fog.xml @@ -0,0 +1,29 @@ + + + + + + "fog opaque" + + -48, -48 + 0, 0 + 0, 0, 144, 144 + + + "fog transparent" + + -48, -48 + 0, 0 + 144, 0, 144, 144 + + + "floor" + + 0, 0 + 0, 0 + 0, 0, 0, 0 + + + + + \ No newline at end of file diff --git a/demos/2d/fog_of_war/icon.png b/demos/2d/fog_of_war/icon.png new file mode 100644 index 0000000000..0c422e37b0 Binary files /dev/null and b/demos/2d/fog_of_war/icon.png differ diff --git a/demos/2d/fog_of_war/icon.png.flags b/demos/2d/fog_of_war/icon.png.flags new file mode 100644 index 0000000000..dbef2209e8 --- /dev/null +++ b/demos/2d/fog_of_war/icon.png.flags @@ -0,0 +1 @@ +gen_mipmaps=true diff --git a/demos/2d/fog_of_war/tile_edit.scn b/demos/2d/fog_of_war/tile_edit.scn new file mode 100644 index 0000000000..aaca19d370 Binary files /dev/null and b/demos/2d/fog_of_war/tile_edit.scn differ diff --git a/demos/2d/fog_of_war/troll.gd b/demos/2d/fog_of_war/troll.gd new file mode 100644 index 0000000000..d118d3a2ba --- /dev/null +++ b/demos/2d/fog_of_war/troll.gd @@ -0,0 +1,43 @@ + +extends KinematicBody2D + +# This is a simple collision demo showing how +# the kinematic cotroller works. +# move() will allow to move the node, and will +# always move it to a non-colliding spot, +# as long as it starts from a non-colliding spot too. + + +#pixels / second +const MOTION_SPEED=160 + +func _fixed_process(delta): + + var motion = Vector2() + + if (Input.is_action_pressed("move_up")): + motion+=Vector2(0,-1) + if (Input.is_action_pressed("move_bottom")): + motion+=Vector2(0,1) + if (Input.is_action_pressed("move_left")): + motion+=Vector2(-1,0) + if (Input.is_action_pressed("move_right")): + motion+=Vector2(1,0) + + motion = motion.normalized() * MOTION_SPEED * delta + motion = move(motion) + + #make character slide nicely through the world + var slide_attempts = 4 + while(is_colliding() and slide_attempts>0): + motion = get_collision_normal().slide(motion) + motion=move(motion) + slide_attempts-=1 + + +func _ready(): + # Initalization here + set_fixed_process(true) + pass + + diff --git a/demos/2d/fog_of_war/troll.png b/demos/2d/fog_of_war/troll.png new file mode 100644 index 0000000000..69f195d034 Binary files /dev/null and b/demos/2d/fog_of_war/troll.png differ diff --git a/demos/2d/fog_of_war/troll.scn b/demos/2d/fog_of_war/troll.scn new file mode 100644 index 0000000000..f5d87c3631 Binary files /dev/null and b/demos/2d/fog_of_war/troll.scn differ -- cgit v1.2.3 From c21227a6368a7ff26bb1872b803ad7409684da7a Mon Sep 17 00:00:00 2001 From: fry- Date: Mon, 2 Feb 2015 23:29:19 +0100 Subject: added preview picture --- demos/2d/fog_of_war/icon.png | Bin 3639 -> 8681 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'demos') diff --git a/demos/2d/fog_of_war/icon.png b/demos/2d/fog_of_war/icon.png index 0c422e37b0..a483390048 100644 Binary files a/demos/2d/fog_of_war/icon.png and b/demos/2d/fog_of_war/icon.png differ -- cgit v1.2.3 From df7d26ff5b89ce9852813abd370d1357aab1501b Mon Sep 17 00:00:00 2001 From: hurikhan Date: Thu, 12 Feb 2015 15:58:00 +0100 Subject: cleanup + MouseGrab --- demos/misc/window_management/control.gd | 2 ++ demos/misc/window_management/window_management.scn | Bin 4744 -> 4850 bytes 2 files changed, 2 insertions(+) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index d329237aed..50fc3a3765 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -28,6 +28,8 @@ func _fixed_process(delta): get_node("Label_Size").set_text(str("Size:\n", OS.get_window_size() ) ) + get_node("Label_MousePosition").set_text(str("Mouse Position:\n", Input.get_mouse_pos() ) ) + 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_screen() ) ) diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index bf7a0871e7..14d0da0415 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From e7024259e19c18411272ec7b8d2aabf16a93e926 Mon Sep 17 00:00:00 2001 From: "Bil Bas (Spooner)" Date: Wed, 25 Feb 2015 17:24:32 +0000 Subject: Fixed columns to have integer positions, so that they don't "jiggle" when moving the camera. --- demos/2d/isometric/dungeon.scn | Bin 4582 -> 4721 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'demos') diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn index 76532a44aa..58c530d5c5 100644 Binary files a/demos/2d/isometric/dungeon.scn and b/demos/2d/isometric/dungeon.scn differ -- cgit v1.2.3 From ba74e45027f795238323c3667dfdb660608d7484 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sun, 8 Mar 2015 01:27:36 -0600 Subject: added Label_MouseGrab_KeyInfo --- demos/misc/window_management/control.gd | 3 +++ demos/misc/window_management/window_management.scn | Bin 4850 -> 5072 bytes 2 files changed, 3 insertions(+) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 50fc3a3765..7f805a1a21 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -21,6 +21,9 @@ func _fixed_process(delta): if(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED): modetext += "MouseGrab\n" + get_node("Label_MouseGrab_KeyInfo").show() + else: + get_node("Label_MouseGrab_KeyInfo").hide() get_node("Label_Mode").set_text(modetext) diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 14d0da0415..0cb7030ffc 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From 5241626dee5aa7f91da7d7ac5476fb76e1d0b89e Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sun, 8 Mar 2015 03:32:13 -0500 Subject: fixing a typo in the demo --- demos/misc/window_management/window_management.scn | Bin 5072 -> 5068 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 0cb7030ffc..9b963a0a15 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From f7621810a2f072a5d77563b6018023c575f355bf Mon Sep 17 00:00:00 2001 From: hurikhan Date: Sun, 8 Mar 2015 09:26:58 -0500 Subject: removed up, down, left, right keys from the demo. were used before for fast multiscreen setup testing. --- demos/misc/window_management/control.gd | 12 ------------ demos/misc/window_management/window_management.scn | Bin 5068 -> 5087 bytes 2 files changed, 12 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index 7f805a1a21..bca13c5a0c 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -54,18 +54,6 @@ func _fixed_process(delta): get_node("Label_Screen1_Resolution").hide() get_node("Label_Screen1_Position").hide() - if( Input.is_action_pressed("ui_right")): - OS.set_screen(1) - - if( Input.is_action_pressed("ui_left")): - OS.set_screen(0) - - if( Input.is_action_pressed("ui_up")): - OS.set_fullscreen(true) - - if( Input.is_action_pressed("ui_down")): - OS.set_fullscreen(false) - get_node("Button_Fullscreen").set_pressed( OS.is_fullscreen() ) get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) get_node("Button_Minimized").set_pressed( OS.is_minimized() ) diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index 9b963a0a15..b8b0ee210b 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From a6f96f46b779a815b03974fece21728fe32e88d2 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 10 Mar 2015 21:05:49 -0300 Subject: small optimizations to isometric light demo should work faster, and even faster if exported.. as textures have been optimized. --- demos/2d/isometric_light/cubio.scn | Bin 6878 -> 6927 bytes demos/2d/isometric_light/export.cfg | 262 +++++++++++++++++++++++++++++ demos/2d/isometric_light/faceNormal.png | Bin 131067 -> 54844 bytes demos/2d/isometric_light/floor_shader.res | Bin 972 -> 1026 bytes demos/2d/isometric_light/light2.png | Bin 60871 -> 3500 bytes demos/2d/isometric_light/map.scn | Bin 8520 -> 8565 bytes demos/2d/isometric_light/tileset_scene.scn | Bin 4813 -> 4812 bytes demos/2d/isometric_light/torch.scn | Bin 4232 -> 4262 bytes demos/2d/isometric_light/torch_light.png | Bin 28516 -> 1262 bytes demos/2d/isometric_light/wall_shader.res | Bin 1628 -> 1684 bytes 10 files changed, 262 insertions(+) create mode 100644 demos/2d/isometric_light/export.cfg (limited to 'demos') diff --git a/demos/2d/isometric_light/cubio.scn b/demos/2d/isometric_light/cubio.scn index 29fa077389..c8ab7ddd4e 100644 Binary files a/demos/2d/isometric_light/cubio.scn and b/demos/2d/isometric_light/cubio.scn differ diff --git a/demos/2d/isometric_light/export.cfg b/demos/2d/isometric_light/export.cfg new file mode 100644 index 0000000000..578d4171b2 --- /dev/null +++ b/demos/2d/isometric_light/export.cfg @@ -0,0 +1,262 @@ +[convert_images] + +action="none" +compress_quality=0.7 +formats="png" +shrink=1 + +[export_filter] + +filter="" +type="resources" + +[image_group_files] + +files=["res://faceNormal.png", "normal", "res://faceColor.png", "normal", "res://faceMask.png", "normal"] + +[image_groups] + +normal={"atlas":false, "action":"compress_ram", "shrink":1, "lossy_quality":0.7} + +[platform:Android] + +apk_expansion/SALT="" +apk_expansion/enable=false +apk_expansion/public_key="" +command_line/extra_args="" +custom_package/debug="" +custom_package/release="" +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="com.android.noname" +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/orientation=0 +screen/support_large=true +screen/support_normal=true +screen/support_small=true +screen/support_xlarge=true +user_permissions/0="" +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] + +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="" +options/memory_size=3 + +[platform:Linux X11] + +binary/64_bits=true +custom_binary/debug="" +custom_binary/release="" +resources/pack_mode=1 + +[platform:Mac OSX] + +application/64_bits=false +application/copyright="" +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="" +display/high_res=false + +[platform:Windows Desktop] + +binary/64_bits=true +custom_binary/debug="" +custom_binary/release="" +resources/pack_mode=1 + +[script] + +action="compile" +encrypt_key="" diff --git a/demos/2d/isometric_light/faceNormal.png b/demos/2d/isometric_light/faceNormal.png index c6498dd1df..651f075fa1 100644 Binary files a/demos/2d/isometric_light/faceNormal.png and b/demos/2d/isometric_light/faceNormal.png differ diff --git a/demos/2d/isometric_light/floor_shader.res b/demos/2d/isometric_light/floor_shader.res index d4fac5b933..446c71d227 100644 Binary files a/demos/2d/isometric_light/floor_shader.res and b/demos/2d/isometric_light/floor_shader.res differ diff --git a/demos/2d/isometric_light/light2.png b/demos/2d/isometric_light/light2.png index dd035e9911..cd473251aa 100644 Binary files a/demos/2d/isometric_light/light2.png and b/demos/2d/isometric_light/light2.png differ diff --git a/demos/2d/isometric_light/map.scn b/demos/2d/isometric_light/map.scn index 10de40d4ac..fb2f3a2154 100644 Binary files a/demos/2d/isometric_light/map.scn and b/demos/2d/isometric_light/map.scn differ diff --git a/demos/2d/isometric_light/tileset_scene.scn b/demos/2d/isometric_light/tileset_scene.scn index e76a22c892..3d0773c9c5 100644 Binary files a/demos/2d/isometric_light/tileset_scene.scn and b/demos/2d/isometric_light/tileset_scene.scn differ diff --git a/demos/2d/isometric_light/torch.scn b/demos/2d/isometric_light/torch.scn index 2daa199e92..d1cb7fe7e6 100644 Binary files a/demos/2d/isometric_light/torch.scn and b/demos/2d/isometric_light/torch.scn differ diff --git a/demos/2d/isometric_light/torch_light.png b/demos/2d/isometric_light/torch_light.png index 60e5838043..a98113d36f 100644 Binary files a/demos/2d/isometric_light/torch_light.png and b/demos/2d/isometric_light/torch_light.png differ diff --git a/demos/2d/isometric_light/wall_shader.res b/demos/2d/isometric_light/wall_shader.res index a1318746a5..78c8fe57e1 100644 Binary files a/demos/2d/isometric_light/wall_shader.res and b/demos/2d/isometric_light/wall_shader.res differ -- cgit v1.2.3 From 9f88a40e9fa1045f60ac5b6ca36de945562d6b65 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 11 Mar 2015 01:44:52 -0300 Subject: simple shader effects library for 2D ready to use in any project --- demos/2d/sprite_shaders/cubio.png | Bin 0 -> 26579 bytes demos/2d/sprite_shaders/engine.cfg | 4 ++++ demos/2d/sprite_shaders/sprite_shaders.scn | Bin 0 -> 4087 bytes 3 files changed, 4 insertions(+) create mode 100644 demos/2d/sprite_shaders/cubio.png create mode 100644 demos/2d/sprite_shaders/engine.cfg create mode 100644 demos/2d/sprite_shaders/sprite_shaders.scn (limited to 'demos') diff --git a/demos/2d/sprite_shaders/cubio.png b/demos/2d/sprite_shaders/cubio.png new file mode 100644 index 0000000000..6f76220225 Binary files /dev/null and b/demos/2d/sprite_shaders/cubio.png differ diff --git a/demos/2d/sprite_shaders/engine.cfg b/demos/2d/sprite_shaders/engine.cfg new file mode 100644 index 0000000000..09f9a59566 --- /dev/null +++ b/demos/2d/sprite_shaders/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="2D Shaders for Sprites" +main_scene="res://sprite_shaders.scn" diff --git a/demos/2d/sprite_shaders/sprite_shaders.scn b/demos/2d/sprite_shaders/sprite_shaders.scn new file mode 100644 index 0000000000..84f81dde12 Binary files /dev/null and b/demos/2d/sprite_shaders/sprite_shaders.scn differ -- cgit v1.2.3 From 650e13f3cd68c9b45879a905548c34e9fb5bb46f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 12 Mar 2015 01:05:50 -0300 Subject: back buffer copy node, to improve on texscreen() back buffer copy node and respective demo --- demos/2d/isometric_light/engine.cfg | 4 ++++ demos/2d/sprite_shaders/sprite_shaders.scn | Bin 4087 -> 4079 bytes demos/2d/texscreen/bubble.png | Bin 0 -> 18619 bytes demos/2d/texscreen/bubbles.gd | 17 +++++++++++++ demos/2d/texscreen/bubbles.scn | Bin 0 -> 1456 bytes demos/2d/texscreen/burano.png | Bin 0 -> 974437 bytes demos/2d/texscreen/engine.cfg | 4 ++++ demos/2d/texscreen/lens.gd | 37 +++++++++++++++++++++++++++++ demos/2d/texscreen/lens.scn | Bin 0 -> 1805 bytes 9 files changed, 62 insertions(+) create mode 100644 demos/2d/texscreen/bubble.png create mode 100644 demos/2d/texscreen/bubbles.gd create mode 100644 demos/2d/texscreen/bubbles.scn create mode 100644 demos/2d/texscreen/burano.png create mode 100644 demos/2d/texscreen/engine.cfg create mode 100644 demos/2d/texscreen/lens.gd create mode 100644 demos/2d/texscreen/lens.scn (limited to 'demos') diff --git a/demos/2d/isometric_light/engine.cfg b/demos/2d/isometric_light/engine.cfg index bd65a38921..0d9e432d5d 100644 --- a/demos/2d/isometric_light/engine.cfg +++ b/demos/2d/isometric_light/engine.cfg @@ -9,6 +9,10 @@ down=[key(S), key(Down)] left=[key(Left), key(A)] right=[key(Right), key(D)] +[rasterizer] + +shadow_filter=0 + [render] default_clear_color=#ff000000 diff --git a/demos/2d/sprite_shaders/sprite_shaders.scn b/demos/2d/sprite_shaders/sprite_shaders.scn index 84f81dde12..7c36f2137c 100644 Binary files a/demos/2d/sprite_shaders/sprite_shaders.scn and b/demos/2d/sprite_shaders/sprite_shaders.scn differ diff --git a/demos/2d/texscreen/bubble.png b/demos/2d/texscreen/bubble.png new file mode 100644 index 0000000000..021abba601 Binary files /dev/null and b/demos/2d/texscreen/bubble.png 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 Binary files /dev/null and b/demos/2d/texscreen/bubbles.scn differ diff --git a/demos/2d/texscreen/burano.png b/demos/2d/texscreen/burano.png new file mode 100644 index 0000000000..6eec09d585 Binary files /dev/null and b/demos/2d/texscreen/burano.png 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 Binary files /dev/null and b/demos/2d/texscreen/lens.scn differ -- cgit v1.2.3 From 53e1694e1e2b76026d862e84c1de88f62601cbc3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 16 Mar 2015 00:47:37 -0300 Subject: New option to send canvas to render buffer allows to use 3D environment effects for post processing such as Glow, Bloom, HDR, etc. in 2D. --- demos/2d/hdr/beach_cave.gd | 26 ++++++++++++++++++++++++++ demos/2d/hdr/beach_cave.scn | Bin 0 -> 2972 bytes demos/2d/hdr/engine.cfg | 13 +++++++++++++ demos/2d/hdr/ocean_beach.png | Bin 0 -> 443558 bytes demos/2d/hdr/ocean_beach.png.flags | 1 + demos/2d/hdr/ocean_cave.png | Bin 0 -> 745215 bytes demos/2d/hdr/ocean_cave.png.flags | 1 + demos/2d/isometric_light/map.scn | Bin 8565 -> 8535 bytes demos/2d/platformer/stage.xml | 35 +++++++++++++++++++---------------- 9 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 demos/2d/hdr/beach_cave.gd create mode 100644 demos/2d/hdr/beach_cave.scn create mode 100644 demos/2d/hdr/engine.cfg create mode 100644 demos/2d/hdr/ocean_beach.png create mode 100644 demos/2d/hdr/ocean_beach.png.flags create mode 100644 demos/2d/hdr/ocean_cave.png create mode 100644 demos/2d/hdr/ocean_cave.png.flags (limited to 'demos') diff --git a/demos/2d/hdr/beach_cave.gd b/demos/2d/hdr/beach_cave.gd new file mode 100644 index 0000000000..9dffbc4662 --- /dev/null +++ b/demos/2d/hdr/beach_cave.gd @@ -0,0 +1,26 @@ + +extends Node2D + +# member variables here, example: +# var a=2 +# var b="textvar" +const CAVE_LIMIT=1000 + +func _input(ev): + if (ev.type==InputEvent.MOUSE_MOTION and ev.button_mask&1): + var rel_x = ev.relative_x + var cavepos = get_node("cave").get_pos() + cavepos.x+=rel_x + if (cavepos.x<-CAVE_LIMIT): + cavepos.x=-CAVE_LIMIT + elif (cavepos.x>0): + cavepos.x=0 + get_node("cave").set_pos(cavepos) + + +func _ready(): + set_process_input(true) + # Initialization here + pass + + diff --git a/demos/2d/hdr/beach_cave.scn b/demos/2d/hdr/beach_cave.scn new file mode 100644 index 0000000000..4147a130ad Binary files /dev/null and b/demos/2d/hdr/beach_cave.scn differ diff --git a/demos/2d/hdr/engine.cfg b/demos/2d/hdr/engine.cfg new file mode 100644 index 0000000000..3d8b4222d5 --- /dev/null +++ b/demos/2d/hdr/engine.cfg @@ -0,0 +1,13 @@ +[application] + +name="HDR for 2D" +main_scene="res://beach_cave.scn" + +[display] + +width=1080 +height=720 + +[rasterizer] + +blur_buffer_size=128 diff --git a/demos/2d/hdr/ocean_beach.png b/demos/2d/hdr/ocean_beach.png new file mode 100644 index 0000000000..a873d4f61d Binary files /dev/null and b/demos/2d/hdr/ocean_beach.png differ diff --git a/demos/2d/hdr/ocean_beach.png.flags b/demos/2d/hdr/ocean_beach.png.flags new file mode 100644 index 0000000000..82127bd7d5 --- /dev/null +++ b/demos/2d/hdr/ocean_beach.png.flags @@ -0,0 +1 @@ +tolinear=true diff --git a/demos/2d/hdr/ocean_cave.png b/demos/2d/hdr/ocean_cave.png new file mode 100644 index 0000000000..8875499df3 Binary files /dev/null and b/demos/2d/hdr/ocean_cave.png differ diff --git a/demos/2d/hdr/ocean_cave.png.flags b/demos/2d/hdr/ocean_cave.png.flags new file mode 100644 index 0000000000..82127bd7d5 --- /dev/null +++ b/demos/2d/hdr/ocean_cave.png.flags @@ -0,0 +1 @@ +tolinear=true diff --git a/demos/2d/isometric_light/map.scn b/demos/2d/isometric_light/map.scn index fb2f3a2154..c939a4b392 100644 Binary files a/demos/2d/isometric_light/map.scn and b/demos/2d/isometric_light/map.scn differ diff --git a/demos/2d/platformer/stage.xml b/demos/2d/platformer/stage.xml index 35517f747d..610057183b 100644 --- a/demos/2d/platformer/stage.xml +++ b/demos/2d/platformer/stage.xml @@ -2,16 +2,16 @@ - - + + + - "names" - + "stage" "Node" "_import_path" @@ -21,6 +21,7 @@ "visibility/visible" "visibility/opacity" "visibility/self_opacity" + "visibility/light_mask" "transform/pos" "transform/rot" "transform/scale" @@ -32,7 +33,9 @@ "cell/quadrant_size" "cell/custom_transform" "cell/half_offset" - "collision/body_mode" + "cell/tile_origin" + "cell/y_sort" + "collision/use_kinematic" "collision/friction" "collision/bounce" "collision/layers" @@ -172,10 +175,10 @@ 0.814506 "use_snap" False + "snap_vec" + 10, 10 "ofs" - -121.031, 464.121 - "snap" - 10 + 177.488, 709.633 "3D" @@ -278,10 +281,11 @@ 0 "__editor_plugin_screen__" - "2D" + "3D" True 1 + 1 0, 0 0 1, 1 @@ -291,7 +295,7 @@ 8 1, 0, 0, 1, 0, 0 2 - 1 + False 0, 2, 70, 536870914, 71, 10, 72, 10, 73, 10, 74, 10, 75, 10, 76, 10, 77, 10, 78, 10, 65536, 2, 65606, 536870914, 65607, 10, 65608, 10, 65609, 10, 65610, 10, 65611, 10, 65612, 10, 65613, 10, 65614, 10, 131072, 2, 131142, 536870914, 131143, 10, 131144, 10, 131145, 10, 131146, 10, 131147, 10, 131148, 10, 131149, 10, 131150, 10, 196608, 2, 196626, 9, 196678, 536870914, 196679, 10, 196680, 10, 196681, 10, 196682, 10, 196683, 10, 196684, 10, 196685, 10, 196686, 10, 262144, 2, 262162, 8, 262214, 536870914, 262215, 10, 262216, 10, 262217, 10, 262218, 10, 262219, 10, 262220, 10, 262221, 10, 262222, 10, 327680, 2, 327697, 536870921, 327698, 7, 327733, 9, 327750, 536870914, 327751, 10, 327752, 10, 327753, 10, 327754, 10, 327755, 10, 327756, 10, 327757, 10, 327758, 10, 393216, 2, 393233, 536870920, 393234, 7, 393257, 9, 393269, 7, 393286, 536870914, 393287, 10, 393288, 10, 393289, 10, 393290, 10, 393291, 10, 393292, 10, 393293, 10, 393294, 10, 458752, 2, 458769, 7, 458770, 8, 458790, 9, 458793, 8, 458805, 8, 458822, 536870914, 458823, 10, 458824, 10, 458825, 10, 458826, 10, 458827, 10, 458828, 10, 458829, 10, 458830, 10, 524288, 4, 524289, 1, 524304, 536870913, 524305, 536870918, 524306, 6, 524307, 5, 524308, 1, 524326, 8, 524329, 7, 524341, 7, 524358, 536870914, 524359, 10, 524360, 10, 524361, 10, 524362, 10, 524363, 10, 524364, 10, 524365, 10, 524366, 10, 589824, 10, 589825, 13, 589840, 536870914, 589841, 10, 589842, 10, 589843, 10, 589844, 2, 589862, 7, 589865, 7, 589876, 536870913, 589877, 6, 589878, 1, 589894, 536870914, 589895, 10, 589896, 10, 589897, 10, 589898, 10, 589899, 10, 589900, 10, 589901, 10, 589902, 10, 655360, 2, 655376, 536870914, 655377, 10, 655378, 10, 655379, 10, 655380, 2, 655398, 7, 655401, 8, 655412, 536870925, 655413, 11, 655414, 13, 655430, 536870914, 655431, 10, 655432, 10, 655433, 10, 655434, 10, 655435, 10, 655436, 10, 655437, 10, 655438, 10, 720896, 2, 720912, 536870914, 720913, 10, 720914, 10, 720915, 10, 720916, 2, 720934, 8, 720937, 7, 720958, 536870913, 720959, 5, 720960, 536870917, 720961, 5, 720962, 5, 720963, 536870917, 720964, 5, 720965, 0, 720966, 536870916, 720967, 10, 720968, 10, 720969, 10, 720970, 10, 720971, 10, 720972, 10, 720973, 10, 720974, 10, 786432, 2, 786437, 9, 786448, 536870914, 786449, 10, 786450, 10, 786451, 10, 786452, 2, 786464, 536870913, 786465, 1, 786470, 7, 786473, 7, 786474, 536870924, 786475, 1, 786494, 536870914, 786495, 10, 786496, 10, 786497, 10, 786498, 10, 786499, 10, 786500, 10, 786501, 10, 786502, 10, 786503, 10, 786504, 10, 786505, 10, 786506, 10, 786507, 10, 786508, 10, 786509, 10, 851968, 2, 851973, 7, 851984, 536870914, 851985, 10, 851986, 10, 851987, 10, 851988, 2, 851996, 536870913, 851997, 1, 852000, 536870914, 852001, 3, 852006, 7, 852009, 536870913, 852011, 2, 852030, 536870914, 852031, 10, 852032, 10, 852033, 10, 852034, 10, 852035, 10, 852036, 10, 852037, 10, 852038, 10, 852039, 10, 852040, 10, 852041, 10, 852042, 10, 852043, 10, 852044, 10, 852045, 10, 917504, 2, 917506, 9, 917509, 7, 917512, 536870921, 917520, 536870925, 917521, 11, 917522, 11, 917523, 11, 917524, 13, 917532, 536870925, 917533, 13, 917536, 536870914, 917537, 4, 917538, 1, 917540, 536870913, 917541, 0, 917542, 1, 917545, 536870914, 917546, 10, 917547, 4, 917548, 1, 917566, 536870914, 917567, 10, 917568, 10, 917569, 10, 917570, 10, 917571, 10, 917572, 10, 917573, 10, 917574, 10, 917575, 10, 917576, 10, 917577, 10, 917578, 10, 917579, 10, 917580, 10, 917581, 10, 983040, 2, 983042, 7, 983045, 7, 983048, 536870920, 983050, 536870913, 983051, 1, 983064, 536870913, 983065, 1, 983072, 536870914, 983073, 10, 983074, 4, 983075, 0, 983076, 536870916, 983077, 10, 983078, 4, 983079, 536870912, 983080, 536870912, 983081, 536870916, 983082, 10, 983083, 10, 983084, 2, 983095, 9, 983102, 536870914, 983103, 10, 983104, 10, 983105, 10, 983106, 10, 983107, 10, 983108, 10, 983109, 10, 983110, 10, 983111, 10, 983112, 10, 983113, 10, 983114, 10, 983115, 10, 983116, 10, 983117, 10, 1048576, 2, 1048578, 8, 1048581, 8, 1048584, 536870919, 1048586, 536870925, 1048587, 13, 1048600, 536870925, 1048601, 13, 1048604, 9, 1048608, 536870925, 1048609, 536870923, 1048610, 536870923, 1048611, 536870923, 1048612, 10, 1048613, 10, 1048614, 10, 1048615, 10, 1048616, 10, 1048617, 10, 1048618, 10, 1048619, 10, 1048620, 4, 1048621, 1, 1048630, 536870921, 1048631, 8, 1048638, 536870914, 1048639, 10, 1048640, 10, 1048641, 10, 1048642, 10, 1048643, 10, 1048644, 10, 1048645, 10, 1048646, 10, 1048647, 10, 1048648, 10, 1048649, 10, 1048650, 10, 1048651, 10, 1048652, 10, 1048653, 10, 1114112, 4, 1114113, 0, 1114114, 6, 1114115, 0, 1114116, 0, 1114117, 6, 1114118, 1, 1114120, 536870920, 1114128, 536870913, 1114129, 5, 1114130, 536870917, 1114131, 5, 1114132, 0, 1114133, 1, 1114140, 7, 1114141, 536870921, 1114148, 536870914, 1114149, 10, 1114150, 10, 1114151, 10, 1114152, 10, 1114153, 10, 1114154, 10, 1114155, 10, 1114156, 10, 1114157, 2, 1114166, 536870920, 1114167, 8, 1114174, 536870914, 1114175, 10, 1114176, 10, 1114177, 10, 1114178, 10, 1114179, 10, 1114180, 10, 1114181, 10, 1114182, 10, 1114183, 10, 1114184, 10, 1114185, 10, 1114186, 10, 1114187, 10, 1114188, 10, 1179648, 10, 1179649, 10, 1179650, 10, 1179651, 10, 1179652, 10, 1179653, 10, 1179654, 2, 1179656, 536870919, 1179663, 536870915, 1179665, 10, 1179666, 10, 1179667, 10, 1179668, 10, 1179669, 4, 1179670, 12, 1179675, 9, 1179676, 8, 1179677, 8, 1179684, 536870914, 1179685, 10, 1179686, 10, 1179687, 10, 1179688, 10, 1179689, 10, 1179690, 10, 1179691, 10, 1179692, 10, 1179693, 4, 1179694, 1, 1179701, 9, 1179702, 536870919, 1179703, 7, 1179710, 536870914, 1179711, 10, 1179712, 10, 1179713, 10, 1179714, 10, 1179715, 10, 1179716, 10, 1179717, 10, 1179718, 10, 1179719, 10, 1179720, 10, 1179721, 10, 1179722, 10, 1245184, 10, 1245185, 10, 1245186, 10, 1245187, 10, 1245188, 10, 1245189, 10, 1245190, 2, 1245192, 536870919, 1245199, 536870913, 1245200, 536870916, 1245201, 10, 1245202, 10, 1245203, 10, 1245204, 10, 1245205, 10, 1245207, 1, 1245211, 7, 1245212, 7, 1245213, 536870920, 1245220, 536870914, 1245221, 10, 1245222, 10, 1245223, 10, 1245224, 10, 1245225, 10, 1245226, 10, 1245227, 10, 1245228, 10, 1245229, 10, 1245230, 2, 1245237, 8, 1245238, 536870919, 1245239, 8, 1245240, 536870921, 1245246, 536870914, 1245247, 10, 1245248, 10, 1245249, 10, 1245250, 10, 1245251, 10, 1245252, 10, 1245253, 10, 1245254, 10, 1245255, 10, 1245256, 10, 1245257, 10, 1245258, 10, 1310720, 10, 1310721, 10, 1310722, 10, 1310723, 10, 1310724, 10, 1310725, 10, 1310726, 2, 1310728, 536870920, 1310730, 536870913, 1310731, 1, 1310734, 536870913, 1310735, 536870916, 1310736, 10, 1310737, 10, 1310738, 10, 1310739, 10, 1310740, 10, 1310741, 10, 1310742, 10, 1310743, 4, 1310744, 1, 1310747, 8, 1310748, 7, 1310749, 536870919, 1310756, 536870914, 1310757, 10, 1310758, 10, 1310759, 10, 1310760, 10, 1310761, 10, 1310762, 10, 1310763, 10, 1310764, 10, 1310765, 10, 1310766, 4, 1310767, 5, 1310768, 12, 1310773, 7, 1310774, 536870919, 1310775, 7, 1310776, 536870919, 1310782, 536870914, 1310783, 10, 1310784, 10, 1310785, 10, 1310786, 10, 1310787, 10, 1310788, 10, 1310789, 10, 1310790, 10, 1310791, 10, 1310792, 10, 1310793, 10, 1376256, 10, 1376257, 10, 1376258, 10, 1376259, 10, 1376260, 10, 1376261, 10, 1376262, 4, 1376263, 0, 1376264, 0, 1376265, 0, 1376266, 536870916, 1376267, 4, 1376268, 0, 1376269, 0, 1376270, 536870916, 1376271, 10, 1376272, 10, 1376273, 10, 1376274, 10, 1376275, 10, 1376276, 10, 1376277, 10, 1376278, 10, 1376279, 10, 1376280, 4, 1376281, 12, 1376283, 8, 1376284, 8, 1376285, 536870920, 1376287, 536870924, 1376288, 0, 1376289, 5, 1376290, 536870917, 1376291, 0, 1376292, 536870916, 1376293, 10, 1376294, 10, 1376295, 10, 1376296, 10, 1376297, 10, 1376298, 10, 1376299, 10, 1376300, 10, 1376301, 10, 1376302, 10, 1376303, 10, 1376305, 12, 1376309, 7, 1376310, 536870920, 1376311, 7, 1376312, 536870920, 1376318, 536870914, 1376319, 10, 1376320, 10, 1376321, 10, 1376322, 10, 1376323, 10, 1376324, 10, 1376325, 10, 1376326, 10, 1376327, 10, 1376328, 10, 1441792, 10, 1441793, 10, 1441794, 10, 1441795, 10, 1441796, 10, 1441797, 10, 1441798, 10, 1441799, 10, 1441800, 10, 1441801, 10, 1441802, 10, 1441803, 10, 1441804, 10, 1441805, 10, 1441806, 10, 1441807, 10, 1441808, 10, 1441809, 10, 1441810, 10, 1441811, 10, 1441812, 10, 1441813, 10, 1441814, 10, 1441815, 10, 1441816, 10, 1441818, 0, 1441819, 6, 1441820, 6, 1441821, 536870918, 1441822, 5, 1441824, 10, 1441825, 10, 1441826, 10, 1441827, 10, 1441828, 10, 1441829, 10, 1441830, 10, 1441831, 10, 1441832, 10, 1441833, 10, 1441834, 10, 1441835, 10, 1441836, 10, 1441837, 10, 1441838, 10, 1441839, 10, 1441840, 10, 1441842, 0, 1441843, 0, 1441844, 0, 1441845, 6, 1441846, 536870918, 1441847, 6, 1441848, 536870918, 1441849, 0, 1441850, 5, 1441851, 536870917, 1441852, 5, 1441853, 0, 1441854, 536870916, 1441855, 10, 1441856, 10, 1441857, 10, 1441858, 10, 1441859, 10, 1441860, 10, 1441861, 10, 1441862, 10, 1441863, 10, 1507328, 10, 1507329, 10, 1507330, 10, 1507331, 10, 1507332, 10, 1507333, 10, 1507334, 10, 1507335, 10, 1507336, 10, 1507337, 10, 1507338, 10, 1507339, 10, 1507340, 10, 1507341, 10, 1507342, 10, 1507343, 10, 1507344, 10, 1507345, 10, 1507346, 10, 1507347, 10, 1507348, 10, 1507349, 10, 1507350, 10, 1507351, 10, 1507352, 10, 1507353, 10, 1507354, 10, 1507355, 10, 1507356, 10, 1507357, 10, 1507358, 10, 1507359, 10, 1507360, 10, 1507361, 10, 1507362, 10, 1507363, 10, 1507364, 10, 1507365, 10, 1507366, 10, 1507367, 10, 1507368, 10, 1507369, 10, 1507370, 10, 1507371, 10, 1507372, 10, 1507373, 10, 1507374, 10, 1507375, 10, 1507376, 10, 1507377, 10, 1507378, 10, 1507379, 10, 1507380, 10, 1507381, 10, 1507382, 10, 1507383, 10, 1507384, 10, 1507385, 10, 1507386, 10, 1507387, 10, 1507388, 10, 1507389, 10, 1507390, 10, 1507391, 10, 1507392, 10, 1507393, 10, 1507394, 10, 1507395, 10, 1507396, 10, 1507397, 10, 1507398, 10, 1507399, 10, 1572864, 10, 1572865, 10, 1572866, 10, 1572867, 10, 1572868, 10, 1572869, 10, 1572870, 10, 1572871, 10, 1572872, 10, 1572873, 10, 1572874, 10, 1572875, 10, 1572876, 10, 1572877, 10, 1572878, 10, 1572879, 10, 1572880, 10, 1572881, 10, 1572882, 10, 1572883, 10, 1572884, 10, 1572885, 10, 1572886, 10, 1572887, 10, 1572888, 10, 1572889, 10, 1572890, 10, 1572891, 10, 1572892, 10, 1572893, 10, 1572894, 10, 1572895, 10, 1572896, 10, 1572897, 10, 1572898, 10, 1572899, 10, 1572900, 10, 1572901, 10, 1572902, 10, 1572903, 10, 1572904, 10, 1572905, 10, 1572906, 10, 1572907, 10, 1572908, 10, 1572909, 10, 1572910, 10, 1572911, 10, 1572912, 10, 1572913, 10, 1572914, 10, 1572915, 10, 1572916, 10, 1572917, 10, 1572918, 10, 1572919, 10, 1572920, 10, 1572921, 10, 1572922, 10, 1572923, 10, 1572924, 10, 1572925, 10, 1572926, 10, 1572927, 10, 1572928, 10, 1572929, 10, 1572930, 10, 1572931, 10, 1572932, 10, 1572933, 10, 1572934, 10, 1572935, 10, 1638400, 10, 1638401, 10, 1638402, 10, 1638403, 10, 1638404, 10, 1638405, 10, 1638406, 10, 1638407, 10, 1638408, 10, 1638409, 10, 1638410, 10, 1638411, 10, 1638412, 10, 1638413, 10, 1638414, 10, 1638415, 10, 1638416, 10, 1638417, 10, 1638418, 10, 1638419, 10, 1638420, 10, 1638421, 10, 1638422, 10, 1638423, 10, 1638424, 10, 1638425, 10, 1638426, 10, 1638427, 10, 1638428, 10, 1638429, 10, 1638430, 10, 1638431, 10, 1638432, 10, 1638433, 10, 1638434, 10, 1638435, 10, 1638436, 10, 1638437, 10, 1638438, 10, 1638439, 10, 1638440, 10, 1638441, 10, 1638442, 10, 1638443, 10, 1638444, 10, 1638445, 10, 1638446, 10, 1638447, 10, 1638448, 10, 1638449, 10, 1638450, 10, 1638451, 10, 1638452, 10, 1638453, 10, 1638454, 10, 1638455, 10, 1638456, 10, 1638457, 10, 1638458, 10, 1638459, 10, 1638460, 10, 1638461, 10, 1638462, 10, 1638463, 10, 1638464, 10, 1638465, 10, 1638466, 10, 1638467, 10, 1638468, 10, 1638469, 10, 1638470, 10, 1638471, 10, 1703952, 10, 1703953, 10, 1703954, 10, 1703955, 10, 1703956, 10, 1703957, 10, 1703958, 10, 1703959, 10, 1703960, 10, 1703961, 10, 1703962, 10, 1703963, 10, 1703964, 10, 1703965, 10, 1703966, 10, 1703967, 10, 1703968, 10, 1703969, 10, 1703970, 10, 1703971, 10, 1703972, 10, 1703973, 10, 1703974, 10, 1703975, 10, 1703976, 10, 1703977, 10, 1703978, 10, 1703979, 10, 1703980, 10, 1703981, 10, 1703982, 10, 1703983, 10, 1703984, 10, 1703985, 10, 1703986, 10, 1703987, 10, 1703988, 10, 1703989, 10, 1703990, 10, 1703991, 10, 1703992, 10, 1703993, 10, 1703994, 10, 1703995, 10, 1703996, 10, 1703997, 10, 1703998, 10, 1703999, 10, 1704000, 10, 1704001, 10, 1704002, 10, 1704003, 10, 1704004, 10, 1704005, 10, 1704006, 10, 1704007, 10, 1769488, 10, 1769489, 10, 1769490, 10, 1769491, 10, 1769492, 10, 1769493, 10, 1769494, 10, 1769495, 10, 1769496, 10, 1769497, 10, 1769498, 10, 1769499, 10, 1769500, 10, 1769501, 10, 1769502, 10, 1769503, 10, 1769504, 10, 1769505, 10, 1769506, 10, 1769507, 10, 1769508, 10, 1769509, 10, 1769510, 10, 1769511, 10, 1769512, 10, 1769513, 10, 1769514, 10, 1769515, 10, 1769516, 10, 1769517, 10, 1769518, 10, 1769519, 10, 1769520, 10, 1769521, 10, 1769522, 10, 1769523, 10, 1769524, 10, 1769525, 10, 1769526, 10, 1769527, 10, 1769528, 10, 1769529, 10, 1769530, 10, 1769531, 10, 1769532, 10, 1769533, 10, 1769534, 10, 1769535, 10, 1769536, 10, 1769537, 10, 1769538, 10, 1769539, 10, 1769540, 10, 1769541, 10 "_edit_lock_" @@ -483,12 +487,10 @@ "3D" - "deflight_rot_y" - 0.628319 - "zfar" - 500 "fov" 45 + "zfar" + 500 "viewports" @@ -556,6 +558,8 @@ 0, 0, 0 + "deflight_rot_y" + 0.628319 "default_light" True "viewport_mode" @@ -806,7 +810,6 @@ "2D" - False 2 834.664, 1309.6 @@ -1000,7 +1003,7 @@ -1 "nodes" - -1, -1, 1, 0, -1, 2, 2, 0, 3, 1, 0, 0, 0, 5, 4, -1, 21, 2, 0, 6, 2, 7, 3, 8, 3, 9, 4, 10, 5, 11, 6, 12, 7, 13, 2, 14, 7, 15, 8, 16, 9, 17, 10, 18, 11, 19, 12, 20, 7, 21, 3, 22, 5, 23, 13, 24, 14, 3, 15, 0, 0, 0, 1, 25, -1, 2, 2, 0, 3, 16, 0, 2, 0, 27, 26, 17, 3, 2, 0, 9, 18, 3, 19, 0, 2, 0, 27, 28, 17, 3, 2, 0, 9, 20, 3, 19, 0, 2, 0, 27, 29, 17, 3, 2, 0, 9, 21, 3, 19, 0, 2, 0, 27, 30, 17, 3, 2, 0, 9, 22, 3, 19, 0, 2, 0, 27, 31, 17, 3, 2, 0, 9, 23, 3, 19, 0, 2, 0, 27, 32, 17, 3, 2, 0, 9, 24, 3, 19, 0, 2, 0, 27, 33, 17, 3, 2, 0, 9, 25, 3, 19, 0, 2, 0, 27, 34, 17, 3, 2, 0, 9, 26, 3, 19, 0, 2, 0, 27, 35, 17, 3, 2, 0, 9, 27, 3, 19, 0, 2, 0, 27, 36, 17, 3, 2, 0, 9, 28, 3, 19, 0, 2, 0, 27, 37, 17, 3, 2, 0, 9, 29, 3, 19, 0, 2, 0, 27, 38, 17, 3, 2, 0, 9, 30, 3, 19, 0, 2, 0, 27, 39, 17, 3, 2, 0, 9, 31, 3, 19, 0, 2, 0, 27, 40, 17, 3, 2, 0, 9, 32, 3, 19, 0, 2, 0, 27, 41, 17, 3, 2, 0, 9, 33, 3, 19, 0, 2, 0, 27, 42, 17, 3, 2, 0, 9, 34, 3, 19, 0, 2, 0, 27, 43, 17, 3, 2, 0, 9, 35, 3, 19, 0, 2, 0, 27, 44, 17, 3, 2, 0, 9, 36, 3, 19, 0, 2, 0, 27, 45, 17, 3, 2, 0, 9, 37, 3, 19, 0, 2, 0, 27, 46, 17, 3, 2, 0, 9, 38, 3, 19, 0, 2, 0, 27, 47, 17, 3, 2, 0, 9, 39, 3, 19, 0, 2, 0, 27, 48, 17, 3, 2, 0, 9, 40, 3, 19, 0, 2, 0, 27, 49, 17, 3, 2, 0, 9, 41, 3, 19, 0, 2, 0, 27, 50, 17, 3, 2, 0, 9, 42, 3, 19, 0, 2, 0, 27, 51, 17, 3, 2, 0, 9, 43, 3, 19, 0, 2, 0, 27, 52, 17, 3, 2, 0, 9, 44, 3, 19, 0, 2, 0, 27, 53, 17, 3, 2, 0, 9, 45, 3, 19, 0, 2, 0, 27, 54, 17, 3, 2, 0, 9, 46, 3, 19, 0, 2, 0, 27, 55, 17, 3, 2, 0, 9, 47, 3, 19, 0, 2, 0, 27, 56, 17, 3, 2, 0, 9, 48, 3, 19, 0, 2, 0, 27, 57, 17, 3, 2, 0, 9, 49, 3, 19, 0, 2, 0, 27, 58, 17, 3, 2, 0, 9, 50, 3, 19, 0, 2, 0, 27, 59, 17, 3, 2, 0, 9, 51, 3, 19, 0, 2, 0, 27, 60, 17, 3, 2, 0, 9, 52, 3, 19, 0, 2, 0, 27, 61, 17, 3, 2, 0, 9, 53, 3, 19, 0, 2, 0, 27, 62, 17, 3, 2, 0, 9, 54, 3, 19, 0, 2, 0, 27, 63, 17, 3, 2, 0, 9, 55, 3, 19, 0, 2, 0, 27, 64, 17, 3, 2, 0, 9, 56, 3, 19, 0, 2, 0, 27, 65, 17, 3, 2, 0, 9, 57, 3, 19, 0, 2, 0, 27, 66, 17, 3, 2, 0, 9, 58, 3, 19, 0, 2, 0, 27, 67, 17, 3, 2, 0, 9, 59, 3, 19, 0, 2, 0, 27, 68, 17, 3, 2, 0, 9, 60, 3, 19, 0, 0, 0, 70, 69, 61, 3, 2, 0, 9, 62, 3, 63, 0, 0, 0, 1, 71, -1, 1, 2, 0, 0, 46, 0, 73, 72, 64, 5, 2, 0, 9, 65, 3, 66, 74, 67, 75, 68, 0, 46, 0, 73, 76, 64, 5, 2, 0, 9, 69, 3, 66, 74, 70, 75, 71, 0, 46, 0, 73, 77, 64, 5, 2, 0, 9, 72, 3, 66, 74, 73, 75, 71, 0, 46, 0, 73, 78, 74, 3, 2, 0, 9, 75, 3, 76, 0, 0, 0, 80, 79, -1, 7, 2, 0, 81, 77, 82, 78, 83, 2, 84, 79, 85, 2, 86, 78, 0, 0, 0, 1, 87, -1, 1, 2, 0, 0, 52, 0, 70, 88, 80, 3, 2, 0, 9, 81, 3, 82, 0, 52, 0, 70, 89, 80, 3, 2, 0, 9, 83, 3, 82, 0, 52, 0, 70, 90, 80, 3, 2, 0, 9, 84, 3, 82, 0, 52, 0, 70, 91, 80, 3, 2, 0, 9, 85, 3, 82, 0, 52, 0, 70, 92, 80, 3, 2, 0, 9, 86, 3, 82, 0, 52, 0, 70, 93, 80, 3, 2, 0, 9, 87, 3, 82, 0, 52, 0, 70, 94, 80, 3, 2, 0, 9, 88, 3, 82, 0, 52, 0, 70, 95, 80, 3, 2, 0, 9, 89, 3, 82, 0, 52, 0, 70, 96, 80, 3, 2, 0, 9, 90, 3, 82, 0, 52, 0, 70, 97, 80, 3, 2, 0, 9, 91, 3, 82, 0, 52, 0, 70, 98, 80, 3, 2, 0, 9, 92, 3, 82, 0, 0, 0, 100, 99, 93, 2, 2, 0, 3, 94, 0, 0, 0, 101, 101, -1, 29, 2, 0, 6, 2, 7, 3, 8, 3, 102, 95, 103, 96, 104, 97, 105, 98, 106, 0, 107, 0, 108, 0, 109, 0, 110, 2, 111, 2, 112, 12, 113, 3, 114, 5, 115, 99, 116, 3, 117, 100, 118, 5, 119, 78, 120, 78, 121, 101, 122, 7, 123, 7, 124, 2, 125, 78, 126, 102, 0 + -1, -1, 1, 0, -1, 2, 2, 0, 3, 1, 0, 0, 0, 5, 4, -1, 24, 2, 0, 6, 2, 7, 3, 8, 3, 9, 4, 10, 5, 11, 6, 12, 7, 13, 8, 14, 2, 15, 8, 16, 9, 17, 10, 18, 11, 19, 12, 20, 13, 21, 8, 22, 14, 23, 14, 24, 3, 25, 6, 26, 4, 27, 15, 3, 16, 0, 0, 0, 1, 28, -1, 2, 2, 0, 3, 17, 0, 2, 0, 30, 29, 18, 3, 2, 0, 10, 19, 3, 20, 0, 2, 0, 30, 31, 18, 3, 2, 0, 10, 21, 3, 20, 0, 2, 0, 30, 32, 18, 3, 2, 0, 10, 22, 3, 20, 0, 2, 0, 30, 33, 18, 3, 2, 0, 10, 23, 3, 20, 0, 2, 0, 30, 34, 18, 3, 2, 0, 10, 24, 3, 20, 0, 2, 0, 30, 35, 18, 3, 2, 0, 10, 25, 3, 20, 0, 2, 0, 30, 36, 18, 3, 2, 0, 10, 26, 3, 20, 0, 2, 0, 30, 37, 18, 3, 2, 0, 10, 27, 3, 20, 0, 2, 0, 30, 38, 18, 3, 2, 0, 10, 28, 3, 20, 0, 2, 0, 30, 39, 18, 3, 2, 0, 10, 29, 3, 20, 0, 2, 0, 30, 40, 18, 3, 2, 0, 10, 30, 3, 20, 0, 2, 0, 30, 41, 18, 3, 2, 0, 10, 31, 3, 20, 0, 2, 0, 30, 42, 18, 3, 2, 0, 10, 32, 3, 20, 0, 2, 0, 30, 43, 18, 3, 2, 0, 10, 33, 3, 20, 0, 2, 0, 30, 44, 18, 3, 2, 0, 10, 34, 3, 20, 0, 2, 0, 30, 45, 18, 3, 2, 0, 10, 35, 3, 20, 0, 2, 0, 30, 46, 18, 3, 2, 0, 10, 36, 3, 20, 0, 2, 0, 30, 47, 18, 3, 2, 0, 10, 37, 3, 20, 0, 2, 0, 30, 48, 18, 3, 2, 0, 10, 38, 3, 20, 0, 2, 0, 30, 49, 18, 3, 2, 0, 10, 39, 3, 20, 0, 2, 0, 30, 50, 18, 3, 2, 0, 10, 40, 3, 20, 0, 2, 0, 30, 51, 18, 3, 2, 0, 10, 41, 3, 20, 0, 2, 0, 30, 52, 18, 3, 2, 0, 10, 42, 3, 20, 0, 2, 0, 30, 53, 18, 3, 2, 0, 10, 43, 3, 20, 0, 2, 0, 30, 54, 18, 3, 2, 0, 10, 44, 3, 20, 0, 2, 0, 30, 55, 18, 3, 2, 0, 10, 45, 3, 20, 0, 2, 0, 30, 56, 18, 3, 2, 0, 10, 46, 3, 20, 0, 2, 0, 30, 57, 18, 3, 2, 0, 10, 47, 3, 20, 0, 2, 0, 30, 58, 18, 3, 2, 0, 10, 48, 3, 20, 0, 2, 0, 30, 59, 18, 3, 2, 0, 10, 49, 3, 20, 0, 2, 0, 30, 60, 18, 3, 2, 0, 10, 50, 3, 20, 0, 2, 0, 30, 61, 18, 3, 2, 0, 10, 51, 3, 20, 0, 2, 0, 30, 62, 18, 3, 2, 0, 10, 52, 3, 20, 0, 2, 0, 30, 63, 18, 3, 2, 0, 10, 53, 3, 20, 0, 2, 0, 30, 64, 18, 3, 2, 0, 10, 54, 3, 20, 0, 2, 0, 30, 65, 18, 3, 2, 0, 10, 55, 3, 20, 0, 2, 0, 30, 66, 18, 3, 2, 0, 10, 56, 3, 20, 0, 2, 0, 30, 67, 18, 3, 2, 0, 10, 57, 3, 20, 0, 2, 0, 30, 68, 18, 3, 2, 0, 10, 58, 3, 20, 0, 2, 0, 30, 69, 18, 3, 2, 0, 10, 59, 3, 20, 0, 2, 0, 30, 70, 18, 3, 2, 0, 10, 60, 3, 20, 0, 2, 0, 30, 71, 18, 3, 2, 0, 10, 61, 3, 20, 0, 0, 0, 73, 72, 62, 3, 2, 0, 10, 63, 3, 64, 0, 0, 0, 1, 74, -1, 1, 2, 0, 0, 46, 0, 76, 75, 65, 5, 2, 0, 10, 66, 3, 67, 77, 68, 78, 69, 0, 46, 0, 76, 79, 65, 5, 2, 0, 10, 70, 3, 67, 77, 71, 78, 72, 0, 46, 0, 76, 80, 65, 5, 2, 0, 10, 73, 3, 67, 77, 74, 78, 72, 0, 46, 0, 76, 81, 75, 3, 2, 0, 10, 76, 3, 77, 0, 0, 0, 83, 82, -1, 7, 2, 0, 84, 78, 85, 14, 86, 2, 87, 79, 88, 2, 89, 14, 0, 0, 0, 1, 90, -1, 1, 2, 0, 0, 52, 0, 73, 91, 80, 3, 2, 0, 10, 81, 3, 82, 0, 52, 0, 73, 92, 80, 3, 2, 0, 10, 83, 3, 82, 0, 52, 0, 73, 93, 80, 3, 2, 0, 10, 84, 3, 82, 0, 52, 0, 73, 94, 80, 3, 2, 0, 10, 85, 3, 82, 0, 52, 0, 73, 95, 80, 3, 2, 0, 10, 86, 3, 82, 0, 52, 0, 73, 96, 80, 3, 2, 0, 10, 87, 3, 82, 0, 52, 0, 73, 97, 80, 3, 2, 0, 10, 88, 3, 82, 0, 52, 0, 73, 98, 80, 3, 2, 0, 10, 89, 3, 82, 0, 52, 0, 73, 99, 80, 3, 2, 0, 10, 90, 3, 82, 0, 52, 0, 73, 100, 80, 3, 2, 0, 10, 91, 3, 82, 0, 52, 0, 73, 101, 80, 3, 2, 0, 10, 92, 3, 82, 0, 0, 0, 103, 102, 93, 2, 2, 0, 3, 94, 0, 0, 0, 104, 104, -1, 30, 2, 0, 6, 2, 7, 3, 8, 3, 9, 4, 105, 95, 106, 96, 107, 97, 108, 98, 109, 0, 110, 0, 111, 0, 112, 0, 113, 2, 114, 2, 115, 13, 116, 3, 117, 6, 118, 99, 119, 3, 120, 100, 121, 6, 122, 14, 123, 14, 124, 101, 125, 8, 126, 8, 127, 2, 128, 14, 129, 102, 0 "conns" -- cgit v1.2.3 From 40496dd76ae53c93ef5ea7e56671682a7cae9def Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 21 Mar 2015 10:15:30 -0300 Subject: signed distance field fonts demo --- demos/2d/sdf_font/KaushanScript-Regular.otf | Bin 0 -> 89168 bytes demos/2d/sdf_font/engine.cfg | 4 ++++ demos/2d/sdf_font/font.fnt | Bin 0 -> 180332 bytes demos/2d/sdf_font/sdf.scn | Bin 0 -> 2415 bytes 4 files changed, 4 insertions(+) create mode 100644 demos/2d/sdf_font/KaushanScript-Regular.otf create mode 100644 demos/2d/sdf_font/engine.cfg create mode 100644 demos/2d/sdf_font/font.fnt create mode 100644 demos/2d/sdf_font/sdf.scn (limited to 'demos') diff --git a/demos/2d/sdf_font/KaushanScript-Regular.otf b/demos/2d/sdf_font/KaushanScript-Regular.otf new file mode 100644 index 0000000000..bd29502100 Binary files /dev/null and b/demos/2d/sdf_font/KaushanScript-Regular.otf differ diff --git a/demos/2d/sdf_font/engine.cfg b/demos/2d/sdf_font/engine.cfg new file mode 100644 index 0000000000..bdf26ce741 --- /dev/null +++ b/demos/2d/sdf_font/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Signed Distance Field Font" +main_scene="res://sdf.scn" diff --git a/demos/2d/sdf_font/font.fnt b/demos/2d/sdf_font/font.fnt new file mode 100644 index 0000000000..c2b6b0177d Binary files /dev/null and b/demos/2d/sdf_font/font.fnt differ diff --git a/demos/2d/sdf_font/sdf.scn b/demos/2d/sdf_font/sdf.scn new file mode 100644 index 0000000000..89d6245bf0 Binary files /dev/null and b/demos/2d/sdf_font/sdf.scn differ -- cgit v1.2.3 From c6c72a3c37a44964ec8e6b3353f78635bf588eab Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 22 Mar 2015 01:46:18 -0300 Subject: input events on Area2D is now supported also added a demo showing how this works --- demos/2d/area_input/box_area.png | Bin 0 -> 1246 bytes demos/2d/area_input/circle_area.png | Bin 0 -> 3030 bytes demos/2d/area_input/engine.cfg | 4 ++++ demos/2d/area_input/input.gd | 20 ++++++++++++++++++++ demos/2d/area_input/input.scn | Bin 0 -> 2886 bytes 5 files changed, 24 insertions(+) create mode 100644 demos/2d/area_input/box_area.png create mode 100644 demos/2d/area_input/circle_area.png create mode 100644 demos/2d/area_input/engine.cfg create mode 100644 demos/2d/area_input/input.gd create mode 100644 demos/2d/area_input/input.scn (limited to 'demos') diff --git a/demos/2d/area_input/box_area.png b/demos/2d/area_input/box_area.png new file mode 100644 index 0000000000..ba7c37f7de Binary files /dev/null and b/demos/2d/area_input/box_area.png differ diff --git a/demos/2d/area_input/circle_area.png b/demos/2d/area_input/circle_area.png new file mode 100644 index 0000000000..3cc24c8a0c Binary files /dev/null and b/demos/2d/area_input/circle_area.png differ diff --git a/demos/2d/area_input/engine.cfg b/demos/2d/area_input/engine.cfg new file mode 100644 index 0000000000..3227e9278f --- /dev/null +++ b/demos/2d/area_input/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Area 2D Input Events" +main_scene="res://input.scn" diff --git a/demos/2d/area_input/input.gd b/demos/2d/area_input/input.gd new file mode 100644 index 0000000000..acecd095ed --- /dev/null +++ b/demos/2d/area_input/input.gd @@ -0,0 +1,20 @@ + +extends Area2D + +# member variables here, example: +# var a=2 +# var b="textvar" + +#virtual from CollisionObject2D (also available as signal) +func _input_event(viewport, event, shape_idx): + #convert event to local coordinates + if (event.type==InputEvent.MOUSE_MOTION): + event = make_input_local( event ) + get_node("label").set_text(str(event.pos)) + +#virtual from CollisionObject2D (also available as signal) +func _mouse_exit(): + get_node("label").set_text("") + + + diff --git a/demos/2d/area_input/input.scn b/demos/2d/area_input/input.scn new file mode 100644 index 0000000000..0bb3a18834 Binary files /dev/null and b/demos/2d/area_input/input.scn differ -- cgit v1.2.3 From dac2017dee8a58c85b8b3218a779260d3b5f4072 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 22 Mar 2015 09:40:26 -0300 Subject: fixes/cleans up -input now correctly works when using viewport scaling -added function to get areas/bodies in given point -added function to get space state directly from world --- demos/2d/area_input/input.gd | 4 ---- demos/2d/area_input/input.scn | Bin 2886 -> 2886 bytes 2 files changed, 4 deletions(-) (limited to 'demos') diff --git a/demos/2d/area_input/input.gd b/demos/2d/area_input/input.gd index acecd095ed..3f719fc853 100644 --- a/demos/2d/area_input/input.gd +++ b/demos/2d/area_input/input.gd @@ -1,10 +1,6 @@ extends Area2D -# member variables here, example: -# var a=2 -# var b="textvar" - #virtual from CollisionObject2D (also available as signal) func _input_event(viewport, event, shape_idx): #convert event to local coordinates diff --git a/demos/2d/area_input/input.scn b/demos/2d/area_input/input.scn index 0bb3a18834..1a2dcbc5f4 100644 Binary files a/demos/2d/area_input/input.scn and b/demos/2d/area_input/input.scn differ -- cgit v1.2.3 From 78694d85425b35d2c6c0e0a4b0ef3e57375553c6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 22 Mar 2015 11:52:07 -0300 Subject: gui in 3D demo now uses area for input --- demos/viewport/gui_in_3d/gui_3d.gd | 49 ++++++++++++++++++------------------ demos/viewport/gui_in_3d/gui_3d.scn | Bin 3498 -> 4668 bytes 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'demos') diff --git a/demos/viewport/gui_in_3d/gui_3d.gd b/demos/viewport/gui_in_3d/gui_3d.gd index 5309db9acb..c2a9df0069 100644 --- a/demos/viewport/gui_in_3d/gui_3d.gd +++ b/demos/viewport/gui_in_3d/gui_3d.gd @@ -7,38 +7,39 @@ extends Spatial var prev_pos=null -func _input(ev): - if (ev.type in [InputEvent.MOUSE_BUTTON,InputEvent.MOUSE_MOTION]): - var pos = ev.pos - var rfrom = get_node("camera").project_ray_origin(pos) - var rnorm = get_node("camera").project_ray_normal(pos) + +func _input( ev ): + #all other (non-mouse) events + if (not ev.type in [InputEvent.MOUSE_BUTTON,InputEvent.MOUSE_MOTION,InputEvent.SCREEN_DRAG,InputEvent.SCREEN_TOUCH]): + get_node("viewport").input(ev) - #simple collision test against aligned plane - #for game UIs of this kind consider more complex collision against plane - var p = Plane(Vector3(0,0,1),0).intersects_ray(rfrom,rnorm) - if (p==null): - return - - pos.x=(p.x+1.5)*100 - pos.y=(-p.y+0.75)*100 - ev.pos=pos - ev.global_pos=pos - if (prev_pos==null): - prev_pos=pos - if (ev.type==InputEvent.MOUSE_MOTION): - ev.relative_pos=pos-prev_pos + +#mouse events for area +func _on_area_input_event( camera, ev, click_pos, click_normal, shape_idx ): + + #use click pos (click in 3d space, convert to area space + var pos = get_node("area").get_global_transform().affine_inverse() * click_pos + #convert to 2D + pos = Vector2(pos.x,pos.y) + #convert to viewport coordinate system + pos.x=(pos.x+1.5)*100 + pos.y=(-pos.y+0.75)*100 + #set to event + ev.pos=pos + ev.global_pos=pos + if (prev_pos==null): prev_pos=pos + if (ev.type==InputEvent.MOUSE_MOTION): + ev.relative_pos=pos-prev_pos + prev_pos=pos get_node("viewport").input(ev) - - + func _ready(): # Initalization here - get_node("quad").get_material_override().set_texture(FixedMaterial.PARAM_DIFFUSE, get_node("viewport").get_render_target_texture() ) + get_node("area/quad").get_material_override().set_texture(FixedMaterial.PARAM_DIFFUSE, get_node("viewport").get_render_target_texture() ) set_process_input(true) - pass - diff --git a/demos/viewport/gui_in_3d/gui_3d.scn b/demos/viewport/gui_in_3d/gui_3d.scn index df8f7d6dc5..c69d4dc73f 100644 Binary files a/demos/viewport/gui_in_3d/gui_3d.scn and b/demos/viewport/gui_in_3d/gui_3d.scn differ -- cgit v1.2.3 From 1e4841dc522585904d0b1564ddbda5fe913e890e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 22 Mar 2015 12:52:47 -0300 Subject: drag & drop demo (GUI) --- demos/gui/drag_and_drop/drag_and_drop.scn | Bin 0 -> 2596 bytes demos/gui/drag_and_drop/drag_drop_script.gd | 27 +++++++++++++++++++++++++++ demos/gui/drag_and_drop/engine.cfg | 4 ++++ 3 files changed, 31 insertions(+) create mode 100644 demos/gui/drag_and_drop/drag_and_drop.scn create mode 100644 demos/gui/drag_and_drop/drag_drop_script.gd create mode 100644 demos/gui/drag_and_drop/engine.cfg (limited to 'demos') diff --git a/demos/gui/drag_and_drop/drag_and_drop.scn b/demos/gui/drag_and_drop/drag_and_drop.scn new file mode 100644 index 0000000000..f2122a459e Binary files /dev/null and b/demos/gui/drag_and_drop/drag_and_drop.scn differ diff --git a/demos/gui/drag_and_drop/drag_drop_script.gd b/demos/gui/drag_and_drop/drag_drop_script.gd new file mode 100644 index 0000000000..a99b963efa --- /dev/null +++ b/demos/gui/drag_and_drop/drag_drop_script.gd @@ -0,0 +1,27 @@ + +extends ColorPickerButton + +# member variables here, example: +# var a=2 +# var b="textvar" +func get_drag_data(pos): + + #use another control as drag preview + var cpb = ColorPickerButton.new() + cpb.set_color( get_color() ) + cpb.set_size(Vector2(50,50)) + set_drag_preview(cpb) + #return color as drag data + return get_color() + +func can_drop_data(pos, data): + return typeof(data)==TYPE_COLOR + +func drop_data(pos, data): + set_color(data) + +func _ready(): + # Initialization here + pass + + diff --git a/demos/gui/drag_and_drop/engine.cfg b/demos/gui/drag_and_drop/engine.cfg new file mode 100644 index 0000000000..448939c61d --- /dev/null +++ b/demos/gui/drag_and_drop/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Drag & Drop (GUI)" +main_scene="res://drag_and_drop.scn" -- cgit v1.2.3 From 8c91dadff7422c3f6ba5b259634e9ae64b5e270d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 22 Mar 2015 13:01:34 -0300 Subject: minor comments --- demos/gui/drag_and_drop/drag_and_drop.scn | Bin 2596 -> 2594 bytes demos/gui/drag_and_drop/drag_drop_script.gd | 17 +++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'demos') diff --git a/demos/gui/drag_and_drop/drag_and_drop.scn b/demos/gui/drag_and_drop/drag_and_drop.scn index f2122a459e..94a25cc53e 100644 Binary files a/demos/gui/drag_and_drop/drag_and_drop.scn and b/demos/gui/drag_and_drop/drag_and_drop.scn differ diff --git a/demos/gui/drag_and_drop/drag_drop_script.gd b/demos/gui/drag_and_drop/drag_drop_script.gd index a99b963efa..21a737ce1a 100644 --- a/demos/gui/drag_and_drop/drag_drop_script.gd +++ b/demos/gui/drag_and_drop/drag_drop_script.gd @@ -1,27 +1,24 @@ extends ColorPickerButton -# member variables here, example: -# var a=2 -# var b="textvar" + +#virtual function func get_drag_data(pos): - #use another control as drag preview + #use another colorpicker as drag preview var cpb = ColorPickerButton.new() cpb.set_color( get_color() ) cpb.set_size(Vector2(50,50)) set_drag_preview(cpb) #return color as drag data return get_color() - + +#virtual function func can_drop_data(pos, data): return typeof(data)==TYPE_COLOR - + +#virtual function func drop_data(pos, data): set_color(data) -func _ready(): - # Initialization here - pass - -- cgit v1.2.3 From 23e13ce3c209da13a7bbf771cf31588045ad432e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 22 Mar 2015 19:00:50 -0300 Subject: fixes to new window management API -needs testing on Linux -needs testing on Windows -NEED SOMEONE TO IMPLEMENT IT ON OSX!! PLEASE HELP! --- demos/misc/window_management/control.gd | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index bca13c5a0c..d1b8f0e71a 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -35,7 +35,7 @@ func _fixed_process(delta): 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_screen() ) ) + 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() ) ) @@ -54,10 +54,10 @@ func _fixed_process(delta): get_node("Label_Screen1_Resolution").hide() get_node("Label_Screen1_Position").hide() - get_node("Button_Fullscreen").set_pressed( OS.is_fullscreen() ) - get_node("Button_FixedSize").set_pressed( !OS.is_resizable() ) - get_node("Button_Minimized").set_pressed( OS.is_minimized() ) - get_node("Button_Maximized").set_pressed( OS.is_maximized() ) + get_node("Button_Fullscreen").set_pressed( OS.is_window_fullscreen() ) + get_node("Button_FixedSize").set_pressed( !OS.is_is_window_resizable() ) + get_node("Button_Minimized").set_pressed( OS.is_is_window_minimized() ) + get_node("Button_Maximized").set_pressed( OS.is_is_window_maximized() ) get_node("Button_Mouse_Grab").set_pressed( Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED ) @@ -137,39 +137,39 @@ func _on_Button_Resize_pressed(): func _on_Button_Screen0_pressed(): - OS.set_screen(0) + OS.set_current_screen(0) func _on_Button_Screen1_pressed(): - OS.set_screen(1) + OS.set_current_screen(1) func _on_Button_Fullscreen_pressed(): - if(OS.is_fullscreen()): - OS.set_fullscreen(false) + if(OS.is_window_fullscreen()): + OS.set_window_fullscreen(false) else: - OS.set_fullscreen(true) + OS.set_window_fullscreen(true) func _on_Button_FixedSize_pressed(): - if(OS.is_resizable()): - OS.set_resizable(false) + if(OS.is_window_resizable()): + OS.set_window_resizable(false) else: - OS.set_resizable(true) + OS.set_window_resizable(true) func _on_Button_Minimized_pressed(): - if(OS.is_minimized()): - OS.set_minimized(false) + if(OS.is_window_minimized()): + OS.set_window_minimized(false) else: - OS.set_minimized(true) + OS.set_window_minimized(true) func _on_Button_Maximized_pressed(): - if(OS.is_maximized()): - OS.set_maximized(false) + if(OS.is_window_maximized()): + OS.set_window_maximized(false) else: - OS.set_maximized(true) + OS.set_window_maximized(true) func _on_Button_Mouse_Grab_pressed(): -- cgit v1.2.3 From 001a16064f886944f2746828c3b8d8be813838e5 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Mon, 23 Mar 2015 00:09:12 -0400 Subject: adjust the window_management demo to the new function names --- demos/misc/window_management/control.gd | 54 ++++++++++----------- demos/misc/window_management/window_management.scn | Bin 5087 -> 5129 bytes 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'demos') diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd index d1b8f0e71a..5eb5817619 100644 --- a/demos/misc/window_management/control.gd +++ b/demos/misc/window_management/control.gd @@ -5,18 +5,18 @@ func _fixed_process(delta): var modetext = "Mode:\n" - if(OS.is_fullscreen()): + if(OS.is_window_fullscreen()): modetext += "Fullscreen\n" else: modetext += "Windowed\n" - if(!OS.is_resizable()): + if(!OS.is_window_resizable()): modetext += "FixedSize\n" - if(OS.is_minimized()): + if(OS.is_window_minimized()): modetext += "Minimized\n" - if(OS.is_maximized()): + if(OS.is_window_maximized()): modetext += "Maximized\n" if(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED): @@ -55,9 +55,9 @@ func _fixed_process(delta): get_node("Label_Screen1_Position").hide() get_node("Button_Fullscreen").set_pressed( OS.is_window_fullscreen() ) - get_node("Button_FixedSize").set_pressed( !OS.is_is_window_resizable() ) - get_node("Button_Minimized").set_pressed( OS.is_is_window_minimized() ) - get_node("Button_Maximized").set_pressed( OS.is_is_window_maximized() ) + 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_Mouse_Grab").set_pressed( Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED ) @@ -66,11 +66,11 @@ func check_wm_api(): if( !OS.has_method("get_screen_count") ): s += " - get_screen_count()\n" - if( !OS.has_method("get_screen") ): - s += " - get_screen()\n" + if( !OS.has_method("get_current_screen") ): + s += " - get_current_screen()\n" - if( !OS.has_method("set_screen") ): - s += " - set_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" @@ -90,29 +90,29 @@ func check_wm_api(): if( !OS.has_method("set_window_size") ): s += " - set_window_size()\n" - if( !OS.has_method("set_fullscreen") ): - s += " - set_fullscreen()\n" + if( !OS.has_method("set_window_fullscreen") ): + s += " - set_window_fullscreen()\n" - if( !OS.has_method("is_fullscreen") ): - s += " - is_fullscreen()\n" + if( !OS.has_method("is_window_fullscreen") ): + s += " - is_window_fullscreen()\n" - if( !OS.has_method("set_resizable") ): - s += " - set_resizable()\n" + if( !OS.has_method("set_window_resizable") ): + s += " - set_window_resizable()\n" - if( !OS.has_method("is_resizable") ): - s += " - is_resizable()\n" + if( !OS.has_method("is_window_resizable") ): + s += " - is_window_resizable()\n" - if( !OS.has_method("set_minimized") ): - s += " - set_minimized()\n" + if( !OS.has_method("set_window_minimized") ): + s += " - set_window_minimized()\n" - if( !OS.has_method("is_minimized") ): - s += " - is_minimized()\n" + if( !OS.has_method("is_window_minimized") ): + s += " - is_window_minimized()\n" - if( !OS.has_method("set_maximized") ): - s += " - set_maximized()\n" + if( !OS.has_method("set_window_maximized") ): + s += " - set_window_maximized()\n" - if( !OS.has_method("is_maximized") ): - s += " - is_maximized()\n" + if( !OS.has_method("is_window_maximized") ): + s += " - is_window_maximized()\n" if( s.length() == 0 ): return true diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn index b8b0ee210b..c7d6260df6 100644 Binary files a/demos/misc/window_management/window_management.scn and b/demos/misc/window_management/window_management.scn differ -- cgit v1.2.3 From cbad0440ab078e72fcd5af50fa800d9720fb7761 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 24 Mar 2015 16:17:16 -0300 Subject: 2D normal mapping and lighting simple demos --- demos/2d/lights_shadows/bg.png | Bin 0 -> 294 bytes demos/2d/lights_shadows/caster.png | Bin 0 -> 122 bytes demos/2d/lights_shadows/engine.cfg | 8 ++++++++ demos/2d/lights_shadows/light.png | Bin 0 -> 243776 bytes demos/2d/lights_shadows/light_shadows.scn | Bin 0 -> 4293 bytes demos/2d/lights_shadows/spot.png | Bin 0 -> 3699 bytes demos/2d/normalmaps/diffuse.jpg | Bin 0 -> 535660 bytes demos/2d/normalmaps/diffuse.png | Bin 0 -> 2392221 bytes demos/2d/normalmaps/engine.cfg | 4 ++++ demos/2d/normalmaps/light.png | Bin 0 -> 243776 bytes demos/2d/normalmaps/normal.png | Bin 0 -> 2301245 bytes demos/2d/normalmaps/normal_material.res | Bin 0 -> 503 bytes demos/2d/normalmaps/normalmap.scn | Bin 0 -> 2450 bytes demos/2d/texscreen/OpenCV_Chessboard.png | Bin 0 -> 44884 bytes 14 files changed, 12 insertions(+) create mode 100644 demos/2d/lights_shadows/bg.png create mode 100644 demos/2d/lights_shadows/caster.png create mode 100644 demos/2d/lights_shadows/engine.cfg create mode 100644 demos/2d/lights_shadows/light.png create mode 100644 demos/2d/lights_shadows/light_shadows.scn create mode 100644 demos/2d/lights_shadows/spot.png create mode 100644 demos/2d/normalmaps/diffuse.jpg create mode 100644 demos/2d/normalmaps/diffuse.png create mode 100644 demos/2d/normalmaps/engine.cfg create mode 100644 demos/2d/normalmaps/light.png create mode 100644 demos/2d/normalmaps/normal.png create mode 100644 demos/2d/normalmaps/normal_material.res create mode 100644 demos/2d/normalmaps/normalmap.scn create mode 100644 demos/2d/texscreen/OpenCV_Chessboard.png (limited to 'demos') diff --git a/demos/2d/lights_shadows/bg.png b/demos/2d/lights_shadows/bg.png new file mode 100644 index 0000000000..4a3376f484 Binary files /dev/null and b/demos/2d/lights_shadows/bg.png differ diff --git a/demos/2d/lights_shadows/caster.png b/demos/2d/lights_shadows/caster.png new file mode 100644 index 0000000000..bf53a4565b Binary files /dev/null and b/demos/2d/lights_shadows/caster.png differ diff --git a/demos/2d/lights_shadows/engine.cfg b/demos/2d/lights_shadows/engine.cfg new file mode 100644 index 0000000000..bb9d1ef256 --- /dev/null +++ b/demos/2d/lights_shadows/engine.cfg @@ -0,0 +1,8 @@ +[application] + +name="2D Lighting" +main_scene="res://light_shadows.scn" + +[rasterizer] + +shadow_filter=2 diff --git a/demos/2d/lights_shadows/light.png b/demos/2d/lights_shadows/light.png new file mode 100644 index 0000000000..936860de52 Binary files /dev/null and b/demos/2d/lights_shadows/light.png differ diff --git a/demos/2d/lights_shadows/light_shadows.scn b/demos/2d/lights_shadows/light_shadows.scn new file mode 100644 index 0000000000..34781b8049 Binary files /dev/null and b/demos/2d/lights_shadows/light_shadows.scn differ diff --git a/demos/2d/lights_shadows/spot.png b/demos/2d/lights_shadows/spot.png new file mode 100644 index 0000000000..9ab2d34963 Binary files /dev/null and b/demos/2d/lights_shadows/spot.png differ diff --git a/demos/2d/normalmaps/diffuse.jpg b/demos/2d/normalmaps/diffuse.jpg new file mode 100644 index 0000000000..87bc9cf158 Binary files /dev/null and b/demos/2d/normalmaps/diffuse.jpg differ diff --git a/demos/2d/normalmaps/diffuse.png b/demos/2d/normalmaps/diffuse.png new file mode 100644 index 0000000000..634d955f8d Binary files /dev/null and b/demos/2d/normalmaps/diffuse.png differ diff --git a/demos/2d/normalmaps/engine.cfg b/demos/2d/normalmaps/engine.cfg new file mode 100644 index 0000000000..3fc2048716 --- /dev/null +++ b/demos/2d/normalmaps/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="2D Normal Mapping" +main_scene="res://normalmap.scn" diff --git a/demos/2d/normalmaps/light.png b/demos/2d/normalmaps/light.png new file mode 100644 index 0000000000..9568298086 Binary files /dev/null and b/demos/2d/normalmaps/light.png differ diff --git a/demos/2d/normalmaps/normal.png b/demos/2d/normalmaps/normal.png new file mode 100644 index 0000000000..d5b3d53a24 Binary files /dev/null and b/demos/2d/normalmaps/normal.png differ diff --git a/demos/2d/normalmaps/normal_material.res b/demos/2d/normalmaps/normal_material.res new file mode 100644 index 0000000000..34129cccdc Binary files /dev/null and b/demos/2d/normalmaps/normal_material.res differ diff --git a/demos/2d/normalmaps/normalmap.scn b/demos/2d/normalmaps/normalmap.scn new file mode 100644 index 0000000000..ab737e83f3 Binary files /dev/null and b/demos/2d/normalmaps/normalmap.scn differ diff --git a/demos/2d/texscreen/OpenCV_Chessboard.png b/demos/2d/texscreen/OpenCV_Chessboard.png new file mode 100644 index 0000000000..31b7f8ccd8 Binary files /dev/null and b/demos/2d/texscreen/OpenCV_Chessboard.png differ -- cgit v1.2.3 From ad634876b5b7d775f6d490cf7f874c6aae058a28 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 31 Mar 2015 14:58:52 -0300 Subject: fixes for light2d in androids that do not support read depth --- demos/2d/lights_shadows/light_shadows.scn | Bin 4293 -> 4293 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'demos') diff --git a/demos/2d/lights_shadows/light_shadows.scn b/demos/2d/lights_shadows/light_shadows.scn index 34781b8049..a13e31376e 100644 Binary files a/demos/2d/lights_shadows/light_shadows.scn and b/demos/2d/lights_shadows/light_shadows.scn differ -- cgit v1.2.3 From 3920c497b3811b3c0c970631599c13025c81ff14 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 31 Mar 2015 19:02:40 -0300 Subject: Option in Android export to use 32 bits buffer. --- demos/2d/isometric_light/export.cfg | 262 ------------------------------------ 1 file changed, 262 deletions(-) delete mode 100644 demos/2d/isometric_light/export.cfg (limited to 'demos') diff --git a/demos/2d/isometric_light/export.cfg b/demos/2d/isometric_light/export.cfg deleted file mode 100644 index 578d4171b2..0000000000 --- a/demos/2d/isometric_light/export.cfg +++ /dev/null @@ -1,262 +0,0 @@ -[convert_images] - -action="none" -compress_quality=0.7 -formats="png" -shrink=1 - -[export_filter] - -filter="" -type="resources" - -[image_group_files] - -files=["res://faceNormal.png", "normal", "res://faceColor.png", "normal", "res://faceMask.png", "normal"] - -[image_groups] - -normal={"atlas":false, "action":"compress_ram", "shrink":1, "lossy_quality":0.7} - -[platform:Android] - -apk_expansion/SALT="" -apk_expansion/enable=false -apk_expansion/public_key="" -command_line/extra_args="" -custom_package/debug="" -custom_package/release="" -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="com.android.noname" -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/orientation=0 -screen/support_large=true -screen/support_normal=true -screen/support_small=true -screen/support_xlarge=true -user_permissions/0="" -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] - -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="" -options/memory_size=3 - -[platform:Linux X11] - -binary/64_bits=true -custom_binary/debug="" -custom_binary/release="" -resources/pack_mode=1 - -[platform:Mac OSX] - -application/64_bits=false -application/copyright="" -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="" -display/high_res=false - -[platform:Windows Desktop] - -binary/64_bits=true -custom_binary/debug="" -custom_binary/release="" -resources/pack_mode=1 - -[script] - -action="compile" -encrypt_key="" -- cgit v1.2.3 From 9fa1698c7420bae2c6353bf300ce2cdb73434bf6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 3 Apr 2015 01:43:37 -0300 Subject: Changes to Light -=-=-=-=-=-=-=-= -Changed material unshaded property for an enum, which supports light-only shading -Added a "Mix" shading mode, useful for using lights as masks -Added energy parameter to Light2D --- demos/2d/light_mask/burano.png | Bin 0 -> 974437 bytes demos/2d/light_mask/engine.cfg | 4 ++++ demos/2d/light_mask/lightmask.scn | Bin 0 -> 2916 bytes demos/2d/light_mask/splat.png | Bin 0 -> 18255 bytes 4 files changed, 4 insertions(+) create mode 100644 demos/2d/light_mask/burano.png create mode 100644 demos/2d/light_mask/engine.cfg create mode 100644 demos/2d/light_mask/lightmask.scn create mode 100644 demos/2d/light_mask/splat.png (limited to 'demos') diff --git a/demos/2d/light_mask/burano.png b/demos/2d/light_mask/burano.png new file mode 100644 index 0000000000..6eec09d585 Binary files /dev/null and b/demos/2d/light_mask/burano.png differ diff --git a/demos/2d/light_mask/engine.cfg b/demos/2d/light_mask/engine.cfg new file mode 100644 index 0000000000..0e9389f853 --- /dev/null +++ b/demos/2d/light_mask/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Using Lights As Mask" +main_scene="res://lightmask.scn" diff --git a/demos/2d/light_mask/lightmask.scn b/demos/2d/light_mask/lightmask.scn new file mode 100644 index 0000000000..08805f44c6 Binary files /dev/null and b/demos/2d/light_mask/lightmask.scn differ diff --git a/demos/2d/light_mask/splat.png b/demos/2d/light_mask/splat.png new file mode 100644 index 0000000000..8c35f068a0 Binary files /dev/null and b/demos/2d/light_mask/splat.png differ -- cgit v1.2.3 From 5d99e15e43d5a446b35d48e8a3b08a478f1998a9 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 3 Apr 2015 14:36:10 -0300 Subject: fix shadow issue with lights in mix mode, i think fixes #1611 --- demos/2d/light_mask/engine.cfg | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demos') diff --git a/demos/2d/light_mask/engine.cfg b/demos/2d/light_mask/engine.cfg index 0e9389f853..8b0ae6f61d 100644 --- a/demos/2d/light_mask/engine.cfg +++ b/demos/2d/light_mask/engine.cfg @@ -2,3 +2,7 @@ name="Using Lights As Mask" main_scene="res://lightmask.scn" + +[rasterizer] + +shadow_filter=3 -- cgit v1.2.3