Welcome! Log In Create A New Profile

Advanced

[Resolved] Problem with sprite (it's not visible that is)

Posted by iSubaru 
[Resolved] Problem with sprite (it's not visible that is)
October 27, 2009 03:32PM
Hello
I've searched on Wiibrew wiki and found that forum so I guess someone will know how to solve that problem :)
I have started yesterday coding with Wii with use of MLlib which I must say is really great
I used some simple functions and all was working great but when it came to sprites...
I have written this about sprites:
ML_Image MikuBGData;
ML_Background MikuBG; // we declare our background
ML_LoadBackgroundFromBuffer(&MikuBGData, &MikuBG, MikuBG_png, 100, 100); // we load the background

ML_Image osucircleData;
ML_Sprite osucircle;

on while(1) is that:

ML_DrawBackground(&MikuBG);
ML_LoadSpriteFromBuffer(&osucircleData, &osucircle, osucircle_png, 100, 300); // we load the sprite
ML_LoadSpriteFromBuffer(&osucircleData, &osucircle, osucircle_png, 300, 300); // we load the sprite

if (ML_IsWiimoteInSprite(0, &osucircle) && (Wiimote[0].Newpress.A) && (!ML_IsPlayingMP3()))
{
	ML_PlayMP3FromBuffer(clap_mp3, clap_mp3_size);
}

if (ML_IsWiimoteInSprite(0, &osucircle) && (Wiimote[0].Newpress.A) && (!ML_IsPlayingMP3()))
{
	ML_PlayMP3FromBuffer(clap_mp3, clap_mp3_size);
}

The sound works but I can't see sprites...plus now it hangs to some code dump screen after some time (or uses of sprites, dunno)

If some more info is necessary I will try to provide it

Thank You for advance

iSubaru



Edited 1 time(s). Last edit at 10/28/2009 12:53PM by iSubaru.
Re: Problem with sprite (it's not visible that is)
October 27, 2009 09:47PM
At no point in the code you posted do you draw your sprites...
Re: Problem with sprite (it's not visible that is)
October 27, 2009 10:03PM
Oh...so that's what...

You was right Arikado sir, there wasn't Draw command :)
I feel a bit shame for such mistake I made, I guess it's partially because of habbits in Nintendo DS programming (sprites are handled in a bit diffrent way, there is loading on background numbered 0-3 so sprites are always visible if background image will be at #3 and sprites at #0, I didn't found such parameter here so I was confused a bit)

Very big Thank You Arikado sir for help and sorry for such trouble
Best regards

iSubaru
Sorry, only registered users may post in this forum.

Click here to login