Libwiisprite: writing text July 20, 2009 08:41PM | Registered: 15 years ago Posts: 444 |
Re: Libwiisprite: writing text July 20, 2009 09:05PM | Registered: 15 years ago Posts: 83 |
Re: Libwiisprite: writing text July 20, 2009 09:09PM | Registered: 15 years ago Posts: 405 |
Re: Libwiisprite: writing text July 20, 2009 10:31PM | Registered: 15 years ago Posts: 444 |
Re: Libwiisprite: writing text July 21, 2009 02:04AM | Admin Registered: 16 years ago Posts: 5,132 |
GRRLIB is in C and not Object Oriented at all. I'm not knocking the library, but I am saying it's not an appropriate alternative for g_man.
Re: Libwiisprite: writing text July 21, 2009 02:15AM | Registered: 15 years ago Posts: 444 |
Re: Libwiisprite: writing text July 21, 2009 04:37AM | Registered: 15 years ago Posts: 97 |
Re: Libwiisprite: writing text July 21, 2009 12:31PM | Registered: 15 years ago Posts: 405 |
Quote
g_man
I'll have a look at that. Libwiigui looks very powerful, but it was very hard for me to figure out what the program did, and how it worked by the docs, and example program. It has potenetial, but it needs more examples.
Re: Libwiisprite: writing text July 21, 2009 08:19PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: Libwiisprite: writing text July 24, 2009 07:04PM | Registered: 15 years ago Posts: 444 |
for(i=3;i<=dircounter;i++){ if(opendir(applist.getDir())){ // Good practice dp = opendir(applist.getDir()); while((ep = readdir(dp))){ //While there is a directory to read if (strcmp(strlower(ep->d_name), "icon.png")){ strcpy(path,applist.getDir()); strcat(path,"/icon.png"); applist.setPngDir(path); } } } } int x; int y; i = 3; for(y=30;y<480;y+=(48+30)){ for(x=28;x<640;x+=(128+25)){ applist.appimg.LoadImage(applist.getPngDir()); applist.appspr.SetImage(&applist.appimg); applist.appspr.SetPosition(x,y); manager.Append(&applist.appspr); i++; } }Code in my while loop
manager.Draw(0,0); Background.SetPosition(0,0); i = 3; for(y=30;y<480;y+=(48+30)){ for(x=28;x<640;x+=(128+25)){ applist.appspr.SetPosition(x,y); i++; } }
DIR *dp; struct dirent *ep; if(opendir("SD:/apps")){ //If the apps folder exists dp = opendir("SD:/apps"); while((ep = readdir(dp))){ dircounter++; strcpy(path,"SD:/apps/"); strcat(path,(ep->d_name)); applist[dircounter].setDir(path); } closedir(dp); } else { //If apps doesn't exist opendir("SD:/"); mkdir("apps",0777); exit(0); }
class appobj { public: //Accessor methods appname string getName() {return appname;} void setName(string name) { appname = name;} //hasdol bool getDol() {return hasdol;} void setDol(bool dol) { hasdol = dol;} //appdir string getDir() {return appdir;} void setDir(string dir) { appdir = dir;} //pngdir string getPngDir() {return pngdir;} void setPngDir(string pdir) { pngdir = pdir;} //coder string getCoder() {return coder;} void setCoder(string cod) { coder = cod;} //v_info string getVInfo() {return v_info;} void setVInfo(string vin) { v_info = vin;} //date string getDate() {return date;} void setDate(string dat) { date = dat;} //s_desc string getShortD() {return s_desc;} void setShortD(string sdes) { s_desc = sdes;} //appdir string getLongD() {return l_desc;} void setLongD(string ldes) { l_desc = ldes;} Image appimg; Sprite appspr; private: string appname; bool hasdol; string appdir; string pngdir; string coder; string v_info; string date; string s_desc;//Short description string l_desc;//Long description };I'm trying to print to the screen the icon.png of all the folders that have a boot.dol ,but all that happens is that the background color is there, and my wiimotes won't connect
Re: Libwiisprite: writing text July 24, 2009 07:52PM | Registered: 15 years ago Posts: 405 |
Re: Libwiisprite: writing text July 24, 2009 08:28PM | Registered: 15 years ago Posts: 444 |
Re: Libwiisprite: writing text July 24, 2009 10:50PM | Registered: 16 years ago Posts: 265 |
Re: Libwiisprite: writing text July 26, 2009 02:11PM | Registered: 15 years ago Posts: 405 |
Quote
g_man
Ok, I'll try that. The reason for 48+30 is that it makes more sense. I'm adding the width of the image(48) + 30, it is easier to understand
for(y=30;y<480;y+=(48+30)){ for(x=28;x<640;x+=(128+25)){ applist.appimg.LoadImage(applist.getPngDir()); applist.appspr.SetImage(&applist.appimg); applist.appspr.SetPosition(x,y); manager.Append(&applist.appspr); i++; } }
Re: Libwiisprite: writing text July 26, 2009 03:10PM | Registered: 16 years ago Posts: 1,012 |
Re: Libwiisprite: writing text July 26, 2009 06:48PM | Registered: 15 years ago Posts: 444 |
That is what i'm trying to do, I want to place 6 object in a row for each coloum, like a table in html.Quote
SteelSLasher
also, in this for loop the inner loop will run 3 times for every run of the outer loop which might cause something unexpectedfor(y=30;y<480;y+=(48+30)){ for(x=28;x<640;x+=(128+25)){ applist.appimg.LoadImage(applist.getPngDir()); applist.appspr.SetImage(&applist.appimg); applist.appspr.SetPosition(x,y); manager.Append(&applist.appspr); i++; } }
//Ready Image IMGBackground.LoadImage(background); Background.SetImage(&IMGBackground); Background.SetPosition(0,0);To before here:
for(i=3;i<=dircounter;i++){ if(opendir(applist.getDir())){ // Good practice dp = opendir(applist.getDir()); while((ep = readdir(dp))){ //While there is a directory to read if (strcmp(strlower(ep->d_name), "icon.png")){ strcpy(path,applist.getDir()); strcat(path,"/icon.png"); applist.setPngDir(path); } } } }And my wiimotes magically sync, but the images still don't show :(