I have a problem.
My first progras is for load an sprite and draw at screen, but it don't draw at screen :-(
The code is:
LOADSPRITE "mario.bmp", 1
DRAWSPRITE 1, 100, 100
SHOWSCREEN
MOUSEWAIT
When I compiling the code it's ok no problema Build sucessed , but the screen is Black and don't look the Sprite in the screen.
The sprite image is BMP format
anybody can help me ?
Thank's
Do you use the command
SETCURRENTDIR("Media")
before?
If not, do it and put your image into the Project - "Media" folder.
cheers
Ahh
Ok
Thank You , Very Much
:-)
You´re welcome! ;)
Or, even better, use :
LOADSPRITE "Media/mario.bmp", 1
Why do you think it is better, MrTaToad? :)
It´s more text to write, when you have thousand of sprites *g*
Both methods work fine for what your needs are. I think giving it the path to the folder might be better so you know where that Sprite or file is coming from and so you don't have to run code to switch different folders when you need to load additional resources.
It's really more of a preference thing though.
I dont like using SETDIRECTORY in case you have files in different directories from the one that you select.
It is quite possible (and legal) for the command to fail too...
QuoteIt´s more text to write, when you have thousand of sprites *g*
In that case you would use an array
I have a problema, i need writed 3 animations, but when i write for example
WHILE TRUE
cont=cont+1
if cont>10
s=1-s
cont=0
DRAW SPRITE s, 100,100
SHOWSCREEN
WEND
when compile my code then get this mesage (23) error : variable is not explicitly defined cont etc
can your help me?
//if you have enabled "explicit variables" in the project options you have to DEFINE your variables before using as LOCAL or GLOBAL
LOCAL cont
LOCAL s
WHILE TRUE
cont=cont+1
if cont>10
s=1-s
cont=0
DRAW SPRITE s, 100,100
SHOWSCREEN
WEND
Just an additional note, regardless of what it does that code is missing ENDIF and DRAWSPRITE is one statement.
That´s right :good:
Early in the morning :whistle:
¿Where is the project options for define the variables?
Quote¿Where is the project options for define the variables?
PROJECT-> OPTIONS -> [ ] EXPLICIT DECLARATIONS (untick the box)
It is worth noting that if you turn them off, then spelling errors etc. in your variable names will not be identified, potentially causing you time to find where the mistakes are when something isn't working.
Ahh Ok Thank you
I'm sorry but I'm begginer at GLBASIC :-(, I saw
No need to apologise for being a beginner - we were all beginners once, and we are all still learning :)
A forum without questions would be pretty boring.