Adventure Game Studio

AGS Development => Engine Development => Topic started by: Crimson Wizard on Tue 11/01/2022 22:09:18

Title: GUI Controls clipping
Post by: Crimson Wizard on Tue 11/01/2022 22:09:18
Following this request (https://www.adventuregamestudio.co.uk/forums/index.php?topic=58976.msg636641952#msg636641952), I want to add a game setting that makes the GUI controls clip their graphic contents, that is limit the drawing to their formal rectangle defined by X, Y, Width, Height.

https://github.com/adventuregamestudio/ags/pull/1495

I don't know why, but in AGS controls don't clip, so the text may extend outside of the control. The only exception here is a button with image, which image may be clipped by setting specific property.

My initial plan was to introduce a global setting, that affects all controls, and is enabled by default (for the new projects). Personally, I believe that it's normal for gui controls to restrict their contents, and most graphic frameworks seem to do this. But since AGS has its own history of use, and there may be strange cases, I also would like to hear opinions.

Theoretically, I may also add a per-control property, merging it with the Button's "Clip Image". Technically this should be trivial, as this is just an internal engine's flag that may already be applied to any control (but only buttons know how to handle); so that's not a big deal. But in this case I'm more worried that it will make engine's design more complicated, and perhaps game design too, as people will have to specifically remember to toggle this on or off per each thing that needs it.



EDIT: this was done in 3.6.0.