Welcome! Log In Create A New Profile

Advanced

wiispritelib can only draw one image to the screen at a time!?

Posted by Cypri 
wiispritelib can only draw one image to the screen at a time!?
September 19, 2012 05:32PM
So I'm using WiiSpriteLib on a project (for the first time, though I have been coding for about 7-8 years now, and have previously coded on the Wii via homebrew in SDL) and it only seems to draw one sprite on the screen at a time. Anyone know if I'm doing anything wrong? This is my drawing code:

int drawScene(LayerManager *manager){
	for(int i = 0; i < MAX_PLAYERS; i++){	
		player.spr.SetImage(&image);
		player.spr.SetPosition(player.x, player.y);
		manager->Append(&player.spr);
	}
	 
	// Draw everything what's in the manager.
	manager->Draw(0, 0); 
	gwd.Flush();
	
	return 1;
}
Re: wiispritelib can only draw one image to the screen at a time!?
September 20, 2012 01:47PM
Need to post more code. SOmething is wrong in manager->Draw(0, 0); or SetImage(&image);
Re: wiispritelib can only draw one image to the screen at a time!?
September 20, 2012 04:12PM
More code ahoy. This is where I init Manager, and my image array.
LayerManager manager(1);
if(image[0].LoadImage("test.png") != IMG_LOAD_ERROR_NONE)exit(0);
if(image[1].LoadImage("test.png") != IMG_LOAD_ERROR_NONE)exit(0);

Okay, I figured out that I need to make the line
LayerManager manager(1);

into
LayerManager manager(NUM_SPRITES);



Edited 1 time(s). Last edit at 09/20/2012 06:00PM by Cypri.
Re: wiispritelib can only draw one image to the screen at a time!?
September 20, 2012 11:31PM
Oh ok, well good luck. :)
Re: wiispritelib can only draw one image to the screen at a time!?
October 25, 2013 05:51AM
HI there
Is it the only method to draw an image using a code?I found it' s a little bit difficult to draw images using code.
Is there any third party program which supports to draw an image directle instead of entering a code?
Thanks for any suggestion.
Sorry, only registered users may post in this forum.

Click here to login