Looking for some pointers for Gui creation with pvr, control

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
cyrusdevx
DCEmu Newbie
DCEmu Newbie
Posts: 9
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Oct 10, 2015 9:46 am
Has thanked: 0
Been thanked: 0

Looking for some pointers for Gui creation with pvr, control

Post by cyrusdevx »

https://en.wikipedia.org/wiki/Text-based_user_interface

^ this is what I'm looking for in the end but maybe not as complex.

Any help would be great :D
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Looking for some pointers for Gui creation with pvr, con

Post by bogglez »

So basically you want to draw lines, rectangles and fonts?
1. Check out the pvr tutorials in the wiki for drawing triangles. At the very bottom of the page there's an old tutorial where line drawing is explained as well.

2. Fonts are slightly more difficult, but not really. You want a "texture atlas", a single texture in which all available characters are stored, instead of one texture per character.
The difficulty lies in generating such a texture, using it is easy. You just need an array of information where each character lies in the texture.
Here's a very old project of mine which does that. Sadly I don't know whether it still builds but you can get some inspiration from the code. The draw function is the most interesting here. It handles Unicode strings but you probably just care about normal ASCII (I created a Japanese font)

Usage: https://bitbucket.org/bogglez/libbft/sr ... ew-default

And this is an accompanying tool I made to create the font info file. The code might be in a bad state, sorry.
https://bitbucket.org/bogglez/fnt2bft

If you have any questions just ask.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
cyrusdevx
DCEmu Newbie
DCEmu Newbie
Posts: 9
Joined: Sat Oct 10, 2015 9:46 am
Has thanked: 0
Been thanked: 0

Re: Looking for some pointers for Gui creation with pvr, con

Post by cyrusdevx »

bogglez wrote:So basically you want to draw lines, rectangles and fonts?
1. Check out the pvr tutorials in the wiki for drawing triangles. At the very bottom of the page there's an old tutorial where line drawing is explained as well.

2. Fonts are slightly more difficult, but not really. You want a "texture atlas", a single texture in which all available characters are stored, instead of one texture per character.
The difficulty lies in generating such a texture, using it is easy. You just need an array of information where each character lies in the texture.
Here's a very old project of mine which does that. Sadly I don't know whether it still builds but you can get some inspiration from the code. The draw function is the most interesting here. It handles Unicode strings but you probably just care about normal ASCII (I created a Japanese font)

Usage: https://bitbucket.org/bogglez/libbft/sr ... ew-default

And this is an accompanying tool I made to create the font info file. The code might be in a bad state, sorry.
https://bitbucket.org/bogglez/fnt2bft

If you have any questions just ask.
thanks :D +1
Post Reply