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 / Highlighting text

Author
Message
Alkerak
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 21st Aug 2012 18:23
I'm trying to make a menu system using simple text commands. However I want the menu to not have an arrow of some sort but I want some highlighting. For example a white text on a black background, if it would be selected it would have a white box around it and black text. I know how to make this, however, each menu option has a certain "length". "Start Game" is bigger in length then "Yes". How do I find out the exact coord length of each menu text in order to fit my box around it?
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Aug 2012 18:40
If it's a Fixed Width Font you have...

String length * width

Then just add room for the box.

Alkerak
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 21st Aug 2012 19:15
Thanks, worked, did it with

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Aug 2012 09:54
Otherwise it's already built in to the ink command. Here's an example (thanks Valentine!)



TheComet

"if you don't understand recursion than you probably don't understand recursion." ~Jerico2day
Alkerak
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 23rd Aug 2012 10:51
Hey

Works also with that.

Thanks
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Aug 2012 11:14
I think I had an example that highlighted variable-width fonts. I'll have to dig it up.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Aug 2012 14:17
Thanks TheComet

I was going to mention that very method



Login to post a reply

Server time is: 2026-07-21 20:34:35
Your offset time is: 2026-07-21 20:34:35