| KUVAUS |
| Piirretään aaltoileva kuva. |
| KÄYTTÖ |
| DrawWaveImage(_image, _x, _y, _waveLength#, _waveHeight#, _dgr#, [_direction], [_alignment]) |
| _image - Kuvamuuttuja. _x - Kuvan sijainti vaakasuunnassa. _y - Kuvan sijainti pystysuunnassa. _waveLength - Aallonpituus. _waveHeight - Aallonkorkeus. _dgr - Asteluku. _direction - Aaltoilun suunta. 0 = Pystysuunta (oletus) 1 = Vaakasuunta _alignment - Piirtopisteen valinta. Tällä valitaan kuvasta se piste joka sijoitetaan _x ja _y koordinaatteihin. 0 = Keskipiste (oletus) 1 = Vasen yläreuna 2 = Oikea yläreuna 3 = Vasen alareuna 4 = Oikea alareuna |
Katso myös: Erikoistehosteet
| ESIMERKKI |
SCREEN 640, 480
Include "SDK/include/cbMotion.cb"
Include "SDK/include/cbSpecialFX.cb"
img = LoadImage("SDK/media/sdklogo1.png")
img2 = MakeImage(400, 400)
waveDgr# = 0
waveLength = 300
waveHeight = 20
speed = 100
direction = 0
Repeat
UpdateFrameTimer()
If UpKey() Then waveHeight + 1
If DownKey() Then waveHeight - 1
If LeftKey() Then waveLength - 1
If RightKey() Then waveLength + 1
If KeyDown(cbKeyPgUp) Then speed + 1
If KeyDown(cbKeyPgDown) Then speed - 1
If KeyHit(cbKeyP) Then direction = 0
If KeyHit(cbKeyV) Then direction = 1
If KeyHit(cbKeyM) Then direction = 2
waveDgr = waveDgr + DgrPerSec(speed)
If direction = 2 Then
DrawToImage img2
Cls
DrawWaveImage(img, ImageWidth(img2) / 2, ImageHeight(img2) / 2, waveLength, waveHeight, waveDgr, 0)
DrawToScreen
DrawWaveImage(img2, ScreenWidth() / 2, ScreenHeight() / 2, waveLength, waveHeight, waveDgr, 1)
Else
DrawWaveImage(img, ScreenWidth() / 2, ScreenHeight() / 2, waveLength, waveHeight, waveDgr, direction)
EndIf
Text 0, 0, "FPS..........: " + FPS()
Text 0, 20, "Aallonpituus.: " + waveLength
Text 230, 20, "(Nuolet oikealle/vasemmalle)"
Text 0, 40, "Aallonkorkeus: " + waveHeight
Text 230, 40, "(Nuolet ylös/alas)"
Text 0, 60, "Nopeus.......: " + speed
Text 230, 60, "(PageUp/PageDown)"
If direction = 0 Then directionText$ = "Pysty"
If direction = 1 Then directionText$ = "Vaaka"
If direction = 2 Then directionText$ = "Pysty/vaaka"
Text 0, 80, "Suunta.......: " + directionText
Text 230, 80, "(Näppäimet p/v/m)"
DrawScreen
Forever
|