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 Discussion / Cant set tex size

Author
Message
Cant Resize text
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location:
Posted: 21st Sep 2008 07:13
I am new to Dark basic and am having problems setting th text size here is the code i've used

set text font "Arial"
set text size 24

Input "Please Enter Your Name....",Name$
Input " Hi ", name$, " Now Please enter the year you were born ", year
age = 2008 - year
weeks = age * 52
days = weeks * 7
hours = days * 24
minutes = hours * 60
seconds = minutes * 60


Print "Glyn you are now ", age
Print weeks, " Weeks"
Print days, " Days"
Print hours, " Hours"
Print minutes, " Minutes"
Print seconds, " seconds"
Print " Old"

end
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 21st Sep 2008 13:26
The 'Set text size' command only works if you use the 'text' command. It has no effect on the 'print' command.
So what you need to do is to do it change the 'print'commands to 'text' commands.
The text command takes three inputs: x position, y position and text$. The text$ is a string so it can't take a numeric variable (like your 'age' variable). What you need to do is change it to a string using the str$() command.

So instead of:

use


If you want more info, look in the darkbasic help section for the text command or go to TDK's tutorials


"To succeed is not enough, others must fail" - Gore Vidal
Robert The Robot
18
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 22nd Sep 2008 12:59
Something else to bear in mind if you're in DB 1.20, the command

should actually be written as

otherwise you lose control over the text sizing.

(The "1" controls the character set, older versions of DB defaulted to this value if it wasn't specified but in 1.20 you have to specify it for yourself.)

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Cant Resize text
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location:
Posted: 9th Oct 2008 12:03
Thanks A lot for the help but I also want to use the ytext command to print an input called name$ i have tried many things but no can do.

Thanks in advance
Glyn

Login to post a reply

Server time is: 2025-06-07 06:54:52
Your offset time is: 2025-06-07 06:54:52