summaryrefslogtreecommitdiff
path: root/demos/3d/mousepick_test
diff options
context:
space:
mode:
Diffstat (limited to 'demos/3d/mousepick_test')
-rw-r--r--demos/3d/mousepick_test/mousepick.gd22
-rw-r--r--demos/3d/mousepick_test/mousepick.scnbin38194 -> 40434 bytes
2 files changed, 7 insertions, 15 deletions
diff --git a/demos/3d/mousepick_test/mousepick.gd b/demos/3d/mousepick_test/mousepick.gd
index c96091b650..674ec7ff6f 100644
--- a/demos/3d/mousepick_test/mousepick.gd
+++ b/demos/3d/mousepick_test/mousepick.gd
@@ -1,15 +1,12 @@
extends RigidBody
-# member variables here, example:
-# var a=2
-# var b="textvar"
-
+# Member variables
var gray_mat = FixedMaterial.new()
+var selected = false
-var selected=false
-func _input_event(camera,event,pos,normal,shape):
+func _input_event(camera, event, pos, normal, shape):
if (event.type==InputEvent.MOUSE_BUTTON and event.pressed):
if (not selected):
get_node("mesh").set_material_override(gray_mat)
@@ -17,16 +14,11 @@ func _input_event(camera,event,pos,normal,shape):
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
+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))
diff --git a/demos/3d/mousepick_test/mousepick.scn b/demos/3d/mousepick_test/mousepick.scn
index 7ecac46a86..0b6c33c119 100644
--- a/demos/3d/mousepick_test/mousepick.scn
+++ b/demos/3d/mousepick_test/mousepick.scn
Binary files differ