diff options
Diffstat (limited to 'demos/3d')
-rw-r--r-- | demos/3d/kinematic_char/level.scn | bin | 15257 -> 15248 bytes | |||
-rw-r--r-- | demos/3d/mousepick_test/engine.cfg | 5 | ||||
-rw-r--r-- | demos/3d/mousepick_test/icon.png | bin | 0 -> 2451 bytes | |||
-rw-r--r-- | demos/3d/mousepick_test/mousepick.gd | 32 | ||||
-rw-r--r-- | demos/3d/mousepick_test/mousepick.scn | bin | 0 -> 38194 bytes |
5 files changed, 37 insertions, 0 deletions
diff --git a/demos/3d/kinematic_char/level.scn b/demos/3d/kinematic_char/level.scn Binary files differindex 785db19adc..1d7e5a4a70 100644 --- a/demos/3d/kinematic_char/level.scn +++ b/demos/3d/kinematic_char/level.scn diff --git a/demos/3d/mousepick_test/engine.cfg b/demos/3d/mousepick_test/engine.cfg new file mode 100644 index 0000000000..093999a87a --- /dev/null +++ b/demos/3d/mousepick_test/engine.cfg @@ -0,0 +1,5 @@ +[application] + +name="3D Mouse Picking Test" +main_scene="res://mousepick.scn" +icon="res://icon.png" diff --git a/demos/3d/mousepick_test/icon.png b/demos/3d/mousepick_test/icon.png Binary files differnew file mode 100644 index 0000000000..264f991e15 --- /dev/null +++ b/demos/3d/mousepick_test/icon.png diff --git a/demos/3d/mousepick_test/mousepick.gd b/demos/3d/mousepick_test/mousepick.gd new file mode 100644 index 0000000000..cf3d9f1e4e --- /dev/null +++ b/demos/3d/mousepick_test/mousepick.gd @@ -0,0 +1,32 @@ + +extends RigidBody + +# member variables here, example: +# var a=2 +# var b="textvar" + +var gray_mat = FixedMaterial.new() + +var selected=false + +func _input_event(event,pos,normal,shape): + if (event.type==InputEvent.MOUSE_BUTTON and event.pressed): + if (not selected): + get_node("mesh").set_material_override(gray_mat) + else: + get_node("mesh").set_material_override(null) + + selected = not selected + + +func _mouse_enter(): + get_node("mesh").set_scale( Vector3(1.1,1.1,1.1) ) + +func _mouse_exit(): + get_node("mesh").set_scale( Vector3(1,1,1) ) + +func _ready(): + # Initalization here + pass + + diff --git a/demos/3d/mousepick_test/mousepick.scn b/demos/3d/mousepick_test/mousepick.scn Binary files differnew file mode 100644 index 0000000000..7ecac46a86 --- /dev/null +++ b/demos/3d/mousepick_test/mousepick.scn |