Image Handles

Blitz3D Forums/Blitz3D Beginners Area/Image Handles

pexe(Posted 2005) [#1]
My game is splited in 2 files.. the main menu and the game.. the game calls a main menu fucntion.. and when this function is returned.. i just endgraphics and set the graphics again. to the game start..

And when a i hit Escape.. end graphics, graphcis.. and the Main menu is back.. but when i come back to the game.. my handles are switched.. eg. my top image is my bottom image..

2 SS

Game running normaly


After i hit escape


Anybody can help me?


Ross C(Posted 2005) [#2]
I don't quite understand what your saying? Can you be a bit more specific?


pexe(Posted 2005) [#3]
Well, my english is BAD! =P

Trying to explain again..

I have a function that show the Main Menu, right?
And, my code looks like this

repeat
graphics 800,600,16,2
Main() ;function that calls the main menu

graphics 800,600,16,2
Load() ;Load images, sounds, etc
While not key hit(1)
wend
forever

When in the main menu i click in START GAME i have the following code
endgraphics
return

It means.. that i End my graphics (free everything, i think..) and after create a new graphics to load game images...

Ok, now i have the problem.. when START A GAME and hit Escape.. my game return to the main menu.. but when i click in START GAME again.. my images handles are switched.. (look at the top image).. i don't know why...

Easy to understand now?


Ross C(Posted 2005) [#4]
It looke like you have a variable controlling the cards, or what ones are displayed, and you are not reseting it. Make sure you have code that changes all your variables back to there previous values.


Rook Zimbabwe(Posted 2005) [#5]
endgraphics???

Do you mean ClearWorld() ???


Ross C(Posted 2005) [#6]
He's not using 3d :o) End graphics should clear all the graphics in use.


pexe(Posted 2005) [#7]
Ross C, thanks man..

Now it's working.. =)


Ross C(Posted 2005) [#8]
No worries :o)