Paradise icon indicating copy to clipboard operation
Paradise copied to clipboard

[TGUI] ImageButton component

Open AyIong opened this issue 11 months ago • 0 comments

What Does This PR Do

New TGUI component - ImageButton! Documentation is included, any suggestions will be appreciated

It was created to solve several problems:

  1. To improve the performance of buttons with images
  2. Improve the convenience of creating buttons with images
  3. Standardise buttons with images

Replaces custom styled buttons in Prize Counter to ImageButton. There aren't many differences in appearance, but it looks more polished in the little things.

How it looks like
Before After
image image

In addition, the render time when opening the window was reduced from 8-10 frames to 5-6 frames. Not much, but its something.

Render time
Before After
image image

Also added 1 more color - gold.

Why It's Good For The Game

Beautiful buttons that are easy to embed images into. The component itself is not very heavy, unlike variants where the image is embedded in a regular Button component. In the end, I tried to make the component as convenient as possible for developers

Images of changes

You can see and test it into KitchenSink image

Testing

Yes, on the BayStation12 downstream SS220 with identical TGUI on 3 UI's And here on PrizeCounter

Anyway there are a couple of problems worth solving:

  1. You can't overlay an icon on a image
  2. ImageButton.Item is quite expensive and increases render time by 1.5-2 times.
  3. ImageButton.Item has no vertical option
  4. ImageButton.Item has no horizontal option to position the icon horizontally

They are not very critical and there is no way to fix them at this time (Classic TODO 10 years later)

Changelog

:cl: tweak: A little polished PrizeCounter UI /:cl:

AyIong avatar Mar 21 '24 14:03 AyIong