LoadMesh=False?
Blitz3D Forums/Blitz3D Beginners Area/LoadMesh=False?
| ||
I seem to have a bit of a query concerning the inclusion of a Full Screen Mode option in my game (well, by game I mean title screen, seeing as that's all I've got of it at the moment.) I've got the functions FullScreenMode() and QuitGame() as part of a seperate .bb file, and when you press the buttons associated with them they do as they say. When I press FullScreenMode though, the function seems to discard all of the coding that existed before they were called from - before that specific point is where my LoadMesh options are kept. Big problem. This is a bit of a quick fix at the moment but until I get to grips with how to organise my game programs properly, I was wondering if there was an ability to jump to a Goto label thingy from a function that's called from one .bb file, to jump to the label in another .bb file? Or is that not possible? Well, I dunno how much sense I'm making so I'll post the code. I'm leaving out the beginning and end bits because I know they don't have any affect on the problem I'm having: vartimer# = 0 .goat Camera = CreateCamera() CameraViewport Camera,0,0,GraphicsWidth(),GraphicsHeight() AmbientLight vartimer,vartimer,vartimer FPS = 50 period = 1000 / FPS time = MilliSecs () - period Sun = CreateLight(AmbientLight) LightColor Sun,-127,-127,-127 ; Spinning, floating Ymiraldor in the background. Ymiraldor=LoadMesh("Models/Items/YmiraldorObject.x") ScaleEntity Ymiraldor,.17,.17,.17 MoveEntity Ymiraldor,0,-4,19 ; The eerie background scene with veins and a little pedestal type thing. scene=LoadMesh("Models/Items/titleScene.x") ScaleEntity scene,.09,.07,.09 MoveEntity scene,5.5,-4,29 RotateEntity scene,0,10,0 ; Giving the landscape a dark turquoise colour so it at least shows. ;EntityColor scene,0,96,48 scenetex=LoadTexture("Models/Items/ymirtex2.jpg",3) EntityTexture scene,scenetex ;EntityAlpha scene,0.184 ; Title screen. title = LoadSprite ("Interface/title.png", 48, Camera) ScaleSprite title, 9, 5 PositionEntity title, 0, 2, 10 titleAlpha# = 0 EntityAlpha title, titleAlpha showtitle = 1 steps# = 1.5 HidePointer ; Idle time - when the title screen is running properly and is waiting input from the player. Color 0,192,128 music=PlayMusic("Audio/Titlescreen.mid") ;If Not music Then RuntimeError "Music failed to initialise, so the game will close." ChannelVolume music, 1 Repeat FullScreenMode() QuitGame() TurnEntity Ymiraldor,0,0.5,0 If vartimer < 140 vartimer = vartimer + 0.5 AmbientLight vartimer, vartimer, vartimer If KeyHit(28) Then titleAlpha = 1 EndIf EndIf If vartimer => 140 If KeyHit(28) Then titleAlpha = 1 EndIf EntityAlpha title, titleAlpha If titleAlpha < 1 titleAlpha = titleAlpha + 0.02 EndIf EndIf UpdateWorld RenderWorld If vartimer => 140 Then SetFont titleFont Text (width/2),380, "Press Enter to Continue",1 SetFont copyrightFont Text (width/2),460, "©Stable Productions 2004. Game by Jon Davies.",1 If KeyHit(28) Then Goto optionScreenFront EndIf EndIf Flip Forever And this is from globalfunctions.bb, which is where this .bb file is calling the function FullScreenMode from: Function FullScreenMode() ;Switch to Fullscreen Mode If KeyHit(59) If mode=1 Then mode=0 Graphics3D width,height,depth,mode Else mode=1 Graphics3D width,height,depth,mode EndIf EndIf End Function You can see early on in the first blob of coding a label called "goat" - that's the label I wanted to jump to, from the function FullScreenMode() . Of course, when I go ahead and just try it, it won't find it. Soo.. yeah. Please don't shout at me if I'm horribly inefficient with coding. I'm usually around fragile glass objects and I jump easily. I just would like to know how I could remedy this problem I seem to be having.. |
| ||
When you change screenmodes, all entities, textures and images are flushed out. The only way around this DirectX problem, is to reload everything after a mode change. |
| ||
I was afraid of that. So being able to change mode during the middle of a game is impossible? |
| ||
Well, not impossible, but the only way around this DirectX problem, is to reload everything after a mode change. But let me tell you - you don't want to change modes in the middle of a game. You might think you do, but actually, you don't. It's just not done. Once you saw it happening, you'd realise how terrible it looked, and you'd take it out again. |
| ||
Fair enough then. Thanks for the help. :D |