Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically Scaling Command Bar #33

Open
tomsons26 opened this issue Apr 21, 2018 · 7 comments
Open

Dynamically Scaling Command Bar #33

tomsons26 opened this issue Apr 21, 2018 · 7 comments

Comments

@tomsons26
Copy link
Contributor

tomsons26 commented Apr 21, 2018

Now that i got your attention let's break this down.

The SAGE engine uses Westwood's WND UI system, the system is bound to a prefixed aspect ratio the window was created with. The game scales the window to fit the aspect ratio its running at.

That in modder case would mean you would need to create a command bar WND for every aspect ratio.
So what's the solution to avoid having to replace the files on every different aspect ratio?
It's simple really, well on paper, instead of scaling the command bar we give things fixed locations.
These are effectively the components
cmdbarcomponents
Broken down into components it would be like this, we also need a tileable texture for filling in the command bar
cmdbarcomponents2

All comes together like that.
(Scaling the ui will still happen but in fixed aspect ratio so there would be no distortions, just for making it easier for me i didn't scale the command bar in those mockups)

If you are wondering where this incredibly unique idea came from, well this is exactly how everyone else deals with this problem
Here's a StarCraft 2 screenshot that is pushed to so wide screen it exposes this method even
scshot

@OmniBlade
Copy link
Contributor

From a practical point of view, how many aspects do we realistically need to support? I'd say only really 4:3 which we already have and 16:9. I was thinking more along the lines of how languages are handled where an optional additional path is searched first for appropriate assets, falling back to some default when not found. That way vanilla is unaffected, but the engine will load widescreen assets if a big file is loaded contained them in the appropriate path.

@OmniBlade OmniBlade changed the title Dynamically Scaling Command Bar plz NAU Dynamically Scaling Command Bar Apr 26, 2018
@Invictaz
Copy link

Invictaz commented Nov 1, 2018

Might do aso 21:9 for widescreen gamers. And 16:10 for 1920x1200

@Qibbi
Copy link

Qibbi commented Nov 1, 2018

Instead of having different wnds for different aspect ratios you could also check how the sub windows are aligned. If they are centered, and aren't buttons or something you can stretch them, otherwise you can calculate offset positions based on the wnd aspect ratio and desired aspect ratio. From tomsons screenshot one can see that the command bar background, power meter, and cash display are the only 3 centered items, which can all be tiled. In ZH as there are 7 buttons per row iirc there will be one button in the middle but because it is of type push button it should only be repositioned but not stretched.

@xezon
Copy link
Contributor

xezon commented Oct 15, 2021

Accounting for center section tiles will indeed make the control bar scalable. Will be nice if we can tackle this feature once WND is implemented.

@ElTioRata
Copy link

ElTioRata commented Mar 9, 2024

Another approach I found it's fixing and unstretching all of the command bar to the bottom-center like this mod does. It requires a few issues to be fixed afterwards (like re-art the command bar edges and remove or cover those black rectangles).
Both the tiling approach and this one I just suggested aren't exclusive from each other, tiling may be uncomfortable in wider proportions than 16:9 since you'd have to turn your head to look for the radar for example, an option to limit command bar tiling to a certain width would be nice.

@xezon
Copy link
Contributor

xezon commented Mar 9, 2024

The "destretch" approach is a good idea too. I am copying the image here for safe-keeping

screen

Other than that, since a few years we also have a "Control Bar Pro" and variants of it specifically designed for 16:9 that replace the original Control Bar experience. Many pro players and streamers do use that already.

ControlBarPro_01

@ElTioRata
Copy link

ElTioRata commented Mar 10, 2024

I found the same mod but for vanilla Zero Hour (just in case y'all wondered how it looks).

screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants