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

Username:   Password: 
 RegisterRegister   
 Moving Text
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DstSoldier




PostPosted: Tue Apr 01, 2008 6:39 pm   Post subject: Moving Text

Well, sorry if this question is rather nooby. But I've been working on this program and I want to add a feature where the title of the program comes in from from off the screen moves to the right towards the center and stops.

example

-------------------------------------------------Test
Sponsor
Sponsor
Sponsor
sponsor
A.J




PostPosted: Tue Apr 01, 2008 7:09 pm   Post subject: Re: Moving Text

You should probably use Text.Locate or locatexy.
Here is an example program:
Turing:

var name : string
put "Enter your name:" ..
get name
cls
put "Move the mouse around and your name follows!"
var x, y, b : int
View.Set ("offscreenonly")
loop
    Mouse.Where (x, y, b)
    locatexy (x, y)
    put name
    View.Update
    delay (5)
    cls
end loop

hope this helped,
A.J
DstSoldier




PostPosted: Tue Apr 01, 2008 7:48 pm   Post subject: RE:Moving Text

Yes, thank you for the response it really helped me.
A.J




PostPosted: Tue Apr 01, 2008 10:06 pm   Post subject: Re: Moving Text

you're welcome Very Happy!
SIXAXIS




PostPosted: Fri Apr 04, 2008 8:52 pm   Post subject: Re: Moving Text

You can also use other fonts by doing it another way. You can use regular fonts (so you don't have to use the ugly Turing font).

Here is the code:

Turing:

setscreen ("graphics:max,max,nobuttonbar")
var name : string
var Arial : int := Font.New ("Arial:12")
var mousex, mousey, mousebutton : int
var Colour : int := black
put "Your name is " ..
get name
setscreen ("graphics:max,max,nobuttonbar,offscreenonly")
loop
    cls
    Mouse.Where (mousex, mousey, mousebutton)
    Font.Draw (name, mousex, mousey, Arial, Colour)
    if mousebutton = 1 then
        Colour := green
    else
        Colour := black
    end if
    View.Update
    delay (10)
end loop


It's like AJ's, but more advanced. Use this if you think you're up to it, because if you're in a class, you'll learn the Font stuff anyway.

I think this is more of what you asked though.

Turing:

setscreen ("graphics:max,max,nobuttonbar")
const midy := maxy div 2
var name : string
var Arial : int := Font.New ("Arial:12")
put "Your name is " ..
get name
setscreen ("graphics:max,max,nobuttonbar,offscreenonly")
for i : - (Font.Width (name, Arial)) .. maxx
    cls
    Font.Draw (name, i, midy, Arial, black)
    View.Update
    delay (10)
end for
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: