Hi everyone, im new to glbasic (only came across it last night) I'm trying to load a sprite (.bmp format) and it works fine on windows but doesnt load on my GP2X (f-100) I thought it might be a problem with my code so found a game off the site here which loaded sprites and tryed running that. That game also had the same issue. Is there anything i'm doing wrong? Does the format i have the sprites saved in cause the problem? I'm running the latest version of glbasic and my GP2X has firmware 3.0.0 installed. any help would be much appriciated!
Hi,
is the path (of the sprite) correct?
try this:
PRINT GETCURRENTDIR$(), 0, 0
SHOWSCREEN
KEYWAIT
to get current_dir
Try to get the latest update using web/internet update.
If it still exists, see if the bmp file is in the same folder as the .gpe file. Can you print text?
PRINT "Hello ", 0,0; SHOWSCREEN; KEYWAIT
See if you spelled the bitmap name correctly. (Upper/lowercase issue, maybe?)
it is pointing to the correct directory i've just checked now with your code. The thing is that this issue is also occuring on a game i downloaded from this site which said it could be compiled for GP2X. However i did have to change some of the syntax to get it to work ( SPRITE to DRAWSPRITE)
I also have the latest update from the web thing and it will display text fine and also using the drawrect command is fine its just sprites that arent displaying
- do you see only "a blackscreen" or is something else apparent?
- have you tried another graphic-file? (another bmp)
- Which graphic-program has created the bmp-file ? are some other options allowed (other colordepth)
- can you upload your graphic-file to some webspace-provider?
well my game is 100% sprites at the moment so yes i only see a black screen with the demo logo which is counting down. i created the bmps in MS paint witha bit depth of 24. I have tryed multiple graphic files all with the same result. I will try and upload the image file to a host later this evening (no time now). Thanks for all your help so far and hopefully we can find a solution!
Did you put them on the SD card or in NAND? Try SD card, please.
they're on the SD card, i haven't tried running from NAND
I had a similar problem not to long ago - I had to change the format of the images. unfortunately I can't remember what i changed em to :(
png?
changing the sprites to .png doesnt make any difference on the GP2X. When i build for the PC though the pink colour is no longer transparent. I also tryed gif and jpg and still have the same problem on the GP2X and now also the same issue on the PC.
this is the code for my game (perhaps i'm doing something wrong?) :
// --------------------------------- //
// Project: Pilot
// Start: Tuesday, January 01, 2008
// IDE Version: 5.110
// DEMO-VERSION:
// Missing features:
// No time limit during gameplay
// No watermark in executables
LET xpos = 7
LET ypos = 150
LET sx = 270
LET sy = 210
LET win = 0
LOADSPRITE "star1.bmp" ,0
LOADSPRITE "hele1.bmp", 1
LOADSPRITE "map1.bmp", 2
main:
GOSUB show
IF win = 1
KEYWAIT
IF KEY (29)
xpos = 7
ypos = 150
win = 0
ELSEIF KEY (58)
END
ENDIF
ELSEIF win = 2
xpos = 7
ypos = 150
win = 0
KEYWAIT
ENDIF
GOSUB move
GOTO main
MOUSEWAIT
END
// ------------------------------------------------------------- //
// --- MOVE ---
// ------------------------------------------------------------- //
SUB move:
FOR num=0 TO 1
IF KEY (200) THEN ypos = ypos - 2
IF KEY (208) THEN ypos = ypos + 2
IF KEY (205) THEN xpos = xpos + 2
IF KEY (203) THEN xpos = xpos - 2
NEXT
//collisions
IF SPRCOLL (2, 0, 0, 1, xpos, ypos)
PRINT "FAIL! X TO RETRY", 75, 130
win = 2
ENDIF
IF SPRCOLL (0, sx, sy, 1, xpos, ypos)
PRINT "WIN! X TO RETRY, Y TO EXIT.", 75, 130
win = 1
ENDIF
ENDSUB // MOVE
// ------------------------------------------------------------- //
// --- SHOW ---
// ------------------------------------------------------------- //
SUB show:
DRAWSPRITE 2, 0, 0
DRAWSPRITE 0, sx, sy
DRAWSPRITE 1, xpos, ypos
SHOWSCREEN
ENDSUB // SHOW
cutted some code above and at end....
......
ELSEIF win = 2
xpos = 7
ypos = 150
win = 0
KEYWAIT
ENDIF
........
i'm at work and cannot test, but is your programm hanging on that keywait ?
OT (Gernot):
Warum funktioniert Fettdruck nicht? (ich habe das Keywait mit (b) (eckig statt runde klammer) fett makiert??
shouldn't be as i've been mashing the buttons when it doesnt load so i'm sure i would have passed the keywait.
OK, I tried on GP2X and mine works.
So, we have aproblem here.
- Please zip the complete project (or a small one illustrating the bug)
- Include the .gpe with your zip file
- Upload + Share here
- Tell me your GLBasic version number (Menu "?/Info")
- Do you have an F100 or F200 GP2X?
- Stay calm, there's nothing we can't fix.
I checked my recent GP2x code and i use the following :
LOADSPRITE "./1st_exit.png" ,7
it was important to use the ./ at the start so it knew the images were in the same directory as the program - or if you have them in a subdirectory it would be ./subdirectory/picture.png
hope this helps
what!? the ./ is required now? In GLBasic? It should now.
Quote from: GernotFrischwhat!? the ./ is required now? In GLBasic? It should now.
What can i say, I had to do this to get my code working on my 2x.
Quote from: saboteurI checked my recent GP2x code and i use the following :
LOADSPRITE "./1st_exit.png" ,7
it was important to use the ./ at the start so it knew the images were in the same directory as the program - or if you have them in a subdirectory it would be ./subdirectory/picture.png
hope this helps
Briliiant! I made that change and now it works perfectly! Thanks so much!!
OK, then it's a bug. Strange, but I'll fix it.
So "./" isn' t required anymore, yes?
no, it should not. And I never used it and it worked for me.
Fixed. The gmenu2x might have put you in the wrong place as default directory.