aboutsummaryrefslogtreecommitdiff
path: root/demos/2d/area_input
diff options
context:
space:
mode:
authorRémi Verschelde2015-11-21 16:13:43 +0100
committerRémi Verschelde2015-12-09 08:39:12 +0100
commit7589b2bf605b58fbb0e34dec8ae833708e9b54ea (patch)
tree6c6b6515be9d121127f738a586fd95299ca7018a /demos/2d/area_input
parent323dde7f3164477b3d51fda8352d8b37a19f7f9d (diff)
downloadgodot-7589b2bf605b58fbb0e34dec8ae833708e9b54ea.tar.gz
godot-7589b2bf605b58fbb0e34dec8ae833708e9b54ea.tar.zst
godot-7589b2bf605b58fbb0e34dec8ae833708e9b54ea.zip
Improve code formatting
The scripts were streamlined using more or less the following conventions: - space after a comma in lists of arguments - spaces around weak operators (+, -), no spaces around strong operators (*, /) - spaces around comparison operators and compound assignment operators - space after a comment start (#) - removed trailing spaces or tabs, apart from those that delimit the function indentation level (those could be removed too but since they are added automatically by the editor when typing code, keeping them for now) - function blocks separate by two newlines - comment sentences start with an upper-case letter
Diffstat (limited to 'demos/2d/area_input')
-rw-r--r--demos/2d/area_input/input.gd17
1 files changed, 8 insertions, 9 deletions
diff --git a/demos/2d/area_input/input.gd b/demos/2d/area_input/input.gd
index 3f719fc85..e9cc9f3c1 100644
--- a/demos/2d/area_input/input.gd
+++ b/demos/2d/area_input/input.gd
@@ -1,16 +1,15 @@
extends Area2D
-#virtual from CollisionObject2D (also available as signal)
+
+# 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 )
+ # 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("")
-
+# Virtual from CollisionObject2D (also available as signal)
+func _mouse_exit():
+ get_node("label").set_text("")