Responsive UI for MainMenu & LoadingScreen
Convert MainMenu and LoadingScreen UXML/USS to responsive layouts (percent-based sizing, media queries for wide/tall screens), adjust spacing, fonts and colors, and refine spaceship icon and button styles. Update MainMenu and LoadingScreen controllers to force the root TemplateContainer to occupy the full screen. Add Assets/Resources.meta. Update metadata and LFS object IDs for several Unity assets (ReflectionProbe-0.exr.meta importer fields and AssetOrigin, Komikax font LFS oid, Loading.unity, DefaultVolumeProfile.asset, and project settings hashes) to reflect import/serialization changes.
This commit is contained in:
@@ -1,47 +1,68 @@
|
||||
/* Contenedor Principal responsivo */
|
||||
/* === Base (16:9, ej. 1920x1080) === */
|
||||
.loading-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex-grow: 1;
|
||||
background-color: #000000;
|
||||
background-color: rgb(0, 0, 0);
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
position: relative;
|
||||
padding-right: 5%;
|
||||
padding-bottom: 5%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.spaceship-icon {
|
||||
width: 10%;
|
||||
min-width: 100px;
|
||||
max-width: 200px;
|
||||
aspect-ratio: 1;
|
||||
margin-right: 3%;
|
||||
margin-bottom: 0;
|
||||
-unity-background-scale-mode: scale-to-fit;
|
||||
}
|
||||
|
||||
/* Texto de Carga */
|
||||
.loading-text {
|
||||
font-size: 50px;
|
||||
color: #ffffff;
|
||||
color: rgb(255, 255, 255);
|
||||
-unity-font-style: bold;
|
||||
margin-right: 40px;
|
||||
margin-bottom: 40px;
|
||||
|
||||
/* 1. Hacemos la caja más ancha para que quepa "CARGANDO..." con la fuente Komika */
|
||||
width: 350px;
|
||||
|
||||
/* 2. Anclamos el texto a la izquierda de la caja */
|
||||
-unity-text-align: middle-left;
|
||||
|
||||
/* 3. Evitamos estrictamente que el texto salte a la siguiente línea */
|
||||
white-space: nowrap;
|
||||
-unity-text-align: middle-left;
|
||||
white-space: nowrap;
|
||||
width: 280px;
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Contenedor de la Nave */
|
||||
.spaceship-icon {
|
||||
/* 1. Quitamos position: absolute para que respete el flujo y baje a la esquina */
|
||||
position: relative;
|
||||
|
||||
/* 2. Tamaño ajustado */
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
|
||||
/* 3. Márgenes para alinearla con el texto (mismo margin-left que el texto) */
|
||||
margin-left: 40px;
|
||||
|
||||
/* 4. Un pequeño margen abajo para que no pegue con las letras */
|
||||
margin-bottom: -20px;
|
||||
|
||||
/* Ajuste de imagen */
|
||||
-unity-background-scale-mode: scale-to-fit;
|
||||
}
|
||||
/* === Responsive: 19:9 (ultra ancho, ej. 2280x1080, 3040x1440) === */
|
||||
@media (min-width: 2200px) {
|
||||
.loading-container {
|
||||
padding-right: 4.5%;
|
||||
padding-bottom: 5%;
|
||||
}
|
||||
|
||||
.spaceship-icon {
|
||||
width: 9%;
|
||||
max-width: 260px;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 65px;
|
||||
width: 360px;
|
||||
}
|
||||
}
|
||||
|
||||
/* === Responsive: 16:10 (ej. 1920x1200, 2560x1600) === */
|
||||
@media (min-height: 1150px) and (max-width: 2199px) {
|
||||
.loading-container {
|
||||
padding-right: 5%;
|
||||
padding-bottom: 5.5%;
|
||||
}
|
||||
|
||||
.spaceship-icon {
|
||||
width: 10%;
|
||||
max-width: 215px;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 52px;
|
||||
width: 290px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||
<Style src="project://database/Assets/Game/Menus/LoadingScreen/LoadingScreen.uss?fileID=7433441132597879392&guid=2338a47a6d4bdf04fb16da5ab852dee3&type=3#LoadingScreen"/>
|
||||
<ui:VisualElement name="Container" class="loading-container" style="aspect-ratio: 1.777778;">
|
||||
<ui:VisualElement name="Container" class="loading-container">
|
||||
<ui:VisualElement name="Spaceship" class="spaceship-icon"/>
|
||||
<ui:Label text="Cargando" name="LoadingText" class="loading-text" style="-unity-font-definition: url("project://database/Assets/Game/Menus/Fonts/KOMIKAX_.ttf?fileID=12800000&guid=afbd8b3e208400c4ebf47631612ef61f&type=3#KOMIKAX_");"/>
|
||||
</ui:VisualElement>
|
||||
|
||||
@@ -20,6 +20,11 @@ public class LoadingScreenController : MonoBehaviour
|
||||
_doc = GetComponent<UIDocument>();
|
||||
var root = _doc.rootVisualElement;
|
||||
|
||||
// Forzar que el TemplateContainer raíz ocupe toda la pantalla
|
||||
root.style.flexGrow = 1;
|
||||
root.style.width = new Length(100, LengthUnit.Percent);
|
||||
root.style.height = new Length(100, LengthUnit.Percent);
|
||||
|
||||
_loadingText = root.Q<Label>("LoadingText");
|
||||
_spaceship = root.Q<VisualElement>("Spaceship");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user