Center text on screen?
December 20, 2015 08:10PM
I'm working on my first app, and would like to know how to center the text output.

(I can't discuss the app itself here as I'm unsure if it's a bannable topic.)



Edited 1 time(s). Last edit at 12/20/2015 08:11PM by NovaPikmin.
Re: Center text on screen?
January 05, 2016 02:07AM
Well here's some sample code from AnyRegion Changer
printf("\x1b[2J\n");
printf("\n\t\t\t\t\t  AnyRegion Changer 1.2\n");
printf("\n\t  This software comes supplied with absolutely no warranty.\n");
printf("\t\t\t\tUse this software at your own risk.\n");

printf("\n\n\n\t\t\t\t" WARNING_SIGN " IMPORTANT BRICK INFORMATION " WARNING_SIGN "\n");
printf("\n\tSemi Bricks are caused by the Console Area setting not matching\n");
printf("\tyour System Menu region. A semi-brick in itself is not terribly\n");
printf("\tharmful, but it can easily deteriorate into a full brick--there\n");
printf("\tare multiple simple triggers to do so.\n");
printf("\n\tIn order to practice proper safety when using this application, \n");
printf("\tplease make sure that your Console Area and System Menu region \n");
printf("\tare congruent before rebooting your system. A warning will be\n");
printf("\tdisplayed if they are not in agreement.\n");

sleep(5);
printf("\n\n\t\t\t  Press (1) to continue or HOME to exit.\n");
wait_key(WPAD_BUTTON_1);
You can use \t to add spaces before the text in a printf function. \n moves the text to a new line. Since I only know very basic coding I can't give you any more complex methods of centering text but maybe you can check out some other open source apps to see if you can find an example. That's how I learned what I know about coding.



Edited 1 time(s). Last edit at 01/05/2016 02:08AM by bg4545.
Sorry, only registered users may post in this forum.

Click here to login