Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 get command in font.new/draw
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Michael




PostPosted: Wed Sep 27, 2006 8:40 pm   Post subject: get command in font.new/draw

hey people

you know the usually get command...
get name lets say.. when you type it in, it types it in that small turing font

how do i incorporate the get command into a font? is it even possible? i know it is possible to output variable in font.. but is it possible to get?

thanks in advance
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Sep 27, 2006 8:57 pm   Post subject: (No subject)

you'd have to turn echo off, so that anything you type in is not printed to the screen. Then you getch() one character at a time, and echo the letters out yourself using Font.Draw. You'd have to handle special cases, such as backspace, but this question has been answered before, and there is source code available for this. You'd just have to find it.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Wolf_Destiny




PostPosted: Wed Sep 27, 2006 9:04 pm   Post subject: (No subject)

I'm not sure that you could do it with a simple Get.UsingNiceFont command, however programming is nothing if not problem solving. So let's look at this:

get -> uses a standard font to give a variable a value.

More specifically if outputs the characters being typed by a user, one by one, and then when [enter] gets pushed, it finishes up by "adding" the characters together.

So, what needs to be done is that the characters need to be outputted differently. But there's no convienient way to do so (that I know of at least, jeez if there is....Anyways...) so we must make out own! (I'm probably going to make this a predef file, or an included one, or something. Yay! Usefull uses for compsci class!)

So first off, I would recommend creating a program that will use "getch" and a loop that will take characters one at a time, and add them to a string, moving the cursor one column to the right each time. If it gets a backspace character (use ord) then it takes off the last one, and moves the cursor one space to the left. If it gets an enter character then it finishes up.

Try that, I check the forums about daily - basically whenever I check my email - I just don't post much. So if you can't think of a way to do it, or you have trouble, just post with a question! I'm sure you'll get a few more responses as well. Unless people think I did a good job with this post. The reason that I'm not simply giving you the code is that if you do it yourself then:
A) You did it yourself and can say so
B) You learn from the experience
C) See A) and B) mostly B) though

I've got a notepad-like program that I had to do this for, I just didn't think of the whole font thing. Something to try tomorrow in class.

Good Luck
~SL
do_pete




PostPosted: Thu Sep 28, 2006 8:03 am   Post subject: (No subject)

Here is one solution to this problem.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: