diff options
author | rom <romangraef@gmail.com> | 2021-04-24 23:17:49 +0200 |
---|---|---|
committer | rom <romangraef@gmail.com> | 2021-04-24 23:18:00 +0200 |
commit | 40718db4c9486eeb2bad250ba06071c3588ddfa3 (patch) | |
tree | 9bef14e42952d25bfe88f99a621f9f21f785b630 /components | |
parent | a4ebe6e0ebc07012fb2fcaf1bbbf271046265fc4 (diff) | |
download | ldjam48-40718db4c9486eeb2bad250ba06071c3588ddfa3.tar.gz ldjam48-40718db4c9486eeb2bad250ba06071c3588ddfa3.tar.bz2 ldjam48-40718db4c9486eeb2bad250ba06071c3588ddfa3.zip |
pathrenderer
Diffstat (limited to 'components')
-rw-r--r-- | components/PathRenderer.gd | 13 | ||||
-rw-r--r-- | components/button.tscn | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/components/PathRenderer.gd b/components/PathRenderer.gd new file mode 100644 index 0000000..75c7163 --- /dev/null +++ b/components/PathRenderer.gd @@ -0,0 +1,13 @@ +extends Node2D + +onready var path : Path2D = $Path2D +onready var points = path.curve.get_baked_points() + +func _draw(): + var last_point = 0 + for point in points: + if last_point is int: + last_point = point + continue + draw_line(last_point, point, Color.brown, 6, false) + last_point = point diff --git a/components/button.tscn b/components/button.tscn index 6248b45..f7d0cea 100644 --- a/components/button.tscn +++ b/components/button.tscn @@ -48,6 +48,7 @@ __meta__ = { [node name="Hitbox" type="CollisionShape2D" parent="."] shape = SubResource( 3 ) + [connection signal="input_event" from="." to="." method="_on_ButtonTest_input_event"] [connection signal="mouse_entered" from="." to="." method="_on_ButtonTest_mouse_entered"] [connection signal="mouse_exited" from="." to="." method="_on_ButtonTest_mouse_exited"] |