Skip to content

Commit

Permalink
adapt to fullscrean resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Patataman committed Oct 12, 2021
1 parent bf218d5 commit 8506162
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 67 deletions.
8 changes: 6 additions & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _global_script_classes=[ {
"base": "Object",
"class": "Inventory",
"language": "GDScript",
"path": "res://real_deal/scripts/utils/player/inventory.gd"
"path": "res://real_deal/scripts/utils/player/Inventory.gd"
} ]
_global_script_class_icons={
"Actor": "",
Expand Down Expand Up @@ -61,7 +61,6 @@ window/size/width=1920
window/size/height=1080
window/size/test_width=1280
window/size/test_height=720
window/stretch/mode="2d"
window/stretch/aspect="keep"

[editor_plugins]
Expand Down Expand Up @@ -104,6 +103,11 @@ attack={
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
]
}
inventory={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":73,"unicode":0,"echo":false,"script":null)
]
}

[layer_names]

Expand Down
30 changes: 15 additions & 15 deletions real_deal/scenes/map/actors/Player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ region = Rect2( 190, 0, 190, 211 )
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 190, 0, 190, 211 )
region = Rect2( 0, 0, 190, 211 )

[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 380, 0, 190, 211 )
region = Rect2( 190, 0, 190, 211 )

[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 190, 211 )
region = Rect2( 380, 0, 190, 211 )

[sub_resource type="AtlasTexture" id=6]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 190, 0, 190, 211 )
region = Rect2( 570, 0, 190, 211 )

[sub_resource type="AtlasTexture" id=7]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 380, 0, 190, 211 )
region = Rect2( 190, 0, 190, 211 )

[sub_resource type="AtlasTexture" id=8]
flags = 4
Expand All @@ -45,7 +45,7 @@ region = Rect2( 570, 0, 190, 211 )
[sub_resource type="AtlasTexture" id=9]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 570, 0, 190, 211 )
region = Rect2( 380, 0, 190, 211 )

[sub_resource type="SpriteFrames" id=10]
animations = [ {
Expand All @@ -54,24 +54,24 @@ animations = [ {
"name": "idle",
"speed": 1.0
}, {
"frames": [ SubResource( 3 ) ],
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ],
"loop": false,
"name": "attack",
"speed": 8.0
}, {
"frames": [ SubResource( 7 ) ],
"loop": true,
"name": "walk-down",
"speed": 1.0
}, {
"frames": [ SubResource( 4 ) ],
"frames": [ SubResource( 8 ) ],
"loop": true,
"name": "walk-side",
"name": "walk-up",
"speed": 1.0
}, {
"frames": [ SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
"loop": false,
"name": "attack",
"speed": 8.0
}, {
"frames": [ SubResource( 9 ) ],
"loop": true,
"name": "walk-up",
"name": "walk-side",
"speed": 1.0
} ]

Expand Down
88 changes: 48 additions & 40 deletions real_deal/scenes/menu/Inventory.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
[ext_resource path="res://real_deal/scripts/menu/Inventory.gd" type="Script" id=3]

[node name="Inventory" type="CanvasLayer"]
follow_viewport_enable = true
script = ExtResource( 3 )

[node name="Container" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -244.0
margin_top = -205.5
margin_right = 244.0
margin_bottom = 205.5
custom_constants/margin_right = 75
custom_constants/margin_top = 75
custom_constants/margin_left = 75
Expand All @@ -20,15 +27,17 @@ __meta__ = {
[node name="TabContainer" type="TabContainer" parent="Container"]
margin_left = 75.0
margin_top = 75.0
margin_right = 949.0
margin_bottom = 525.0
margin_right = 413.0
margin_bottom = 336.0
size_flags_vertical = 5
tab_align = 0

[node name="PanelPJ" type="PanelContainer" parent="Container/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_left = -21.9999
margin_top = -12.0
margin_right = -4.0
margin_bottom = -4.0
grow_horizontal = 0
Expand All @@ -37,20 +46,20 @@ grow_vertical = 0
[node name="HBox" type="HBoxContainer" parent="Container/TabContainer/PanelPJ"]
margin_left = 7.0
margin_top = 7.0
margin_right = 859.0
margin_bottom = 407.0
margin_right = 349.0
margin_bottom = 262.0
size_flags_stretch_ratio = 0.0
custom_constants/separation = 15

[node name="Equipo" type="MarginContainer" parent="Container/TabContainer/PanelPJ/HBox"]
margin_right = 188.0
margin_bottom = 400.0
margin_bottom = 254.0

[node name="Background" type="TextureRect" parent="Container/TabContainer/PanelPJ/HBox/Equipo"]
show_behind_parent = true
margin_top = 94.0
margin_top = 21.0
margin_right = 188.0
margin_bottom = 305.0
margin_bottom = 232.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 4
Expand All @@ -60,12 +69,12 @@ stretch_mode = 4

[node name="MarginContainer" type="MarginContainer" parent="Container/TabContainer/PanelPJ/HBox/Equipo"]
margin_right = 188.0
margin_bottom = 400.0
margin_bottom = 254.0

[node name="ItemsContainer" type="HBoxContainer" parent="Container/TabContainer/PanelPJ/HBox/Equipo/MarginContainer"]
margin_top = 200.0
margin_top = 127.0
margin_right = 188.0
margin_bottom = 200.0
margin_bottom = 127.0
size_flags_horizontal = 3
size_flags_vertical = 6
alignment = 1
Expand All @@ -83,26 +92,26 @@ __meta__ = {
[node name="VSeparator" type="VSeparator" parent="Container/TabContainer/PanelPJ/HBox"]
margin_left = 203.0
margin_right = 207.0
margin_bottom = 400.0
margin_bottom = 254.0

[node name="Stats" type="MarginContainer" parent="Container/TabContainer/PanelPJ/HBox"]
margin_left = 222.0
margin_right = 316.0
margin_bottom = 400.0
margin_bottom = 254.0
grow_horizontal = 2

[node name="VBox" type="VBoxContainer" parent="Container/TabContainer/PanelPJ/HBox/Stats"]
margin_right = 94.0
margin_bottom = 400.0
margin_bottom = 254.0
grow_horizontal = 0
size_flags_horizontal = 5
size_flags_vertical = 5
alignment = 1

[node name="ItemsCenter" type="MarginContainer" parent="Container/TabContainer/PanelPJ/HBox/Stats/VBox"]
margin_top = 191.0
margin_top = 118.0
margin_right = 94.0
margin_bottom = 191.0
margin_bottom = 118.0

[node name="Grid" type="GridContainer" parent="Container/TabContainer/PanelPJ/HBox/Stats/VBox/ItemsCenter"]
margin_right = 94.0
Expand All @@ -111,9 +120,9 @@ custom_constants/hseparation = 20
columns = 6

[node name="Stats" type="CenterContainer" parent="Container/TabContainer/PanelPJ/HBox/Stats/VBox"]
margin_top = 195.0
margin_top = 122.0
margin_right = 94.0
margin_bottom = 209.0
margin_bottom = 136.0

[node name="Text" type="Label" parent="Container/TabContainer/PanelPJ/HBox/Stats/VBox/Stats"]
margin_right = 94.0
Expand All @@ -126,7 +135,7 @@ visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_top = 24.0
margin_right = -4.0
margin_bottom = -4.0
grow_horizontal = 0
Expand All @@ -135,12 +144,12 @@ grow_vertical = 0
[node name="VBox" type="VBoxContainer" parent="Container/TabContainer/Mazo"]
margin_left = 7.0
margin_top = 7.0
margin_right = 859.0
margin_bottom = 437.0
margin_right = 819.0
margin_bottom = 445.0
custom_constants/separation = 10

[node name="HBoxCartas" type="HBoxContainer" parent="Container/TabContainer/Mazo/VBox"]
margin_right = 852.0
margin_right = 812.0
margin_bottom = 400.0
rect_min_size = Vector2( 800, 400 )
size_flags_stretch_ratio = 0.0
Expand Down Expand Up @@ -183,14 +192,14 @@ margin_bottom = 400.0

[node name="Cartas" type="MarginContainer" parent="Container/TabContainer/Mazo/VBox/HBoxCartas"]
margin_left = 553.0
margin_right = 852.0
margin_right = 812.0
margin_bottom = 400.0
grow_horizontal = 0
rect_min_size = Vector2( 259, 0 )
size_flags_horizontal = 3

[node name="ScrollContainer" type="ScrollContainer" parent="Container/TabContainer/Mazo/VBox/HBoxCartas/Cartas"]
margin_right = 299.0
margin_right = 259.0
margin_bottom = 400.0
grow_horizontal = 0

Expand All @@ -199,29 +208,28 @@ mouse_filter = 2

[node name="HBoxBotones" type="HBoxContainer" parent="Container/TabContainer/Mazo/VBox"]
margin_top = 410.0
margin_right = 852.0
margin_right = 812.0
margin_bottom = 430.0
custom_constants/separation = 50
alignment = 1

[node name="Guardar" type="Button" parent="Container/TabContainer/Mazo/VBox/HBoxBotones"]
margin_left = 395.0
margin_right = 456.0
margin_left = 375.0
margin_right = 436.0
margin_bottom = 20.0
text = "Aceptar"

[node name="Cerrar" type="Button" parent="."]
anchor_left = 0.927
anchor_top = 0.165
anchor_right = 0.927
anchor_bottom = 0.165
margin_left = -14.0948
margin_top = -16.1428
margin_right = 14.9052
margin_bottom = 7.85723
[node name="Cerrar" type="Button" parent="Container/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 542.5
margin_top = 234.5
margin_right = 534.5
margin_bottom = 198.5
text = "X"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="Container/TabContainer/Mazo/VBox/HBoxBotones/Guardar" to="." method="_on_Aceptar_pressed"]
[connection signal="pressed" from="Cerrar" to="." method="_on_Cerrar_pressed"]
[connection signal="pressed" from="Container/TabContainer/Cerrar" to="." method="_on_Cerrar_pressed"]
17 changes: 12 additions & 5 deletions real_deal/scenes/menu/MainMenu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ script = ExtResource( 1 )
tile_set = ExtResource( 2 )
cell_size = Vector2( 400, 400 )
format = 1
tile_data = PoolIntArray( 0, 15, 0, 1, 15, 0, 2, 15, 0, 65536, 15, 0, 65537, 15, 0, 65538, 15, 0 )
tile_data = PoolIntArray( 0, 15, 0, 1, 15, 0, 2, 15, 0, 3, 15, 0, 4, 15, 0, 65536, 15, 0, 65537, 15, 0, 65538, 15, 0, 65539, 15, 0, 65540, 15, 0, 131072, 15, 0, 131073, 15, 0, 131074, 15, 0, 131075, 15, 0, 131076, 15, 0 )

[node name="FondoNegro" type="ColorRect" parent="."]
margin_left = 417.0
margin_top = 226.0
margin_right = 607.0
margin_bottom = 370.0
show_behind_parent = true
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -326.0
margin_top = -180.5
margin_right = 326.0
margin_bottom = 180.5
size_flags_horizontal = 3
size_flags_vertical = 3
color = Color( 0, 0, 0, 0.494118 )
__meta__ = {
"_edit_use_anchors_": false
Expand Down
11 changes: 7 additions & 4 deletions real_deal/scripts/duel/CardEffects.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
extends Node
""" Fichero que contiene funciones que representan las acciones
que se puede realizar con objetos/cartas
"""

extends Node

# Definir un diccionario como argumento para evitar tener que repetir el for y
# otras cosas en todas las funciones
#func apply(objectives, func_name, **kwargs):
# func_name(objectives, kwargs)
# func apply(objectives, func_name, **kwargs):
# func_name(objectives, kwargs)

func card_func(func_name, kwargs={}):
""" Ejecuta la función especificada
Expand All @@ -17,7 +20,7 @@ func card_func(func_name, kwargs={}):
for objective in objectives:
var function = funcref(self, func_name)
function.call_func(objective, kwargs)


func base_damage(objective, kwargs):
objective.modify_health(kwargs["amount"])
Expand Down
5 changes: 4 additions & 1 deletion real_deal/scripts/menu/Inventory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ func _ready():
self.init_tab_personalizacion()
#### TAB MAZO ####
self.init_tab_mazo()

# Recentramos el inventario ya que su tamaño ha cambiado con respecto al nodo original
$Container.set_anchors_and_margins_preset(Control.PRESET_CENTER)


func draw_equipped_items():
Expand Down Expand Up @@ -129,7 +132,7 @@ func init_tab_mazo(coleccion=[], cartas=[]):
var coleccion_node = $Container/TabContainer/Mazo/VBox/HBoxCartas/Coleccion
var cartas_node = $Container/TabContainer/Mazo/VBox/HBoxCartas/Cartas
# Contenedores principales
$Container/TabContainer/Mazo/VBox/HBoxCartas.rect_min_size.y = mazo_node.get_size().y*0.9
# $Container/TabContainer/Mazo/VBox/HBoxCartas.rect_min_size.y = mazo_node.get_size().y*0.9
# Contenedor coleción cartas
coleccion_node.rect_min_size = Vector2(mazo_node.get_size().x*0.6, coleccion_node.get_size().y)
coleccion_node.get_node("ScrollContainer").rect_min_size.x = coleccion_node.get_size().x
Expand Down

0 comments on commit 8506162

Please sign in to comment.