
-----------------------------------
DstSoldier
Tue Apr 01, 2008 6:39 pm

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

-----------------------------------
A.J
Tue Apr 01, 2008 7:09 pm

Re: Moving Text
-----------------------------------
You should probably use Text.Locate or locatexy.
Here is an example program:

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
Tue Apr 01, 2008 7:48 pm

RE:Moving Text
-----------------------------------
Yes, thank you for the response it really helped me.

-----------------------------------
A.J
Tue Apr 01, 2008 10:06 pm

Re: Moving Text
-----------------------------------
you're welcome :D!

-----------------------------------
SIXAXIS
Fri Apr 04, 2008 8:52 pm

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:


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.


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

