forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   2D-программирование (http://forum.boolean.name/forumdisplay.php?f=13)
-   -   Титры (http://forum.boolean.name/showthread.php?t=4791)

Bagration 17.10.2007 22:29

Титры
 
Всем привет!
У меня вопрос: как сделать что бы текст титров скажем перемещался вниз, и луче когда ин ищезнет обратно сверху появлялся. Заранее спасибо! :)

HolyDel 17.10.2007 22:36

Re: Титры
 
вот фрагмент реалдьного кода

Function ShowAbout()
chm=PlayMusic("music/about.wav")
e=ReadFile("тут_файл_из_которого_надо_считать_инфу .ткст")
i=1
about_line(i)=Application+" v. "+Version
While Not Eof(e)
i=i+1
about_line(i)=ReadLine(e)
Wend
cnt=i
dy=600

; myfont=LoadFont_("Times New Roman Cyr",24,1,0,0,0,2,0)
; SetImageFont myfont
likosoft=CreateImageEx(LoadTexture("gfx/likosoft.png"),width,150*800/width,FI_NONE)
While Not KeyDown(1)

Cls
RenderWorld
dy=dy-1
StartDraw

For i=1 To cnt
ty=(i*25)+dy
If ty>-20 And ty<height
dcl#=1
If ty>height-100 Then dcl#=Float(height-ty)/100.0
If ty<80 Then dcl#=Float(ty+20)/100.0
SetColor 250*(dcl),240*dcl,200*dcl
DrawText(about_line(i),width*0.5,ty,1,0)
EndIf
Next

SetColor 255,255,255
SetBlend FI_LIGHTBLEND
DrawImageEx(likosoft,0,0)

EndDraw

While MilliSecs()-a<20
Wend
a=MilliSecs()



Flip 0


If dy<-cnt*25 Then Exit
Wend

While KeyDown(1) : Wend
FlushKeys()
MoveMouse 350,10
; FreeFont_ myfont
StopChannel chm

End Function

само сабой понятно, что массив надо объявить зарание и он должен быть строкового типа.

H@NON 17.10.2007 23:24

Re: Титры
 
Если коротко, то так:
global Y#
....
text x, Y#, "about"
Y#=Y#+1
If Y>=Graphicsheight() then Y=0
...


Часовой пояс GMT +4, время: 15:14.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot