display card back
This commit is contained in:
parent
2896f7d8bb
commit
ee9b4777cb
|
@ -1,4 +1,5 @@
|
|||
extends Sprite
|
||||
tool
|
||||
extends Node2D
|
||||
|
||||
enum Month {
|
||||
JANUARY,
|
||||
|
@ -30,11 +31,24 @@ enum Flower {
|
|||
PAULOWNIA,
|
||||
}
|
||||
|
||||
export var revealed: bool = true setget reveal
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
$Backside/TextureRect.rect_global_position = $"Backside/Border sprite".get_rect()
|
||||
reveal(revealed)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func reveal(new_reveal: bool):
|
||||
revealed = new_reveal
|
||||
if revealed:
|
||||
print("Reveal card")
|
||||
$Frontside.show()
|
||||
$Backside.hide()
|
||||
else:
|
||||
print("Conceal card")
|
||||
$Frontside.hide()
|
||||
$Backside.show()
|
||||
|
|
|
@ -1,10 +1,33 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://HanafudaCard.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/png/Hanafuda_April_Kasu_1.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/png/Hanafuda_border.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/japanese_pattern_01.png" type="Texture" id=4]
|
||||
|
||||
[node name="HanafudaCard" type="Sprite"]
|
||||
position = Vector2( 292.75, 250.01 )
|
||||
[node name="HanafudaCard" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
revealed = false
|
||||
|
||||
[node name="Frontside" type="Sprite" parent="."]
|
||||
visible = false
|
||||
scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Backside" type="Node2D" parent="."]
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Backside"]
|
||||
margin_left = -91.0
|
||||
margin_top = -155.0
|
||||
margin_right = 809.0
|
||||
margin_bottom = 1380.0
|
||||
rect_scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 4 )
|
||||
stretch_mode = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Border sprite" type="Sprite" parent="Backside"]
|
||||
scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 3 )
|
||||
|
|
11
Main.tscn
11
Main.tscn
|
@ -2,6 +2,15 @@
|
|||
|
||||
[ext_resource path="res://HanafudaCard.tscn" type="PackedScene" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
[node name="Node2D" type="Node"]
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color( 0.0941176, 0.423529, 0.27451, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HanafudaCard" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 205, 447 )
|
||||
|
|
|
@ -4,4 +4,7 @@
|
|||
Hanafuda cards by [Louie Mantia](http://louie.world/).
|
||||
[CC BY-SA 4.0][1]
|
||||
|
||||
## Japanese texture
|
||||
<a href="https://www.freepik.com/vectors/pattern">Pattern vector created by callmetak - www.freepik.com</a>
|
||||
|
||||
[1]: https://creativecommons.org/licenses/by-sa/4.0/deed.en
|
||||
|
|
BIN
assets/japanese_pattern_01.png
Normal file
BIN
assets/japanese_pattern_01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 110 KiB |
35
assets/japanese_pattern_01.png.import
Normal file
35
assets/japanese_pattern_01.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/japanese_pattern_01.png-f5786b9777fdcad19c4be71085ddc93d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/japanese_pattern_01.png"
|
||||
dest_files=[ "res://.import/japanese_pattern_01.png-f5786b9777fdcad19c4be71085ddc93d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
55
assets/svg/Hanafuda_border.svg
Normal file
55
assets/svg/Hanafuda_border.svg
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 976 1600"
|
||||
version="1.1"
|
||||
id="svg26"
|
||||
sodipodi:docname="Hanafuda_border.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview28"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.423125"
|
||||
inkscape:cx="486.85377"
|
||||
inkscape:cy="800"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1003"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg26" />
|
||||
<defs
|
||||
id="defs7">
|
||||
<style
|
||||
id="style2">.cls-1{fill:none;}.cls-2{fill:#f4f3ef;}.cls-3{clip-path:url(#clip-path);}.cls-4{fill:#6060bf;}.cls-5{fill:#50b271;}.cls-6{fill:#592116;}.cls-7{fill:#992d17;}</style>
|
||||
<clipPath
|
||||
id="clip-path">
|
||||
<path
|
||||
class="cls-1"
|
||||
d="M960,22V1578a6,6,0,0,1-6,6H22a6,6,0,0,1-6-6V22a6,6,0,0,1,6-6H954A6,6,0,0,1,960,22Z"
|
||||
id="path4" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g
|
||||
id="Red_Japanese_Frames"
|
||||
data-name="Red Japanese Frames"
|
||||
style="display:inline">
|
||||
<path
|
||||
class="cls-6"
|
||||
d="m 0,20 v 1560 a 20,20 0 0 0 20,20 h 936 a 20,20 0 0 0 20,-20 V 20 A 20,20 0 0 0 956,0 H 20 A 20,20 0 0 0 0,20 Z M 924,1548 H 52 V 52 h 872 z"
|
||||
id="path21" />
|
||||
<path
|
||||
class="cls-7"
|
||||
d="M 952.1,15.41 928.69,38.83 A 4,4 0 0 1 925.86,40 H 50.14 A 4,4 0 0 1 47.31,38.83 L 23.9,15.41 A 2,2 0 0 1 25.31,12 h 925.38 a 2,2 0 0 1 1.41,3.41 z M 40,1549.86 V 50.14 A 4,4 0 0 0 38.83,47.31 L 15.41,23.9 A 2,2 0 0 0 12,25.31 v 1549.38 a 2,2 0 0 0 3.41,1.41 l 23.42,-23.41 A 4,4 0 0 0 40,1549.86 Z M 936,50.14 v 1499.72 a 4,4 0 0 0 1.17,2.83 l 23.42,23.41 a 2,2 0 0 0 3.41,-1.41 V 25.31 A 2,2 0 0 0 960.59,23.9 L 937.17,47.31 A 4,4 0 0 0 936,50.14 Z M 925.86,1560 H 50.14 a 4,4 0 0 0 -2.83,1.17 l -20,20 a 4,4 0 0 0 2.83,6.83 h 920.55 a 2,2 0 0 0 1.41,-3.41 l -23.41,-23.42 a 4,4 0 0 0 -2.83,-1.17 z"
|
||||
id="path23" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -14,6 +14,11 @@ config/name="Hanafuda"
|
|||
run/main_scene="res://Main.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=600
|
||||
window/size/height=900
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
|
Loading…
Reference in a new issue