I mentioned before that Prism uses windows rather than screen objects as its HUD. There are several reasons we chose to implement the HUD that way. Firstly, it allows us to place text in our HUD more efficiently. This makes things like dynamic tool-tips trivial. Secondly, it offers more flexibility to the player. Prism will feature an interface editor that allows the player to change the position and size of any HUD element.
The only challenge posed to using windows as HUD elements is determining the position of the "child" windows. Prism will allow the player to choose a screen resolution. Prism automatically rearranges the "child" windows based on some properties defined in the user interface. As mentioned earlier, Prism features an interface editor. The player may choose the position of each element and assign the element a top, left, bottom, and right anchor. Then, based on the size and position of the game window, the HUD windows reposition.
Testing shows that, in order to allow the game window to be resized using the sizer, a delay of about 0.25 is necessary for smooth repositioning of child windows. However, with a delay that low, CPU usage was not favorable. To combat this, Prism will do one of the following, undetermined things: Use a higher lag and suffer the cosmetic consequences, or force a maximized window and not run a loop.
Attached is a demo.
Copyright © 2021 BYOND Software. All rights reserved.