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.

Author
Message
ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 26th Apr 2011 17:33
Hey, I need to create a in game menu where the previous background continues to be drawn while the in game menu is being used. Any help is appreciated.

Sam
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Apr 2011 18:27
You could just save a screenshot and paste the image before you draw your menu each loop.

Grab a screenshot like this:


Westmere
16
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 26th Apr 2011 19:59
I'm not sure if I understand you correctly.

Here are some hints into that direction:

You can use PNG images to draw semi-transparent buttons. With them you can continue your main drawing routines and just paint the buttons on top - if you use 3D objects you might want to use Draw To Front. Alternatively you can use sprites for this.

If that's not what you meant you might need to elaborate a bit.

ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 02:27
The game is 2D and uses nothing but BASIC2D drawing commands with math. I wanted to take the 2D drawings and text at the time the in-game menu is called and save them to an image, where I would paste the saved image and then render the menu. Sorry for not elaborating Westmere.

Thanks baxslash, that's exactly what i'm looking for. One concern through: How would lower the contrast and brightness of the saved imaged, in order to prevent the in game menu being hard to read?
ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 03:46 Edited at: 27th Apr 2011 03:51
I got the error: Runtime error 502 - Image does not exist at line 68 . Help please!

The attachment is of the Background.jpg

Here's the code i'm using to create the in-game menu:

Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Apr 2011 03:59 Edited at: 27th Apr 2011 04:16
Quote: "I got the error: Runtime error 502 - Image does not exist at line 68 . Help please!"


Change this:


To this


Change your InGameMenu_Data: subroutine to


And change your "precondition" to


You were calling your pause menu before the picture was even created . We changed the precondition because you were taking the image of the screen while your background.jpg wasn't even pasted (because of the CLS)

ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 04:04
AWESOME! Thanks hockey kid!

LOL. I'm going to take a nap, i'm not thinking in ORDER.
Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Apr 2011 04:15
Quote: "AWESOME! Thanks hockey kid!"

No problem, I've taken a dew minutes to fix up your code a bit.




baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Apr 2011 10:27
Quote: "How would lower the contrast and brightness of the saved imaged, in order to prevent the in game menu being hard to read? "

There's a few ways to do this. Funnily enough I'm working on one for a game I'm working on.

One way is to paste a semi-transparent sprite over the whole screen before you paste your menu but after you paste the screenshot (make an image in GIMP just one pixel in size and stretch it as a sprite is how I do it)

You could use the image kit to de-saturate the image (make it greyscale) or perform other effects on the image using a shader...

There must be thousands of things you could do with the image once you have it... have fun

ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 27th Apr 2011 15:08
Thanks baxslash. I'll start researching.

Login to post a reply

Server time is: 2026-07-11 12:20:50
Your offset time is: 2026-07-11 12:20:50