{"id":2341,"date":"2025-11-16T18:28:34","date_gmt":"2025-11-16T18:28:34","guid":{"rendered":"https:\/\/golemitegames.com\/?post_type=docs&#038;p=2341"},"modified":"2025-11-21T20:40:10","modified_gmt":"2025-11-21T20:40:10","password":"","slug":"stat-bar","status":"publish","type":"docs","link":"https:\/\/golemitegames.com\/index.php\/docs\/stat-bar\/","title":{"rendered":"Stat Bar"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Introduction<\/h2>\n\n\n\n<p>StatBar is a visual utility class used on a few components in the system. It generally represents things like Hp and Limits and is assigned on the <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/stat\/\" title=\"Stat\">Stat<\/a> class. <br><br>The StatBar has a good looking visual animation for when the bar increases or decreases. Depending on whether there is an increase or decrease, one of the Image components will animate to match the other Image component which instantly reaches the target point.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Setting up<\/h2>\n\n\n\n<p>There is a prefab of StatBar in \/Prefabs.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"279\" height=\"217\" src=\"https:\/\/golemitegames.com\/wp-content\/uploads\/2025\/11\/image-29.png\" alt=\"\" class=\"wp-image-2343\" style=\"width:200px\"\/><\/figure>\n\n\n\n<p>StatBars should either have a <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/ui-billboard\/\" title=\"UI Billboard\">UI Billboard<\/a> attached or be a child of one to maintain rotation with the Camera.<br><br>However if you wanted to set up this component yourself, simply add the StatBar component to gameobject. Create a World Canvas as a child, and then create your bars or dials as a child of the Canvas. Assign them in the StatBar component.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Settings<\/h2>\n\n\n\n<p><strong>Fill Image<\/strong><br>The Image component for the main &#8216;Front&#8217; fill bar. <br><br><strong>Animated Fill Image<\/strong><br>The Image component &#8216;Behind&#8217; the main Fill Image. <br><br><strong>Use Text<\/strong><br>If set, will update a text component will the Stat&#8217;s Current value using the <a href=\"https:\/\/golemitegames.com\/index.php\/docs\/resource-and-production-manager\/\" title=\"Resource And Production Manager\">Resource And Production Manager<\/a> float precision. <br><br><strong>Stat Text<\/strong><br>Text Mesh Pro UGUI component that will update when the Stat changes. <br><br><strong>Bg Fill Move Speed<\/strong><br>How quickly does the Image component fill value keep up with the other Image component fill value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"font-size:22px;text-transform:capitalize\">Scripting<\/h2>\n\n\n\n<p>There are a couple of public methods available for StatBar below<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\" data-show-lang=\"0\"><code>\/\/\/ &lt;summary&gt;\n\/\/\/ Refresh the StatBar with a Stat object\n\/\/\/ &lt;\/summary&gt;\n\/\/\/ &lt;param name=&quot;stat&quot;&gt;The Stat to use to refresh the StatBar&lt;\/param&gt;\npublic void UpdateStatBar(Stat stat)\n\n\/\/\/ &lt;summary&gt;\n\/\/\/ Refresh the StatBar with the relevent parameters\n\/\/\/ &lt;\/summary&gt;\n\/\/\/ &lt;param name=&quot;current&quot;&gt;The current fill value&lt;\/param&gt;\n\/\/\/ &lt;param name=&quot;max&quot;&gt;The max fill value&lt;\/param&gt;\n\/\/\/ &lt;param name=&quot;previous&quot;&gt;The previous value, this is used for the animated effect&lt;\/param&gt;\npublic void UpdateStatBar(float current, float max, float previous)<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction StatBar is a visual utility class used on a few components in the system. It generally represents things like Hp and Limits and is assigned on the Stat class. The StatBar has a good looking visual animation for when the bar increases or decreases. Depending on whether there is an increase or decrease, one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"doc_category":[46],"doc_tag":[],"class_list":["post-2341","docs","type-docs","status-publish","hentry","doc_category-resource-and-production"],"acf":[],"aioseo_notices":[],"year_month":"2026-04","word_count":339,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"rickitz5h","author_nicename":"rickitz5h","author_url":"https:\/\/golemitegames.com\/index.php\/author\/rickitz5h\/"},"doc_category_info":[{"term_name":"Resource And Production","term_url":"https:\/\/golemitegames.com\/index.php\/docs-category\/resource-and-production\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs\/2341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/comments?post=2341"}],"version-history":[{"count":5,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs\/2341\/revisions"}],"predecessor-version":[{"id":2544,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/docs\/2341\/revisions\/2544"}],"wp:attachment":[{"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/media?parent=2341"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/doc_category?post=2341"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/golemitegames.com\/index.php\/wp-json\/wp\/v2\/doc_tag?post=2341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}