From 5b1e71306b15e2fd53cea9fe23ccd31ba8892497 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 29 Sep 2024 14:42:07 +0300 Subject: [PATCH] continue to work on UI --- Assets/UI/inGameHud.uss | 64 ++++++++++++++++++++++----------- Assets/UI/inGameHud.uxml | 31 +++++++++++++--- Assets/UI/progressBar.cs | 24 +++++++++++++ Assets/UI/progressBar.cs.meta | 2 ++ Assets/UI/progressBar.uss | 15 ++++++++ Assets/UI/progressBar.uxml | 7 ++++ Assets/UI/progressBar.uxml.meta | 10 ++++++ 7 files changed, 128 insertions(+), 25 deletions(-) create mode 100644 Assets/UI/progressBar.cs create mode 100644 Assets/UI/progressBar.cs.meta create mode 100644 Assets/UI/progressBar.uxml create mode 100644 Assets/UI/progressBar.uxml.meta diff --git a/Assets/UI/inGameHud.uss b/Assets/UI/inGameHud.uss index 07ee0edc..e81f97dc 100644 --- a/Assets/UI/inGameHud.uss +++ b/Assets/UI/inGameHud.uss @@ -1,36 +1,58 @@ -.container -{ +.container { display: flex; flex-direction: row; - height:50px; + height: 50px; } -.player-image{ +.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"); + height: 50px; + max-width: 40px; + background-image: url('"project://database/Assets/Characters/pics/Sophie.png?fileID=2800000&guid=4999eb6bfdcacae48a7ed2020bd489d0&type=3#Sophie"'); } .panel { + display: flex; 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; + height: 25px; + justify-content: left; + flex-direction: row; + align-items: flex-start; } -.progress-bar-container { - width: 100px; - height: 7px; - background-color: rgba(255, 255, 255, 0.3); - border-radius: 10px; - overflow: hidden; +.top-elements-block { +flex: 1 + display: flex; + align-items: flex-start; + justify-content: left; + flex-direction: row; } -.progress-bar-fill { - width: 50%; - height: 100%; - background-color: #00FF00; - border-radius: 10px 0 0 10px; /* Rounded corners on the left side */ +.stat-container { + margin-left: 10px; + display: flex; + align-items: center; + flex-direction: row; + align-self: center; +} + +.progress-icon { + display: inline-block; + width: 25px; + height: 20px; + align-items: center; + align-self: center; + flex-direction: row; +} + +.top-bar-label{ + color: rgb(255, 255, 255); + align-self: center; + -unity-text-align: middle-left; +} + +.justify-center{ + justify-content: center; + align-self: center; } \ No newline at end of file diff --git a/Assets/UI/inGameHud.uxml b/Assets/UI/inGameHud.uxml index a8ce5189..767d2e7f 100644 --- a/Assets/UI/inGameHud.uxml +++ b/Assets/UI/inGameHud.uxml @@ -2,10 +2,33 @@