No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ForegroundSprite.tscn 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. [gd_scene load_steps=5 format=2]
  2. [ext_resource path="res://mini-game/ressources/backgrounds/road3.png" type="Texture" id=1]
  3. [ext_resource path="res://mini-game/scenes/decor/ForegroundSprite.gd" type="Script" id=2]
  4. [sub_resource type="Shader" id=1]
  5. code = "shader_type canvas_item;
  6. uniform float scroll_speed;
  7. void fragment(){
  8. vec2 u = UV;
  9. u.x += scroll_speed*TIME;
  10. vec4 color = texture(TEXTURE,u);
  11. COLOR = color;
  12. }
  13. "
  14. [sub_resource type="ShaderMaterial" id=2]
  15. shader = SubResource( 1 )
  16. shader_param/scroll_speed = 0.0
  17. [node name="ForegroundSprite" type="Sprite"]
  18. material = SubResource( 2 )
  19. texture = ExtResource( 1 )
  20. offset = Vector2( 960, 540 )
  21. script = ExtResource( 2 )
  22. __meta__ = {
  23. "_editor_description_": ""
  24. }
  25. [node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
  26. position = Vector2( 1930, 540 )
  27. [connection signal="viewport_entered" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_viewport_entered"]
  28. [connection signal="viewport_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_viewport_exited"]