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.

ScrollingBG.tscn 585B

12345678910111213141516171819202122232425262728
  1. [gd_scene load_steps=4 format=2]
  2. [ext_resource path="res://mini-game/scripts/ScrollingBG.gd" type="Script" id=1]
  3. [sub_resource type="Shader" id=1]
  4. code = "shader_type canvas_item;
  5. uniform float scroll_speed;
  6. void fragment(){
  7. vec2 u = UV;
  8. u.x += scroll_speed*TIME;
  9. vec4 color = texture(TEXTURE,u);
  10. COLOR = color;
  11. }
  12. "
  13. [sub_resource type="ShaderMaterial" id=2]
  14. shader = SubResource( 1 )
  15. shader_param/scroll_speed = 0.2
  16. [node name="ScrollingBG" type="TextureRect"]
  17. material = SubResource( 2 )
  18. stretch_mode = 2
  19. script = ExtResource( 1 )
  20. __meta__ = {
  21. "_edit_use_anchors_": false
  22. }