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

Username:   Password: 
 RegisterRegister   
 Draw.Text and Get command
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
blarg0123




PostPosted: Sat May 01, 2010 11:51 pm   Post subject: Draw.Text and Get command

What is it you are trying to achieve?
Draw out the letters one by one as if the user was typing while he/she input a name into the program


What is the problem you are having?
No idea where to start


Describe what you have tried to solve this problem
Nothing so far...


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


get name:*
Draw.Text (name, 100, 100, font1, brightblue)



This code just draws out the variable after the user finishes typing the name and hits enter. What i want to do is to draw the letters while the user is typing

Please specify what version of Turing you are using
Newest version, forgot which though
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Sun May 02, 2010 3:39 am   Post subject: RE:Draw.Text and Get command

Draw one letter at a time, using a separate command for each letter. Put a delay ( number-in-milliseconds ) between the calls to slow it down. If you want to be crafty, you could make a procedure to do this that takes the string to print, the location to print it, the font / colour to use, and the speed to print at.
BigBear




PostPosted: Sun May 02, 2010 6:42 am   Post subject: RE:Draw.Text and Get command

use getch to get one character at a time then you might want to check if they enter Backspace and take the last letter entered off

and enter to finish
r.m_spy




PostPosted: Sun May 02, 2010 11:03 am   Post subject: RE:Draw.Text and Get command

loop

char letter
string name

get letter
name:=name+letter
end loop
TheGuardian001




PostPosted: Sun May 02, 2010 4:30 pm   Post subject: Re: RE:Draw.Text and Get command

r.m_spy @ Sun May 02, 2010 11:03 am wrote:
loop

char letter
string name

get letter
name:=name+letter
end loop


Get won't work here, since get waits for a full line of input (until "enter" is hit), and blocks all other processing.

Something more along the lines of

code:

if hasch then
   name += getchar()
end if

would be a more effective solution, since it will get the name character by character, instead of all at once.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: