Morph: Zwei Texte von ???
Eine Morph funktion die ein text in ein anderer umwandelt (ählich wie in flash)

[code:1:570c58a187]const sx=640,sy=480
graphics sx,sy,32,2
setbuffer backbuffer()

font=loadfont("Arial",72)
setfont font

dim m1(10000,2)
makelist1("Hello")

dim m2(10000,2)
makelist2("World")

d=0
while not keydown(1)
d=d+1 mod 360
s#=sin(d)*0.5+0.5
morph(s#)
flip
wend

end



function makelist1(s$)
cls
color 255,255,255
text 1,1,s$
l=len(s)*fontheight()
h=fontheight()+2
p=0
lockbuffer backbuffer()
for x=0 to l
for y=0 to h
b=readpixelfast(x,y,backbuffer()) AND $FF
if b>10 then
m1(p,0)=x
m1(p,1)=y
p=p+1
endif
next
next
m1(0,2)=p-1
unlockbuffer backbuffer()
end function

function makelist2(s$)
cls
color 255,255,255
text 1,1,s$
l=len(s)*fontheight()
h=fontheight()+2
p=0
lockbuffer backbuffer()
for x=0 to l
for y=0 to h
b=readpixelfast(x,y,backbuffer()) AND $FF
if b>10 then
m2(p,0)=x
m2(p,1)=y
p=p+1
endif
next
next
m2(0,2)=p-1
unlockbuffer backbuffer()
end function


function morph(s#)
if m1(0,2)>m2(0,2) then
p=m1(0,2)
pp=m2(0,2)
f=0
else
p=m2(0,2)
pp=m1(0,2)
f=1
endif
cls
rgb=int(255*s)*$10000 + int(255*(1-s))*$100
lockbuffer backbuffer()
for a=0 to p
aa=pp*a/p
if f=1 then
x#=(m1(aa,0)*s#+m2(a,0)*(1-s#))*1+10
y#=(m1(aa,1)*s#+m2(a,1)*(1-s#))*1+10
else
x#=(m1(a,0)*s#+m2(aa,0)*(1-s#))*1+10
y#=(m1(a,1)*s#+m2(aa,1)*(1-s#))*1+10
endif
writepixelfast x,y,rgb,backbuffer()
next
unlockbuffer backbuffer()
end function[/code:1:570c58a187]



Suche:
(unterstützt mySQL Wildcards ala %)
Titel:
Text:
Autor: