I am worried about allowing different screen resolutions. I am going to have a gui that I would need to scale depending on the different sizes. If i dont do it somehow, I will have funny looking interface. Will I have to have a different size font and HUD image for each size resolution? or could I somwhow scale the different items?
Many helps would be of goodness,
TomB
resolution and scaling gui graphics
This might be wrong, and I hope it is, but here we go anyways. I've been actually looking at this exact thing. If you use Irrlicht's built in gui objects (buttons, windows, text boxes) you can scale them when they are created (easily done if you use variables to hold the values rather than specifying them). The problem, it looks like, is if you're using your own images. I haven't been able to find (yet) a method to scale the image once it's loaded in. Something I'm going to have to look at when I get home is honestly something I just thought of. When I use an image in the gui, it's loaded as a texture. There might be a way to scale the image once you have it loaded, but before you add it to the gui environment.
If I find it, I will definately post the solution to it here.
If I find it, I will definately post the solution to it here.
Any success until now?
Just tripped over the same problem.
I have a freely scalable guy by specifying all my element coordinates as products of their parents' dimensions (so x=0.5f,y=0.5f means that my elements left corner is at the center of its parent).
The only problem is, that any images used by my gui don't bother about scaling, so nothing fits.
Same problem goes for static texts. On a 1280/1024 resolution the built-in font is almost unreadable because it's so tiny.
Any suggestions? plz plz plz
Just tripped over the same problem.
I have a freely scalable guy by specifying all my element coordinates as products of their parents' dimensions (so x=0.5f,y=0.5f means that my elements left corner is at the center of its parent).
The only problem is, that any images used by my gui don't bother about scaling, so nothing fits.
Same problem goes for static texts. On a 1280/1024 resolution the built-in font is almost unreadable because it's so tiny.
Any suggestions? plz plz plz
-
- Posts: 31
- Joined: Fri Apr 21, 2006 12:00 am
- Location: Australia
While the above proportions tip fixes this problem for buttons, windows etc, it still doesn't help when you add images or static text.
So far I've only been able to get it to display images and text on a pixel-by-pixel basis, because I haven't found how to scale a 2d image (via the gui or just normal drawing routines).
So far I've only been able to get it to display images and text on a pixel-by-pixel basis, because I haven't found how to scale a 2d image (via the gui or just normal drawing routines).
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Fonts are not scalable in Irrlicht such that you have to provide different font sizes based on typical resolutions. then, choose the righ font from your set of sizes.
Images should probably not be scaled because you'll easily loose important details. Otherwise use the IImage constructor which uses an existing image and provides a target rectangle to specify destination size. This is slow, but scales to the correct size.
Images should probably not be scaled because you'll easily loose important details. Otherwise use the IImage constructor which uses an existing image and provides a target rectangle to specify destination size. This is slow, but scales to the correct size.