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.

Newcomers DBPro Corner / The need to speak freely

Author
Message
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 13th Oct 2004 22:41 Edited at: 13th Oct 2004 23:13
Right i am in progress on a character based game thing using DBC and i've gotten to a point where i need some real smarts. I've tried every way i can think to do this... How can i get it so if you press a button a message appears on screen for a little while and then disappears?? i am meaning in the way that messages come up in resident evil you know like when you stand next to something and press a button it gives you a discription at the bottom of the screen and you have to press a button to make the message go away.... Any ideas?? PLEASE!!

I can see from your smile, you're not here for the sunset.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Oct 2004 00:23
1. Button Pressed - set MyVar to Timer()
2. If MyVar > 0 and message hidden, show message
3. If Timer() > MyVar + 5000, reset variable to 0, hide message

(5000 = 5 seconds)

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th Oct 2004 01:26
A couple of functions would keep things neat, like one for creating a text box, and one for updating it. For example, say you have 2 globalised variables, tbox_time and tbox_text. You could make a function to set these variables and get the box working:

Function make_tbox(t$,tm#)

`Set the tbox_time to tm# in seconds after the current timer
tbox_time=timer()+(tm#*200)
tbox_text$=t$

Endfunction


Then in your main loop:

If tbox_time>timer() then tbox_update()


And the update function:

Function tbox_update()
center text screen width()/2, screen height()-16,tbox_text$
Endfunction

With a system like that you only really need to worry about the creation function, the updating would be done already, you'd just call the create function with the required text and time in seconds to show it for.


Van-B


Muhahahahaha.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 14th Oct 2004 01:45
Van B

would that work in 3d space? i don't know how to intergrate it into a program, sorry i am a little bit useless at this..

I can see from your smile, you're not here for the sunset.

Login to post a reply

Server time is: 2024-11-27 13:01:48
Your offset time is: 2024-11-27 13:01:48