today I have trouble to get that command to work, becuase I have no clue its have open the shoebox file or not.
I did that:
- I have a Media/gpx folder that contain all graphics.
- I shoebox that graphics folder and give the result as Media/gpx.sbx.
- I rename the Media/gpx folder to make sure its use the showbox (as testing).
- I trying to set it with SETSHOEBOX "gpx.sbx", "gpx.sbx", but no path, because its allready is open in the Media folder.
When I so LOADSPRITE or such mean, then its failed.
I have also subfolder with some medias (no filename use same name, since I are aware of subfolders not supported) and path using is the same (which its should have removed anyway). But I do more concern how to check, if the SHOEBOX really have been set or I have used some sort wrong path or something with that. So its would been nice its its could return a error as well STOUT which path/file$ its tried to open. Then its would been much easier to debug.
So its might not been a bug in SETSHOWBOX directly itself, but more I want some more ERROR info what its tried.
What platform are you using ? It works fine with Windows, Linux and Android, and should work on alll other platforms too
Also works fine on webOS, Wiz and Pandora.
windows 7.
I pretty sure it's somewhere path issue or filename issue, but I just want some error report if path not exits or file found. Pretty sure it's a somewhere path issue and I just see what it's try to open.
I just wonder what it's happens here and why it's won't open....
Yes, I did mention that it would be nice if DOESFILEEXIST could be used with Shoebox files : http://www.glbasic.com/forum/index.php?topic=5465.msg42816#msg42816
In debug mode it should complain. No?
I recently tried using the shoebox win Win32 and I had troubles also.
its look like SETSHOWBOX simply just fail to open the file, but no error report happens, so hard to tell why.
Try again later if I got something using debug (neary allways on, but mean I have never seen a output.
I pretty sure its somewhere a path, filename and/or formatting issue that is not correct (etc I use / and not \), and I have no spaces in directories.
Its mightbeen happens recentely as well. So later I try to cleanup the project (could been cool to possible clean up the temp directly from IDE) and see what happens.
Perhaps you are trying it with a format SHOEBOX wont deal with - JPEGs for example
its dosent open SHOEBOX at all, elsewise I would notice if jpg was missing (only floor in Greedy Mouse is jpg format, rest is in png format). By now I juts use scrampled file by now.
Still not tested why its not open the file, what its really tried due no debug about it.
What platform are you trying it on ?
allready wrote that, 64bit Windows 7 and on D: drive.
I invistate later today or tomorrow owhat really happens (im not time yet to checkout). Im still pretty sure is a path issue or some sort of that. I'm not using SHOEBOX at the top, but more when a graphics is loaded. But I did tried to the top without succes.
I'm pretty sure when its first got it open the SHOEBOX file, its would run as its should (even with missing jpg, its a minor thing).
I cleaned the project (emptied %TEMP% folder) and tried again. Its still not open it and all files returned 0 with GETFILESIZE, so its still seen its not have open it at all.
I have tried both relative as well fullpath, and even tried something like this without sucess:
SETSHOEBOX "d:/gpx.sbx","d:/gpx.sbx" (as well only used DATA argument).
So I must say I cant get shoebox files to work on Win32 64bit. Still not tested same happens on other platforms.
Howover its try to open jpg files first, when its a aware bug, but its does on png files at well. Nothing is open at all.
Just a quick question, did you "shoebox" the Media folder or the Media/gpx folder, or no folder at all ? Are you including the folder names in the path to the shoebox ? Is the shoebox in the media files (if you have SETCURRENTDIR("Media") ... or whatever folder you are using) ?
QuoteIts still not open it and all files returned 0 with GETFILESIZE
Then the file doesn't exist or you are looking for the wrong file...
This works perfectly well with my Windows 7 x64 :
DEBUG "File Exist : "+DOESFILEEXIST("Media/Media.sbx")+"\n"
SETSHOEBOX "Media/Media.sbx","Media/Media.sbx"
LOADSPRITE "untitled.jpg",0
LOADSPRITE "untitled.png",1
SETSHOEBOX "",""
DRAWSPRITE 0,0,0
DRAWSPRITE 1,256,256
SHOWSCREEN
KEYWAIT
It doesn't show the JPEG file, but it does with the PNG file
I've included my project so you can try that one.
[attachment deleted by admin]
I found what it happens, and its a glbasic bug.
Its happens when you use it together with GENSPRITE(), then its will fail to open the file. There is nothing wrong with SETSHOEBOX its self, but its more LOADSPRITE and other commands that use it.
Here is the code that fail to work:
DEBUG "File Exist : "+DOESFILEEXIST("Media/gpx.sbx")+"\n"
SETSHOEBOX "Media/gpx.sbx","Media/gpx.sbx"
LOCAL a=GENSPRITE() // <- that trick the bug.
LOADSPRITE "gffd/untitled.jpg",0
LOADSPRITE "fhjjfcb/untitled.png",a
SETSHOEBOX "",""
DRAWSPRITE 0,0,0
DRAWSPRITE 1,256,256
SHOWSCREEN
KEYWAIT
Greedy Mouse is heavy based on GENSPRITE(), so that is why its failed to get working correctly with SETSHOEBOX.
There is a slight problem with your code. As today's exercise, I'll let you find out why nothing is being display. Will give you one clue though : GENSPRITE values don't start at 0 :)
yes there was a spelling, ups =D, but its still not work in Greedy Mouse as excepted. Its can open fine (images shown) directly, but still not when using them using regular code. Strange. Its might been somewhere SETCURRENTDIR issue or something like that (even SHOEBOX is open fine and keeps that before using that command). I look future what happens.
But somethings more compliced.
here is a screenshot: (yes the REPLACE part is a bit messy, but irrerevent here).
I'm are not trying to load a file here in this test, only trying get thier GETFILESIZE (jpg should fail, not png):
(http://dl.dropbox.com/u/3236515/GreedyMouse/strangeshoebox.png)
EDIT: I did not shown the full path on the second Explore, buts its was correct. Graphics folder was renamed after the shoebox test.
EDIT2: I'm still not 100% sure what happens (its NOT GETSPRITE(), its was a silly mistake, hehe), but something other conflict).
I don't think GETFILESIZE works with shoeboxed files...
Could you just use 'DOESFILEEXIST()' instead?
It looks like you're just checking to see if the file exists by seeing if the size is > 0.
its that.
its GETFILESIZE(), which I meants its have works before (but was long time ago), also DOESFILEEXISTS() not either. And yes I just used GETFILESIZE() for file exists check, since I first noticed doesfileexists recently, propterty because both do the same job really (what I used them for here).
So its turned to just been a missing feature, not a bug.
Sorry if I sound negative og aggresive, that was never intendend, but also thanks for all help.
Its now 100% totally to Gernot if he want to add those missing features to v11 :).
EDIT: Renamed to more precision title.
Yes, DOESFILEEXIST doesn't work with Shoeboxes :)
If you want to make sure a sprite has loaded, check it's size... If it's 0 then there was a problem...