-
Notifications
You must be signed in to change notification settings - Fork 61
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
Comments
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. |
Might do aso 21:9 for widescreen gamers. And 16:10 for 1920x1200 |
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. |
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. |
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). |
The "destretch" approach is a good idea too. I am copying the image here for safe-keeping 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. |
I found the same mod but for vanilla Zero Hour (just in case y'all wondered how it looks). |
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
Broken down into components it would be like this, we also need a tileable texture for filling in the command bar
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
The text was updated successfully, but these errors were encountered: