08-25-2023, 11:45 PM
Great transitions! I'll be saving these for sure. I know I saved some from the old forum, had a folder of those kind of programs saved somewhere. I'll take a look in my archives.
Here's some I used in a game once that I had handy. Swaps two images, one over the other kind of effect.
- Dav
Here's some I used in a game once that I had handy. Swaps two images, one over the other kind of effect.
- Dav
Code: (Select All)
'===============
'SCREENSWAPS.BAS
'===============
'Effect Swaps 2 screen images on the screen.
'Moves one image over the other, from 4 different directions.
'Coded by Dav
SCREEN _NEWIMAGE(800, 600, 32)
'=== draw pic1& to use
CLS , _RGB(0, 0, 32)
FOR x = 0 TO _WIDTH STEP 8
FOR y = 0 TO _HEIGHT STEP 8
PSET (x, y), _RGB(RND * 255, RND * 255, RND * 255)
NEXT
NEXT: LINE (1, 1)-(_WIDTH - 1, _HEIGHT - 1), _RGB(0, 0, 255), B
pic1& = _COPYIMAGE(_DISPLAY)
'=== draw pic2& to use
CLS , _RGB(32, 0, 0)
FOR x = 0 TO _WIDTH STEP 8
FOR y = 0 TO _HEIGHT STEP 8
PSET (x, y), _RGB(RND * 255, RND * 255, RND * 255)
NEXT
NEXT: LINE (1, 1)-(_WIDTH - 1, _HEIGHT - 1), _RGB(255, 0, 0), B
pic2& = _COPYIMAGE(_DISPLAY)
'=== start by showing this...
_PUTIMAGE , pic1&: _DISPLAY: _DELAY 1
'=== start swapping images to use
ScreenSwap "LEFT", pic1&, pic2&, 100: _DELAY 1
ScreenSwap "RIGHT", pic2&, pic1&, 100: _DELAY 1
ScreenSwap "DOWN", pic1&, pic2&, 100: _DELAY 1
ScreenSwap "UP", pic2&, pic1&, 100: _DELAY 1
'=== I love freedom....
_FREEIMAGE pic1&: _FREEIMAGE pic2&
END
SUB ScreenSwap (way$, image1&, image2&, speed)
_DISPLAY
hw = (_WIDTH - 1) / 2
hh = (_HEIGHT - 1) / 2
SELECT CASE UCASE$(way$)
CASE "LEFT"
x2 = 0
FOR x = 0 TO hw + 30 STEP 3
CLS
_PUTIMAGE (x2, 0), image2&
_PUTIMAGE (x, 0), image1&
x2 = x2 - 3
_DISPLAY
IF x < 30 OR x > hw THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
_DELAY .05
x2 = -hw - 30
FOR x = hw + 30 TO 0 STEP -3
CLS
_PUTIMAGE (x, 0), image1&
_PUTIMAGE (x2, 0), image2&
x2 = x2 + 3
_DISPLAY
IF x > hw OR x < 30 THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
CASE "RIGHT"
x2 = 0
FOR x = 0 TO -hw - 30 STEP -3
CLS
_PUTIMAGE (x2, 0), image2&
_PUTIMAGE (x, 0), image1&
x2 = x2 + 3
_DISPLAY
IF x > -30 OR x < -hw THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
_DELAY .05
x2 = hw + 30
FOR x = -hw - 30 TO 0 STEP 3
CLS
_PUTIMAGE (x, 0), image1&
_PUTIMAGE (x2, 0), image2&
x2 = x2 - 3
_DISPLAY
IF x < -hw OR x > -30 THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
CASE "DOWN"
y2 = 0
FOR y = 0 TO hh + 30 STEP 3
CLS
_PUTIMAGE (0, y2), image2&
_PUTIMAGE (0, y), image1&
y2 = y2 - 3
_DISPLAY
IF y < 30 OR y > hh THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
_DELAY .05
y2 = -hh - 30
FOR y = hh + 30 TO 0 STEP -3
CLS
_PUTIMAGE (0, y), image1&
_PUTIMAGE (0, y2), image2&
y2 = y2 + 3
_DISPLAY
IF y > hh OR y < 30 THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
CASE "UP"
y2 = 0
FOR y = 0 TO -hh - 30 STEP -3
CLS
_PUTIMAGE (0, y2), image2&
_PUTIMAGE (0, y), image1&
y2 = y2 + 3
_DISPLAY
IF y > -30 OR y < -hh THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
_DELAY .05
y2 = hh + 30
FOR y = -hh - 30 TO 0 STEP 3
CLS
_PUTIMAGE (0, y), image1&
_PUTIMAGE (0, y2), image2&
y2 = y2 - 3
_DISPLAY
IF y < -hh OR y > -30 THEN
_LIMIT (speed * .65)
ELSE
_LIMIT speed
END IF
NEXT
END SELECT
_PUTIMAGE (0, 0), image2&: _DISPLAY
_AUTODISPLAY
END SUB