Compare commits

...

2 commits

Author SHA1 Message Date
Fabien Freling e135c75787 use rsvg to convert assets 2021-11-21 23:29:31 +01:00
Fabien Freling 4c7038dd4a fix hanafuda card lifetime 2021-11-21 23:29:05 +01:00
4 changed files with 14 additions and 10 deletions

View file

@ -33,9 +33,10 @@ enum Flower {
export var revealed: bool = true setget reveal export var revealed: bool = true setget reveal
onready var _is_ready := true
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
$Backside/TextureRect.rect_global_position = $"Backside/Border sprite".get_rect()
reveal(revealed) reveal(revealed)
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
@ -44,6 +45,10 @@ func _process(delta):
func reveal(new_reveal: bool): func reveal(new_reveal: bool):
revealed = new_reveal revealed = new_reveal
if not _is_ready:
yield(self, "ready")
if revealed: if revealed:
print("Reveal card") print("Reveal card")
$Frontside.show() $Frontside.show()

View file

@ -10,17 +10,16 @@ script = ExtResource( 1 )
revealed = false revealed = false
[node name="Frontside" type="Sprite" parent="."] [node name="Frontside" type="Sprite" parent="."]
visible = false
scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 2 ) texture = ExtResource( 2 )
[node name="Backside" type="Node2D" parent="."] [node name="Backside" type="Node2D" parent="."]
visible = false
[node name="TextureRect" type="TextureRect" parent="Backside"] [node name="TextureRect" type="TextureRect" parent="Backside"]
margin_left = -91.0 margin_left = -110.0
margin_top = -155.0 margin_top = -193.0
margin_right = 809.0 margin_right = 1000.0
margin_bottom = 1380.0 margin_bottom = 1722.0
rect_scale = Vector2( 0.2, 0.2 ) rect_scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 4 ) texture = ExtResource( 4 )
stretch_mode = 2 stretch_mode = 2
@ -29,5 +28,4 @@ __meta__ = {
} }
[node name="Border sprite" type="Sprite" parent="Backside"] [node name="Border sprite" type="Sprite" parent="Backside"]
scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 3 ) texture = ExtResource( 3 )

View file

@ -2,7 +2,7 @@
[ext_resource path="res://HanafudaCard.tscn" type="PackedScene" id=1] [ext_resource path="res://HanafudaCard.tscn" type="PackedScene" id=1]
[node name="Node2D" type="Node"] [node name="Node" type="Node"]
[node name="Background" type="ColorRect" parent="."] [node name="Background" type="ColorRect" parent="."]
anchor_right = 1.0 anchor_right = 1.0
@ -14,3 +14,4 @@ __meta__ = {
[node name="HanafudaCard" parent="." instance=ExtResource( 1 )] [node name="HanafudaCard" parent="." instance=ExtResource( 1 )]
position = Vector2( 205, 447 ) position = Vector2( 205, 447 )
revealed = true

View file

@ -1 +1 @@
: foreach svg/*.svg |> convert -background none %f %o |> png/%B.png : foreach svg/*.svg |> rsvg-convert --background-color transparent --format Png --height 400 --output %o %f |> png/%B.png