Issues with the scaling of icons
Moderator: Forum Moderators
Issues with the scaling of icons
The addition of our bilinear filter has made it evident that there are certain problems that have been present in our interface code for a long time.
Simply, those special icons used for income and such should never, ever, be scaled. Period. They should be a fixed-size part of the ui; though perhaps larger and smaller variants could be drawn to be used on disparate screen sizes (I can happily make these, btw, in one night. It's a piece of cake).
I don't know where the problem is in the code, but somehow the icons are being scaled no matter what resolution the game window is sized to. This was never a good thing to have had in our old nearest-neighbor scaling system, but it looks particularly bad when scaled with any better algorithm. Don't get me wrong - the bilinear scaling code is awesome, it's just that no scaling whatsoever should be applied to icons like this:
I noticed this as I was playing 1.1svn, and discovered just what was going on when I attempted to make some new graphics to fix the problem - turns out the old ones were a lot better than they looked in-game, and that the images themselves were not the culprits.
I've attached a multi-screenshot that should show what's up.
Simply, those special icons used for income and such should never, ever, be scaled. Period. They should be a fixed-size part of the ui; though perhaps larger and smaller variants could be drawn to be used on disparate screen sizes (I can happily make these, btw, in one night. It's a piece of cake).
I don't know where the problem is in the code, but somehow the icons are being scaled no matter what resolution the game window is sized to. This was never a good thing to have had in our old nearest-neighbor scaling system, but it looks particularly bad when scaled with any better algorithm. Don't get me wrong - the bilinear scaling code is awesome, it's just that no scaling whatsoever should be applied to icons like this:
I noticed this as I was playing 1.1svn, and discovered just what was going on when I attempted to make some new graphics to fix the problem - turns out the old ones were a lot better than they looked in-game, and that the images themselves were not the culprits.
I've attached a multi-screenshot that should show what's up.
- Attachments
-
- scalingIssues.png (46.19 KiB) Viewed 5004 times
Ok, partly done...
I have a patch that prevent scaling images up. i.e interpolating when the available size is bigger than the image size...
I can make it work both way, but I'm not sure that's what you want... I'll wait for feedback from you before commiting....
we can also discuss it on IRC if you're around...
I have a patch that prevent scaling images up. i.e interpolating when the available size is bigger than the image size...
I can make it work both way, but I'm not sure that's what you want... I'll wait for feedback from you before commiting....
we can also discuss it on IRC if you're around...
Fight key loggers: write some perl using vim
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
Be careful, there may be places where scaling up is what is wanted. Perhaps what is needed is a flag in the theme definition or internally in the report that can be set to define how/whether an image gets rescaled.Boucman wrote:Ok, partly done...
I have a patch that prevent scaling images up. i.e interpolating when the available size is bigger than the image size...
I can make it work both way, but I'm not sure that's what you want... I'll wait for feedback from you before commiting....
we can also discuss it on IRC if you're around...
Also, I think it might be possible to avoid the rescaling problem by purely setting the theme definition for the various status-icons properly so that the theme does not change the size of the window in which the image is placed when the resolution is changed. I am not sure about it, and I can't test this for a few days, but it is something to consider.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
- Eleazar
- Retired Terrain Art Director
- Posts: 2481
- Joined: July 16th, 2004, 1:47 am
- Location: US Midwest
- Contact:
good eye, jetryl.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
-> What i might be working on
Attempting Lucidity
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
Once I am back from vacation and have a chance to wesnoth* again, I will take a look at what you've done and see if there really is a need to make a more drastic change to the theme engine.Boucman wrote:well, what I did was the most I can do without huge changes in the theme engine that I won't do anyway (DarthFool, you're the one that knows that part well...)
yes, having a flag in the theme is probably the best way to do it...
*Yes, I've verbed the noun wesnoth.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
Basically, the themes should allow for certain items never to change in size no matter what the resolution. The themes need to flow around these.
For example, in the case of these icons, which are at current time 15 pixels tall, and 30 pixels wide, the theme engine should always allot exactly that space for the icon.
The space for the numbers after the icon can change completely, but the icon itself should never change. It should never be bigger, or smaller, than its native size, because it will look bad.
If things desperately need to shift in size, a different icon, designed to look good at that different size, should be used. Not to be a nitpicker, but this little point is significant since this is a graphical element that is visible literally all the time while playing wesnoth.
As has been said, the easiest way to do it is possibly to be able to flag certain interface elements in a theme as having a fixed and unadjustable size.
For example, in the case of these icons, which are at current time 15 pixels tall, and 30 pixels wide, the theme engine should always allot exactly that space for the icon.
The space for the numbers after the icon can change completely, but the icon itself should never change. It should never be bigger, or smaller, than its native size, because it will look bad.
If things desperately need to shift in size, a different icon, designed to look good at that different size, should be used. Not to be a nitpicker, but this little point is significant since this is a graphical element that is visible literally all the time while playing wesnoth.
As has been said, the easiest way to do it is possibly to be able to flag certain interface elements in a theme as having a fixed and unadjustable size.
Play Frogatto & Friends - a finished, open-source adventure game!