Welcome! Log In Create A New Profile

Advanced

MLlib doesn't show my sprite

Posted by Bowserkoopa 
MLlib doesn't show my sprite
March 12, 2010 01:40PM
Hi everybody :D !
I started coding for Wii but now I have a little problem: If I try to draw a sprite with the MLlib it doesn't appears.
Compiling works well, but if I try to load the .dol file with dolphin I get that screen:



I don't think that it should look like that :S The example in the MLlib_others folder doesn't work too. The Splashscreen ist yellow and there isn't any sprite.

Here's my code:
Quote

#include
#include "YoshiEgg_png.h"

int main(int argc, char **argv)
{

ML_Init();

ML_Sprite YoshiEgg;
ML_Image YoshiData;


ML_SetBackgroundColor(GX_COLOR_WHITE); // Background is now white

//The Sprite is a png file and ist 100x100 px
ML_LoadSpriteFromBuffer(&YoshiData, &YoshiEgg, YoshiEgg_png, 100, 100);


while(1)
{
ML_DrawSprite(&YoshiEgg); // Draws the sprite on the screen

ML_Refresh();
}
return 0;
}
Re: MLlib doesn't show my sprite
March 12, 2010 04:28PM
3 things:
-Dolphin is far from perfect. I recommend testing on a real Wii, results could be better there.
-Maybe the file needs to have power of 2 sizes (128x128 for example)
-Use a different image host. Adds on that one are insane.
Re: MLlib doesn't show my sprite
March 12, 2010 05:30PM
Sry, but I googled a free image hoster and found that xD I will look that I found a add-free uploader.
Isn't there anything I can use to test my progged apps on the PC? I don't think that I can always start the wii to try if a new sprite will be loaded :S
Re: MLlib doesn't show my sprite
March 14, 2010 03:12PM
Sorry for the double post but i tried it on the wii but I see only the Airship-Sprite. The BowserAngry.png and the BowserCursor is missing :(
/*		-==========================-
		|		Bowser & Yoshi	   |
		-==========================-

*/


#include 

#include "Airship_png.h"
#include "BowserCursor1_png.h"
#include "BowserAngry_png.h"
#include "font_png.h"

int main(int argc, char **argv) 
{

	ML_Init();
	ML_InitFAT();

	ML_Sprite Airship, BowserAngry, BowserCursor1;
	ML_Image Airshipdata, BowserAngryData, Cursor1Data;
	
	
	ML_SetBackgroundColor(GX_COLOR_WHITE); // Background is now white
	
	
	
	//----------Laden der Sprites------------/

	//Sprites Laden. Zuerst das Luftschiff
	ML_LoadSpriteFromBuffer(&Airshipdata, &Airship, Airship_png, 0, 200);
	//Bowserhand
	ML_LoadSpriteFromBuffer(&Cursor1Data, &BowserCursor1, BowserCursor1_png, 200, 200);	
	//BowserAngry
	ML_LoadSpriteFromBuffer(&BowserAngryData, &BowserAngry, BowserAngry_png, 100, 200);

	
	
	
		while(1)
		{
		if(Wiimote[0].Held.Home)
			{printf("Programm wird beendet"); ML_Exit(); }
	
		
		//Sprites zeichnen
		ML_DrawSprite(&Airship); // Draws the sprite on the screen
		ML_DrawSprite(&BowserAngry); 
		ML_DrawSprite(&BowserCursor1);
		
		ML_MoveSpriteWiimoteIR(&BowserCursor1, 0);
		
		if(Wiimote[0].Held.A && ML_IsWiimoteInSprite(0,&BowserAngry))
				{ ML_Screenshot("/screenshot.png"); printf("Tolles Bild gemacht"); }
		
		
		ML_Refresh();
		}
		
		
	return 0;
}

Re: MLlib doesn't show my sprite
March 14, 2010 03:22PM
You images have to have dimensions which are a multiple of four. Otherwise they will not display. I am guessing that this is your issue.
Re: MLlib doesn't show my sprite
March 14, 2010 08:08PM
Great! That was the problem. The pictures hadn't the right dimensions. Thanks :)
Sorry, only registered users may post in this forum.

Click here to login