Welcome! Log In Create A New Profile

Advanced

libwiigui draw image help

Posted by mdbrim 
libwiigui draw image help
August 08, 2010 04:27AM
Ok, I'm a GRRLIB user trying to branch out to help someone update something they did with libwiigui...

Trying to figure out how to draw an image. Thru trial and error, (and copying existing code) I can get an image to display using the
boah = new GuiImageData(arrow_left_png);
	boahImg = new GuiImage(boah);
	
	boahImg->SetAlignment(ALIGN_MIDDLE, ALIGN_MIDDLE);
	boahImg->SetPosition(300,200);
	boahImg->SetScale(3);
method.

But i can't see how to use tiles or even rotation using that method.

So i tried inserting a Menu_DrawImg line that atleast allows me to rotate, but it gets over drawn by the rest of his Append stuff.

I've googled, searched the forum, even checked out tutorials etc.

I guess i just need help drawing an image with rotation... and how to do tiles... and how to set a reference point on an image for rotation... That's all i need! :D
Re: libwiigui draw image help
August 10, 2010 01:26PM
to just draw a simple image, you can use the menu_draw_image() function. look at how it draws the cursor for an example. but this is not recommended, and actually defeats the purpose of much of the gui framework to do it for all your images. instead, it is meant to be laid out in a hierarchy.

first create your imagedata, then create your image from it, as you have already done. then you can append your images to a window. and when the window is drawn, all the elements that make up that window will be drawn. as far as the angle and tiles, look at gui.h. someImage.SetAngle( int someAngle ); and someImage.SetTile( int number );

i believe the SetTile() is used in the progress bar and the SetAngle() is used in the throbber.
Re: libwiigui draw image help
August 11, 2010 01:37AM
sweet, i'll take a look at those.

I'm imagining that you have to predefine the image for use with tiles... as in define how big each tile is so that we you give a tile number, it knows what to grab. Any hints on that?

I'll take another look at gui.h and see what i can absorb!

Thanks!
Re: libwiigui draw image help
August 11, 2010 03:04AM
ahhh, slight confusion.

I found the gui.h which gives me most of what i need.

only problem is that's not what i meant by tile. that just repeats the image over and over again. I'm looking for having an image with multiple tiles in it, and then saying draw tile 1 or draw tile 2 of the whole image. Think animation style, scrolling thru tiles and what not.

Any ideas? I'm guessing from what i've seen it's not possible, IE libwiigui wasn't created for that kind of stuff... just as a gui... in which case i'll start edumacating my self on using GRRLIB AND libwiigui at the same time...
Re: libwiigui draw image help
August 12, 2010 05:53PM
So we're going with the not possible route eh?

Ok cool. Now to figure out how to mix graphic libraries here. I can easily get the commands in and have it all compile...

Any one have any experience with getting the two dif DRAWing commands to play well together.

IE using APPEND-> stuff with libwiigui and having it play nicely with say GRRLIB_Render
Re: libwiigui draw image help
August 13, 2010 04:16AM
Not possible with libwiigui as it's currently written. But the idea behind libwiigui is that you can extend it to do something like this.
Re: libwiigui draw image help
August 13, 2010 10:05PM
gotcha... thanks for the heads up Tantric... that saves me a ton of time continuing on the road I was going down. I'll change lanes and try something else!

When you say extend it to do something like this... do you mean do to tiles or work with other graphic libs (or both).
Re: libwiigui draw image help
August 14, 2010 12:38AM
One or the other, or both. You can extend the GX in libwiigui to be used for tiling, and add some class functions to use it. Also, the GX in libwiigui is already compatible with GRRLIB.
Re: libwiigui draw image help
August 14, 2010 02:43AM
sweet, maybe i'll try my hand at adding tiling to libwiigui
Sorry, only registered users may post in this forum.

Click here to login