Thats a good point, as I said, I didn't look in depth into the code... you could however split the printing into a new function, for ease.
That should make it all a lot nicer to work with, and means you won't be running through that loop as many times.Code:void menu(int arrowYaxis) //new function to be called
{
clearScreen(RGB(0,0,0));
printTextScreen(0,0,"Hello World", Red);
printTextScreen(150, arrowYaxis, "=>",Red);
printTextScreen(170, 140, "MenuOption1",White);
printTextScreen(170, 150, "MenuOption2",White);
printTextScreen(170, 160, "MenuOption3",White);
return;
}
int main()
{
initGraphics();
sceCtrlReadBufferPositive(&pad, 1);
flipScreen();
for(;;)
{
if(pad.Buttons & PSP_CTRL_UP)
{
arrowYaxis+=10;
//do functions here
menu(arrowYaxis); //calls menu function
}
if(pad.Buttons & PSP_CTRL_DOWN)
{
arrowYAxis-+10;
menu(arrowYaxis); /*
* this means you can have neater code
* while keeping the code functioning
* correctly, it also makes it easier
* do debug.
*/
}
}
}
-Aura
