as i'm totally a noob, i tried to adapt this source to a personnal effect. so then the deformation works but i have no idea how to put the
same color in background than the picture, i tried BGpic but it flicks a lot. thanx a lot for help regards
Code: Select all
/*
** Important! Check if the used Hollywood version is at least
** version 2.0!
*/
@VERSION 2,0
/*
** external data
*/
@BRUSH 1, "logo02.png"
@BGPIC 1, "fond.png"
DisplayBGPic(1)
/*
** Highlight buttons 1
*/
/*
** Highlight buttons 2
*/
/*
** init wave parameters, dynamically adapts to brush dimensions
** input: maxwave
*/
Function p_InitWave()
Deg = 0
w = GetAttribute(#BRUSH, 1, #ATTRWIDTH)
h = GetAttribute(#BRUSH, 1, #ATTRHEIGHT)
wp = w
w = w + 1 * 4
cx = 640 - w
cx = cx \ 2
cy = 480 - h
cy = cy \ 2
If cx < 0
w = w + cx
cx = 0
EndIf
If cy < 0
h = h + cy
cy = 0
EndIf
CreateBrush(3, w, h)
EndFunction
/*
** Main loop
*/
Function p_MainLoop()
Deg = Deg + 4
If(Deg > 358) Then Deg = 0
; brush 3 is our buffer to work with
SelectBrush(3)
; shift every line with sine value
For y = 0 To h-2 Step 2 Do DisplayBrushPart(1, 0, y, sintable[Deg + y] * maxwave + maxwave, y, wp, 2)
EndSelect
; user pressed close gadget, prepare brush 4
If(shutdown = True)
CreateBrush(4, w, h)
SelectBrush(4)
DisplayBGPicPart(1, cx, cy, w, h, 0, 0)
EndSelect
shutdown = 15
EndIf
; crossfade brush 4 out with the effect still running!
If(shutdown > 0)
If(shutdown < 255)
MixBrush(3, 4, shutdown)
shutdown = shutdown + 16
Else
MixBrush(3, 4, 255)
End
EndIf
EndIf
; show the result brush!
DisplayBrush(3, #CENTER, #CENTER)
StartTimer(1)
EndFunction
sintable = {}
pi! = 3.141592
degrad! = pi! / 180
; make a table for fast sine access first
For i = 0 To 999 Do sintable[i] = Sin(i * degrad! * 2)
; init wave settings
maxwave =5
p_InitWave()
InstallEventHandler({CloseWindow = Function() If shutdown = False Then shutdown = True EndFunction})
StartTimer(1)
StartTimer(2)
SetInterval(1, p_MainLoop, 1000/25) ; 25 fps
boxw = TextWidth("1000.0 fps")
boxh = TextHeight("1000.0 fps")
a = 25
EscapeQuit(True)
Repeat
WaitEvent
Forever