I've read the UI editor tutorial and its all greek to me. I could use some assistance with it. I simply need to move my resources (minerals and gas) to the bottom center of the screen right above the Command Card.
I understand to do this you have to important or create a layout file in the UI editor. I really don't understand how to do either.
2) Do not copy the "ResourcePanel" XML, that implies to hook and update the panel.
3) We need to use the native resource panel, the system will update it by itself.
4) Create a new panel. See 3rd attached picture.
5) Add a frame. Gift for you :
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Desc>
<!-- We look for the native UI frame -->
<Constant name="FrameAnchor" val="$ancestor[@name=FullscreenUpperContainer]/$parent/ConsolePanel/CommandStub"/>
<!-- This frame is used to define sizes and its location -->
<Frame type="Frame" name="ModResourcePanel">
<Anchor side="Top" relative="#FrameAnchor" pos="Min" offset="-64"/>
<Anchor side="Left" relative="#FrameAnchor" pos="Min" offset="0"/>
<Anchor side="Right" relative="#FrameAnchor" pos="Max" offset="0"/>
<!-- The "ResourcePanel" has 2 rows (with same data), we must set the height to hide the duplicated row -->
<Height val="42"/>
<!-- The template we want -->
<Frame type="Frame" name="ModResourcePanelTemplate" template="ResourcePanel/ResourcePanelTemplate">
<!-- Same size as the parent -->
<Anchor side="Top" relative="$parent" pos="Min" offset="0"/>
<Anchor side="Left" relative="$parent" pos="Min" offset="0"/>
<Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
<Anchor side="Right" relative="$parent" pos="Max" offset="0"/>
</Frame>
</Frame>
</Desc>
6) Create your panel in the trigger editor. See 1st attached picture.
7) And voilà ! You should get your resource panel above the command card. See 2nd attached picture.
Take note that the width of your resource panel is the exact same size as the width of the command card from the left 1st button to the right 5th button. You obviously can change the XML to make it to your taste.
Tip : CTRL + ALT + 12 opens the UI debugger in the game. It will helps you to find the "TriggerContainer" which is the frame container of all UI elements created with triggers. That container is itself inside the "FullscreenUpperContainer" which is everything the above the console panel, itself inside the UIContainer and the GameUI (main frame you must not forget).
I basically gave you the solution. I usually don't but give hints, hypothesis, approximations.
Take the time to understand what I did and why it works.
I've read the UI editor tutorial and its all greek to me. I could use some assistance with it. I simply need to move my resources (minerals and gas) to the bottom center of the screen right above the Command Card.
I understand to do this you have to important or create a layout file in the UI editor. I really don't understand how to do either.
Can someone help me with this?
Hello,
1) Check if the panel is locked.
2) Do not copy the "ResourcePanel" XML, that implies to hook and update the panel.
3) We need to use the native resource panel, the system will update it by itself.
4) Create a new panel. See 3rd attached picture.
5) Add a frame. Gift for you :
6) Create your panel in the trigger editor. See 1st attached picture.
7) And voilà ! You should get your resource panel above the command card. See 2nd attached picture.
Take note that the width of your resource panel is the exact same size as the width of the command card from the left 1st button to the right 5th button. You obviously can change the XML to make it to your taste.
Tip : CTRL + ALT + 12 opens the UI debugger in the game. It will helps you to find the "TriggerContainer" which is the frame container of all UI elements created with triggers. That container is itself inside the "FullscreenUpperContainer" which is everything the above the console panel, itself inside the UIContainer and the GameUI (main frame you must not forget).
I basically gave you the solution. I usually don't but give hints, hypothesis, approximations.
Take the time to understand what I did and why it works.
Documentations :
https://sc2mapster.fandom.com/wiki/UI_Editor
https://sc2mapster.github.io/ui/2018/02/07/basic-introduction-to-layouts.html
Have a nice day.