Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Changing resolutions messes with my sprites

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th Aug 2011 16:09
Hi all,

When I change resolutions mid-program using the "SET DISPLAY MODE" command, my sprites don't exist anymore... Is this normal? Here's an example of the code:



The above code will crash, saying that the sprite doesn't exist, but if I remove the SET DISPLAY MODE line, it works perfectly... Any ideas how this can be fixed?

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Aug 2011 17:14
Yeah everything gets cleared when we use SET DISPLAY MODE so any image, sound, and music we load need to be reloaded and every sprite recreated.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th Aug 2011 17:46 Edited at: 13th Aug 2011 17:47
Oh my god, serious? That sucks balls... Thanks for letting me know though.

So there's no way to change resolution mid program without consequences like that?

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Aug 2011 21:01
Yup... but if you have it all in a setup routine or function it's easy to redo everything before trying to use anything that was cleared.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 14th Aug 2011 02:37
Not with the complexity of my game thanks for the help. I'm off to write a launcher app!

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
wickedly kick it
19
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 14th Aug 2011 08:13
Quote: "Not with the complexity of my game thanks for the help. I'm off to write a launcher app!"


A game,no matter how complex, should have some basic functions for setting up and unloading resources when needed. Even a small project should be a reusable function of some sort just to make everything easier for you. For example, my pong game used 30+ functions. One would create and load the sprites, the others would check for collision and scores. Just work on your habits now and it'll make your programming life a ton easier

Login to post a reply

Server time is: 2026-07-10 08:28:03
Your offset time is: 2026-07-10 08:28:03