38 lines
1.2 KiB
Text
38 lines
1.2 KiB
Text
[gd_scene load_steps=6 format=2]
|
|
|
|
[ext_resource path="res://mini-game/ressources/backgrounds/road3.png" type="Texture" id=1]
|
|
[ext_resource path="res://mini-game/scenes/decor/ForegroundSprite.gd" type="Script" id=2]
|
|
[ext_resource path="res://mini-game/ressources/backgrounds/road.png" type="Texture" id=3]
|
|
|
|
[sub_resource type="Shader" id=1]
|
|
code = "shader_type canvas_item;
|
|
|
|
uniform float scroll_speed;
|
|
|
|
void fragment(){
|
|
vec2 u = UV;
|
|
u.x += scroll_speed*TIME;
|
|
vec4 color = texture(TEXTURE,u);
|
|
COLOR = color;
|
|
}
|
|
"
|
|
|
|
[sub_resource type="ShaderMaterial" id=2]
|
|
shader = SubResource( 1 )
|
|
shader_param/scroll_speed = 0.0
|
|
|
|
[node name="ForegroundSprite" type="Sprite"]
|
|
material = SubResource( 2 )
|
|
texture = ExtResource( 1 )
|
|
offset = Vector2( 960, 540 )
|
|
script = ExtResource( 2 )
|
|
__meta__ = {
|
|
"_editor_description_": ""
|
|
}
|
|
textures = [ ExtResource( 1 ), ExtResource( 3 ) ]
|
|
|
|
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
|
|
position = Vector2( 1930, 540 )
|
|
|
|
[connection signal="viewport_entered" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_viewport_entered"]
|
|
[connection signal="viewport_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_viewport_exited"]
|