Welcome! Log In Create A New Profile

Advanced

libwiisprite - HowTo draw on a Sprite?

Posted by stitch 
libwiisprite - HowTo draw on a Sprite?
August 06, 2008 11:10PM
Hello!

I'm using libwiisprite for my project for rendering the GUI.
Now, i must render some text.
First i thought that i port FreeType, but for that i need to draw on a Sprite directly...

Please Help :)

Or if anyone have another way to draw nice text to the screen, it would be welcome too.
Until now, i used the "textclass", but it can just draw text that looks like DOS and
when i'm making a new font, it just looks bad because of all the spaces...

Hope that you can understand me, my english isn't the best....



Edited 1 time(s). Last edit at 08/06/2008 11:25PM by stitch.
Re: libwiisprite - HowTo draw on a Sprite?
August 06, 2008 11:31PM
FreeType has already been ported. Look at the wiki page.
DragonMedia player and missle command use the port.
Re: libwiisprite - HowTo draw on a Sprite?
August 07, 2008 02:27AM
Currently there is no full text support in the Libwiisprite, usually for a menu, programmers will use an image then use raw2c on it to convert it to a constant array of unsigned chars, then load from buffer like so:

if(image.LoadImage(imageInMemory) != IMG_LOAD_ERROR_NONE)exit(0);

You could go behind the scenes and inject a ttf directly into your program using GX.
Re: libwiisprite - HowTo draw on a Sprite?
August 07, 2008 01:48PM
thank you vader347, I will look at it :)

Edit:

Mh, i can't get it to work :(

Even DragonMinded's example don't works...

I've pasted the Makefile and the source (it compiles without errors, but on the wii i have a black screen...)

Makefile: [pastebin.com]
C++ file: [pastebin.com]



Edited 1 time(s). Last edit at 08/07/2008 03:26PM by stitch.
Re: libwiisprite - HowTo draw on a Sprite?
August 10, 2008 05:44PM
I have already done manual drawing on an already loaded libwiisprite image. It is easy, you just use the protected member variable _pixels and write some encoding code so that you get the texture format right. Feel free to use my code for this, I comes with some misc basic drawing functions.
Re: libwiisprite - HowTo draw on a Sprite?
August 10, 2008 06:13PM
@henke37

Where can I get your code, I seem to have my own problem.
Re: libwiisprite - HowTo draw on a Sprite?
August 10, 2008 08:00PM
Well, for most purposes, you don't need to worry about the _pixels property with my code. It's not filled with comments, but the header files should be good enough for people who are good enough programmers to know C++.

It's mixed up with the rest of my code for the wiihttpd project, the svn url is:
[wiiwebserver.svn.sourceforge.net]
Sorry, only registered users may post in this forum.

Click here to login