Hello Everyone
I going to give GLBASIC Second chance and give a try :)
GLOBAL BACKGROUND=0
LOADSPRITE "picture.PNG", BACKGROUND
FUNCTION SHOW_BACKGROUND:
DRAWSPRITE BACKGROUND, 100, 100
ENDFUNCTION
SHOW_BACKGROUND()
SHOWSCREEN
MOUSEWAIT
END
What wrong with the code as it saying
"MYFIRSTPROGRAM.gbas"(31) error : command not inside function or sub
Hi Hotshot,
try placing the function after the function call:
GLOBAL BACKGROUND=0
SETSCREEN 640,480,1
LOADSPRITE "picture.PNG", BACKGROUND
SHOW_BACKGROUND()
SHOWSCREEN
MOUSEWAIT
END
// This is your function
FUNCTION SHOW_BACKGROUND:
DRAWSPRITE BACKGROUND, 100, 100
ENDFUNCTION
Cheers,
P.
Thanks Poetronic =D I love Functions because that where I can break small code down into :)
Hey Hotshot, guess we were reading the same thread on the Blitz forums ;) I had bought GL years ago when they first came out with iPhone support and never really used it much. I moved over to Corona for awhile and then I have been using Monkey. Like you, just thought I would give it another shake.
Welcome back, dont hesitate to ask any questions if need be. :)
Thanks guys :)