mirror of
https://github.com/Relintai/GraphicsEditor.git
synced 2024-11-12 08:15:17 +01:00
Added color rectangle for layer previews
This commit is contained in:
parent
a4228b4d29
commit
b838e2383b
@ -15,7 +15,7 @@ func set_image_storage(image_data):
|
|||||||
texture.create_from_image(image_data)
|
texture.create_from_image(image_data)
|
||||||
texture.set_flags(0)
|
texture.set_flags(0)
|
||||||
texture.setup_local_to_scene()
|
texture.setup_local_to_scene()
|
||||||
get_node("TextureRect").texture = texture
|
get_node("LayerPreview/TextureRect").texture = texture
|
||||||
|
|
||||||
func set_layer_visible(value):
|
func set_layer_visible(value):
|
||||||
layer_visible = value
|
layer_visible = value
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/graphics_editor/Layer.gd" type="Script" id=1]
|
[ext_resource path="res://addons/graphics_editor/Layer.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id=1]
|
[sub_resource type="StyleBoxFlat" id=1]
|
||||||
bg_color = Color( 1, 1, 1, 1 )
|
bg_color = Color( 1, 1, 1, 1 )
|
||||||
@ -50,12 +49,18 @@ focus_mode = 0
|
|||||||
enabled_focus_mode = 0
|
enabled_focus_mode = 0
|
||||||
text = "X"
|
text = "X"
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="."]
|
[node name="LayerPreview" type="ColorRect" parent="."]
|
||||||
margin_left = 10.0
|
margin_left = 10.0
|
||||||
margin_top = 20.0
|
margin_top = 20.0
|
||||||
margin_right = 74.0
|
margin_right = 74.0
|
||||||
margin_bottom = 84.0
|
margin_bottom = 84.0
|
||||||
texture = ExtResource( 2 )
|
mouse_filter = 2
|
||||||
|
color = Color( 0.329412, 0.329412, 0.329412, 1 )
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="LayerPreview"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 1
|
stretch_mode = 1
|
||||||
[connection signal="pressed" from="LayerButton" to="." method="_on_LayerButton_pressed"]
|
[connection signal="pressed" from="LayerButton" to="." method="_on_LayerButton_pressed"]
|
||||||
|
Loading…
Reference in New Issue
Block a user