Доработка. Цвет отдельно для каждого экземпляра отметки
This commit is contained in:
@@ -10,11 +10,15 @@ func set_track_visible(value: bool): $track.visible = value
|
||||
func set_ecm_visible(value: bool): $ecm_done.visible = value
|
||||
|
||||
|
||||
func update(): $bip.material.set('shader_parameter/tick_update', float(Time.get_ticks_msec()/1000))
|
||||
func update(tick_ms: int = 0): pass
|
||||
|
||||
|
||||
## Задаёт цвет для всех экземпляров
|
||||
func set_color(color: Color): $bip.material.set('shader_parameter/color', Vector3(color.r, color.g, color.b))
|
||||
## Задаёт цвет
|
||||
func set_color(color: Color): $bip.self_modulate = color
|
||||
|
||||
|
||||
## Возвращает цвет
|
||||
func get_color(): return $bip.self_modulate
|
||||
|
||||
|
||||
## Функция присваивает заданое значение видимости селектору.
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://nl1vklubr5kr"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://nl1vklubr5kr"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/bip/bip.gd" id="1_h7l70"]
|
||||
[ext_resource type="Shader" path="res://shaders/bip.gdshader" id="2_rt0la"]
|
||||
[ext_resource type="Texture2D" uid="uid://cp4bv6lh8w83k" path="res://data/bip.png" id="2_yjvg0"]
|
||||
[ext_resource type="Shader" path="res://shaders/tracked.gdshader" id="3_2a1qb"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2dulj"]
|
||||
shader = ExtResource("2_rt0la")
|
||||
shader_parameter/tick_update = 0.0
|
||||
shader_parameter/color = Color(0.972549, 0.12549, 0.411765, 1)
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_w5pye"]
|
||||
|
||||
[sub_resource type="Shader" id="Shader_60ho7"]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
@@ -223,38 +216,36 @@ shader_parameter/speed = 71.0
|
||||
[node name="threat" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
script = ExtResource("1_h7l70")
|
||||
|
||||
[node name="bip" type="TextureButton" parent="."]
|
||||
material = SubResource("ShaderMaterial_2dulj")
|
||||
layout_direction = 1
|
||||
layout_mode = 0
|
||||
offset_right = 1.0
|
||||
offset_bottom = 1.0
|
||||
scale = Vector2(20, 20)
|
||||
offset_left = 10.0
|
||||
offset_top = 10.0
|
||||
offset_right = 10.0
|
||||
offset_bottom = 10.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
action_mode = 0
|
||||
button_mask = 3
|
||||
texture_normal = SubResource("PlaceholderTexture2D_w5pye")
|
||||
texture_normal = ExtResource("2_yjvg0")
|
||||
ignore_texture_size = true
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="selector" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
material = SubResource("ShaderMaterial_fkqwb")
|
||||
scale = Vector2(20, 20)
|
||||
texture = SubResource("PlaceholderTexture2D_hqs6j")
|
||||
centered = false
|
||||
|
||||
[node name="recomendation" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
material = SubResource("ShaderMaterial_lpmq6")
|
||||
scale = Vector2(20, 20)
|
||||
texture = SubResource("PlaceholderTexture2D_hqs6j")
|
||||
centered = false
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="ecm_done" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
material = SubResource("ShaderMaterial_h3oo7")
|
||||
position = Vector2(-5, -5)
|
||||
scale = Vector2(30, 30)
|
||||
@@ -262,7 +253,6 @@ texture = SubResource("PlaceholderTexture2D_hqs6j")
|
||||
centered = false
|
||||
|
||||
[node name="track" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
material = SubResource("ShaderMaterial_lkrha")
|
||||
position = Vector2(10, 10)
|
||||
scale = Vector2(26, 26)
|
||||
|
||||
34
scenes/bip/подкладка.png.import
Normal file
34
scenes/bip/подкладка.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bcro5nt0as20n"
|
||||
path="res://.godot/imported/подкладка.png-34c60261f5f8370acd285881dd35a7b0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scenes/bip/подкладка.png"
|
||||
dest_files=["res://.godot/imported/подкладка.png-34c60261f5f8370acd285881dd35a7b0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Reference in New Issue
Block a user