Hey.

I have long been interested in the topic of "stretching" UI. I need to do a "stretching" UI. There are no special problems in implementation, but there is one:

  1. Renderer engine does not support vector graphics
  2. It is impossible to implement the rendering of controls without external graphics due to the lack of effects I need (I don’t want to write shaders for the buttons)

Ie the only way out - raster sprites. Question: How to make a stretching raster UI but at the same time, what would it not look like Minecraft?

The engine supports only the simplest interpolation, as in the paint (via d3dx), and there is a limit on the number of DrawCall

In the engine where I work, there is only a scripting language, so a rendera modification is not possible.

    1 answer 1

    One of the solutions that is inspired by disassembly in a смежной теме is to try the principles of adaptive design. In other words, for certain areas that have ranges of min and max for widths and heights, create appropriate sets of controls.

    Yes, when stretching, it will work "intermittently". At first "stretch" the gaps between controls. As soon as the region jumps to a different mix-max , the controls are drawn from a different, corresponding, set.

    If the vector graphics engine does not support, I hope, the storage medium of your device - will it master a couple of dozen (millions, joke) sets? :)

    • Thanks, but I can’t draw on every pair of width \ height controls;) This is a library, and if you can do with the text field, you can’t draw a checkbox or a beautiful button without Photoshop;) Except for CSS and QSS - user241285
    • In the context of the growing popularity of "adaptive design" - use sets of resolutions of typical models of smartphones / tablets. There are not many, a couple of dozen. Multiply your set of controls by 50. Well, plus 10 more sets for desktop resolutions. But I do not insist - the decision is yours, my only idea)) - Majestio
    • So the thing is that the controls will be drawn by users by libraries (or rather their designers if they have any), because the solution is for game developers on one very well-known designer, I think everyone already guessed what;) - user241285
    • About the "very famous constructor" - I ask you to reveal a military secret) But for "drawing by users" ... I can give a rough, but vsezh, analogy - the icon editor. The ICO format is essentially a library. You want to draw icons for all versions of Default OS - provide all supported sizes for each version. Just last week I did it. It works just amazing. Well, users - well, let them understand that the target device does not support vector graphics, and it is necessary to draw. Otherwise, good luck not to see. - Majestio
    • Game Maker Studio - user241285