SplitImage also in Vertical direction
« on: 28 August 2013, 21:29:49 »
First of all: Gute Arbeit! Good Work!

My proposal:
To have a size independant gui without scaling artifacts  you need to be able to split in vertical direction also.

Instead of
xxx_L, xxx_M and xxx_R
you would need to define upper left corner, lower left corner, upper middle part, lower middle part, left middle part, right middle part, upper right corner and lower left corner.

Sounds like a bunch.
But wait, assuming your button symmetrical, you might get away with one corner, one middle part, and the middle. You'd just need to mirror each part accordingly. Which btw you could also do in the old splitimage with the left and right parts.

What do you think?
« Last Edit: 28 August 2013, 21:34:12 by Heinrich »

*

texus

  • *****
  • 1151
    • View Profile
    • Texus's Blog
Re: SplitImage also in Vertical direction
« Reply #1 on: 28 August 2013, 21:54:02 »
I don't think this is needed.

SplitImage was made mainly to make the default tgui styles look good for any application, so that it still looks nice when using them as temporary images or even as permanent images.

The idea is that when making your own images, you will make them have the correct size and you wouldn't need SplitImage. When you want to support multiple resolutions you could also have multiple images if you can't get the wanted result with SplitImage.

I think it would make my code unnecessary more complicated if I would implement what you are proposing.
I have thought about this myself before, but I still don't have a really good reason to make my SplitImage code harder than it already is.

Re: SplitImage also in Vertical direction
« Reply #2 on: 28 August 2013, 22:00:03 »
"I think it would make my code unnecessary more complicated if I would implement what you are proposing."
Maybe.
"I don't think this is needed."
I'd use it :D

However. I haven't done much with tgui except compiling the lib and playing around with example code.
Is it possible to define several buttons? From the .conf I got the idea that there was only one button figured it out. Well, it would be a nice feature to only need one image file and be able to use it for multiple button sizes. My concrete use case was, that I wanted a menu/message boxes with rounded rectangle borders. Sizes of the message boxes would vary with length of text in both x- and y- direction.

Generally, I don't think having different Button sizes is an outlandish idea. Also thanks for fast reply.
« Last Edit: 28 August 2013, 22:13:41 by Heinrich »

*

texus

  • *****
  • 1151
    • View Profile
    • Texus's Blog
Re: SplitImage also in Vertical direction
« Reply #3 on: 28 August 2013, 22:11:47 »
Quote
Is it possible to define several buttons? From the .conf I got the idea that there was only one button.
The config file can only contain one button, but you can use different config files (e.g. a different config file for different resolutions).

Quote
I don't think having different Button sizes is an outlandish idea.
True, I am using it as an example but I realize that you normally don't do that.

Quote
I'd use it :D
The question is why?
If you could give me something that you could do then that you can't do already, then I might be more likely to consider the idea.
But knowing how much more complicated some parts of my code are already due to SplitImage, I won't be convinced very easily.

Re: SplitImage also in Vertical direction
« Reply #4 on: 28 August 2013, 22:15:58 »
Hi texus,

I edited my reply while you posted. I think I answered your question there with my use case. Next time I will respond more assiduously.

*

texus

  • *****
  • 1151
    • View Profile
    • Texus's Blog
Re: SplitImage also in Vertical direction
« Reply #5 on: 28 August 2013, 22:25:28 »
That is indeed a good use case.

But the change is pretty big (and I haven't decided yet if I really will implement it), so you can't expect it anywhere soon.

I guess you will to draw the 9 images and the text on top of it yourself with sfml for now.