Computer Science Canada

3d Text positioning

Author:  air_force91 [ Wed Jan 07, 2004 5:27 pm ]
Post subject:  3d Text positioning

i know how to make a 3d text effect...but how do i postion the text on the screen like this: Welcome
To
My Page!

Author:  Thuged_Out_G [ Wed Jan 07, 2004 6:10 pm ]
Post subject: 

you can use Font.Draw to position text...or an easier way

locate(x,y)

Author:  shorthair [ Wed Jan 07, 2004 6:23 pm ]
Post subject: 

i dont belive that will work for 3d font

Author:  Homer_simpson [ Wed Jan 07, 2004 8:42 pm ]
Post subject:  Re: 3d Text positioning

air_force91 wrote:
i know how to make a 3d text effect...but how do i postion the text on the screen like this: Welcome
To
My Page!

how do u make 3d text effect?

Author:  air_force91 [ Thu Jan 08, 2004 7:38 am ]
Post subject:  well...i got the 3D effect from another page in this forum..

code:
var size : int
var text : string
put "enter text"
get text:*
put "enter size"
get size

var fontID : array..size of int

for i:size div 2..size
fontID(i) :=Font.New("Arial:"+intstr(i))
end for

procedure Text3D(text:string)

for t:i..length(text)

for i:size div 2..size
Font.Draw(text(t), t*size, 100, fontID(i), 20+floor
(i/size*10))
end for

end Text3D

Text3D(text)


do any of u have a much smaller code for 3D text?

and im not sure if the locate command does work with 3D...ive tried it b4...

Author:  air_force91 [ Thu Jan 08, 2004 7:49 am ]
Post subject:  positioning the text

yo...can u tell me how i can insert Font.Draw in my code to match the way i want the text to appear...i already have one Font.Draw in my code...

Author:  Tony [ Thu Jan 08, 2004 10:42 am ]
Post subject: 

you should give credit when quoting code like that... I think I wrote that Confused

anyways... in the line
code:

Font.Draw(text(t), t*size, 100, fontID(i), 20+floor
(i/size*10))


t*size is the X positin
100 is the Y

to change the location of the string you just add a number to those values.

If you're trying to display the text on 3 lines, you'd have to run the code 3 times, once for each line

Author:  air_force91 [ Thu Jan 08, 2004 9:02 pm ]
Post subject:  sorry...

sorry...i found the code long time ago...so didn't look up the source...but the code is really helpful...thanx...thanx a lot...teacher's giving only 5 days to complete programming an interfacing game Sad...but it really helps... 8)


: