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 / Drawing text with different fonts at the same time.

Author
Message
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 3rd Nov 2005 23:56
Hi ,

I am working on my game , I will post some screenshots next week.

I am trying to put some text on my screen with text command

But there is one problem.

when I use "set text font "Times",166 : set text size 14"
these commands everything changes to times new roman. Thats good.

But how can I Change at once to text with different font.

For example I want to write some digital fonts like LCD numeric
keypad with LCD fonts and on top of thing I write Credits with other font.

Can you understant what I mean. I have both truetype fonts.
But the "set text font" command changes everything on the screen.


Does darkbasic can draw some different type of texts with different
fonts in the same screen.

See my screenshot what I want to make.

Attachments

Login to view attachments
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Nov 2005 01:31
Thank you very much,
for no answer.
I thing I found how to put many types of fonts and charachter shapes at the same time.

Thanks again. I thing I am very newbie and I am in in an awful hurry to learn many things and recieve answers , very fast.




But no problem , some day I will learn good DarkBasic.
I am stadying.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 4th Nov 2005 06:30
Takis76,

Well, you do not have the best explaination in the world of what you are trying to accomplish. However, you simply have to reset the font everytime you need to. If you need font a for "Credits", then font b for the numerical values, then you would have to:

1)set text font to font a
2)set cursor location
3)print "Credits" to screen
4)set text font to font b
5)set cursor location
6)print numerical values to screen

This is straightfowardly how oyu have to do it.



+NanoBrain+
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Nov 2005 12:37
As NanoBrain said, but you may have to add a 'Sync' (or two) just before you change the font style (between items 3 and 4 on his list).

But, this is for DBC and seeing as you didn't say which version of DB you are using (doesn't anyone read the Stickies???), I don't know if this will work for you.

TDK_Man

NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 4th Nov 2005 16:18
TDK,

Why a sync between steps? As far as I understand, when a command to 'draw to the screen' is given, the bits for those graphics are written into video memory, and more are added and not displayed until sync is presented, or until automatic syncronization takes over.



+NanoBrain+
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Nov 2005 00:39
Quote: "Thank you very much,
for no answer."


try not to be sarcastic in not getting a reply in only 2 hours.
good people will avoid you if you display agression online.


usually making a series of images for use as textual data is a far better move then relying on standard text in dbc, this is a little different with dbp.

that said drawing text onto 3d plains if your game is 3d will dramatically improve performance.

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself 
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Nov 2005 17:42 Edited at: 6th Nov 2005 17:44
Quote: "Why a sync between steps?"


Yes, I know it sounds strange - and shouldn't be necessary, but I have found that sometimes with DBC it is - especially when placing text over a 3D screen, (when 3D is not used, I don't think there's a problem).

If you use different font faces and sizes on the same screen, sometimes odd things start happening. This includes 'flashing' where a single line of text appears in two sizes at the same place on the screen.

It's as though the Sync command is 'flipping' to the version of the text before it's attributes changed. I realise that this shouldn't happen, but for me at least, sometimes it does.

In these cases, I have found that adding a Sync just before changing the font size or face cured the problem. It's not something you always have to do - just when the problem occurs.

Actually, I hope I'm not the only one who's come across this problem!

TDK_Man

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 11th Nov 2005 13:29
Quote: "
try not to be sarcastic in not getting a reply in only 2 hours.
good people will avoid you if you display agression online.
"



I am neither sarcastic nor aggresive.
I wasn't wait for 2 hours , I was waiting 11 day for answer.

But there is no problem. I found my problem. I manage to have 2
font types in the same time on my screen.

I love all peaple here and I want to thank you all people here
for your help.

Look the image with digital fonts in my game.

Christmass ,I hope to have some demo , in english.







Thank you very much. I am not aggressive

I love good people who help me and all community here.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 11th Nov 2005 15:02
Quote: "Posted: 3rd Nov 2005 16:56 "


Quote: "Posted: 3rd Nov 2005 18:31"


I don`t know how you figure 11 days, but according to the forum your posts where just over one and a half hours apart, not 11 days as you said, it`s logged at the top of each post.



if there is one thing I can NOT tolerate, it`s intolerant people.
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 15th Nov 2005 10:18
Ok nevermind , Might be my Clock or my calendar.

I have post one more screenshot of my game do you like it?

Login to post a reply

Server time is: 2024-09-24 09:31:05
Your offset time is: 2024-09-24 09:31:05