News: Portal
Our Simutrans site. You can find everything about Simutrans from here.

gui_image_t has invalid alignment

Started by Ranran(retired), December 27, 2022, 09:39:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I want to display an image in the center of the component with gui_image_t, but it doesn't work.
gui_image_t can pass arguments for control_alignment_t but this doesn't seem to work.

gui_image_t is always biased to the upper left corner of the component because the size of image is the size of the component and the minimum size maximum size is the same as that.
Second, since it is trying to handle vertical and horizontal alignment with a single switch(alignment) state, I don't think it can handle both vertical and horizontal at the same time.

I would appreciate it if you could confirm this issue.


Yes, that is correct. Most likely, the alignment parameter was not used anywhere in the gui code. The single switch has to be broken into one switch for horizontal and vertical alignement.

In order to achieve what you want, you could make a new class derived from gui_image_t that returns infinite max-size.
Parsley, sage, rosemary, and maggikraut.