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 / here's a new one how do you make it blink?

Author
Message
HowDo
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 29th May 2005 23:46 Edited at: 30th May 2005 00:41
Hi aLL,

Found lots in the forums on how to stop a cursor blinking now i want it to blink, hers what I have so far.
Cann't seam to get the timeing right.


I'm not getting you down am I, Ho Look! another fancy Door?
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th May 2005 00:28
Personally, I would'nt spend too much code on this - I mean a simple randomisation can look fine.

Like say your text is stored in i$, when displaying it:

Text 0,0,i$+mid$(" _",rnd(1)+1)

So it just puts a '_' at the cursor position randomly.

I'm not sure why you have that 8,000,000 for the timer, the timer is only 200 units per second, so for a 1 second interval you'd use 200 units per blink.


Van-B

HowDo
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 30th May 2005 00:31
cheers I 'll try that, when you put the timer value like that it dose seam a bit big.

I'm not getting you down am I, Ho Look! another fancy Door?
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 30th May 2005 02:44
I read this post then went and found some old dbp source of mine, I used this to do perfectly timed cursor blinking using | as a cursor for text input:



Txt is a string containing the text the cursor needs to be placed at the end of, the rest is just me calculating the position of it in my menu.

Anyway, I didnt think up the code myself. I used to use a different method but it wasnt perfect and one day someone was looking through my source code because they were interested in the game and they saw it and told me about this way. Apprantly, and I just have his word for it, this is the "technique and values that windows uses to place cursors in text boxes". Dunno if it truely is the way windows does it, but it does work well

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
HowDo
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 30th May 2005 03:29 Edited at: 30th May 2005 03:31
Wow! what away to do it would never thought of doing that way here its with a nice steady blink.

Cheers Sephnroth



looks like a neat way to count to 100 or more!

I'm not getting you down am I, Ho Look! another fancy Door?
Metel Artz
20
Years of Service
User Offline
Joined: 13th Apr 2005
Location: Vermont USA
Posted: 30th May 2005 11:31
i gots a question on the cursor, why does it when you right something in an input, it has an underline on every 2nd letter??? how do i change that???

goto my site at metelartz.com <<its da bomb except the one your at now. he he
HowDo
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 30th May 2005 18:06
Metel Artz not sure what your question is about or who its aimed at?

however I have now got the code up to a point that now lets you move the cursor to the left of the text but no input at that point.

anyone see how I can input a new leter at the point of the cursor position.

cheers



I'm not getting you down am I, Ho Look! another fancy Door?

Login to post a reply

Server time is: 2025-06-05 18:59:09
Your offset time is: 2025-06-05 18:59:09