fix ui layout add progressBar

This commit is contained in:
2024-09-17 19:37:33 +03:00
parent 4424e8255e
commit 20e145c091
6 changed files with 55 additions and 9 deletions
-6
View File
@@ -1,6 +0,0 @@
.panel {
-unity-background-image-tint-color: rgba(2, 2, 2, 0.64);
background-color: rgba(0, 0, 0, 0.75);
align-items: auto;
height: 100px;
}
+36
View File
@@ -0,0 +1,36 @@
.container
{
display: flex;
flex-direction: row;
height:50px;
}
.player-image{
flex-grow: 1;
height:50px;
max-width:40px;
background-image: url("project://database/Assets/Characters/pics/Sophie.png?fileID=2800000&guid=4999eb6bfdcacae48a7ed2020bd489d0&type=3#Sophie");
}
.panel {
flex-grow: 2;
-unity-background-image-tint-color: rgba(2, 2, 2, 0.64);
background-color: rgba(0, 0, 0, 0.75);
align-items: auto;
height: 40px;
}
.progress-bar-container {
width: 100px;
height: 7px;
background-color: rgba(255, 255, 255, 0.3);
border-radius: 10px;
overflow: hidden;
}
.progress-bar-fill {
width: 50%;
height: 100%;
background-color: #00FF00;
border-radius: 10px 0 0 10px; /* Rounded corners on the left side */
}
+8 -3
View File
@@ -1,6 +1,11 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False"> <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
<Style src="project://database/Assets/UI/inGameGud.uss?fileID=7433441132597879392&amp;guid=b1b33e86ffa27d840968609d368bc1ac&amp;type=3#inGameGud" /> <Style src="project://database/Assets/UI/inGameHud.uss?fileID=7433441132597879392&amp;guid=b1b33e86ffa27d840968609d368bc1ac&amp;type=3#inGameHud" />
<ui:VisualElement class="panel" style="flex-grow: 1; height: 50px; margin-bottom: 0; align-self: auto; justify-content: space-between; align-items: auto; max-height: 50px;"> <ui:VisualElement class="container">
<ui:VisualElement name="CharacterImage" style="flex-grow: 1; align-items: auto; align-self: flex-start; background-image: url(&quot;project://database/Assets/Characters/pics/Sophie.png?fileID=2800000&amp;guid=4999eb6bfdcacae48a7ed2020bd489d0&amp;type=3#Sophie&quot;); background-color: rgba(255, 255, 255, 0); justify-content: flex-end; max-width: none; width: 43px;" /> <ui:VisualElement name="CharacterImage" class="player-image" style="background-image: url(&quot;project://database/Assets/Characters/pics/Sophie.png?fileID=2800000&amp;guid=4999eb6bfdcacae48a7ed2020bd489d0&amp;type=3#Sophie&quot;);" />
<ui:VisualElement name="Panel" class="panel">
<ui:VisualElement name="VisualElement" class="progress-bar-container">
<ui:VisualElement class="progress-bar-fill" name="progressFill" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement> </ui:VisualElement>
</ui:UXML> </ui:UXML>
View File
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 755fc3f2b04b5014794dec9f2787b86e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0