home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sauce 'n' Code 3
/
sauce-n-code-03.adf
/
Source_Code
/
Screen_Zoom_In.asc
< prev
next >
Wrap
Text File
|
1996-01-21
|
1KB
|
73 lines
' Zoom In
' ¯¯¯¯¯¯¯
' cODED bY ßudda/NFA
' StARtEd : 15/10/1995
' FiNiSHed: 15/10/1995
Load "scr_man.abk"
' --- demonstrational picture
Unpack 5 To 0
Screen Hide 0
' --- save details about screen
SH=Screen Height(0)
SW=Screen Width(0)
SC=Screen Colour
SM=Screen Mode
' --- variable variables!! try changing them
SPEED=10
_ZOOM=SW*2 : Rem zoom in x2
' --- open temp screen to work on
Screen Open 2,SW,SH,SC,SM
Flash Off
Curs Off
Screen Hide 2
' --- open screen to see it all on
Screen Open 1,SW,SH,SC,SM
Flash Off
Curs Off
Hide On
Get Palette 0
Double Buffer
Autoback 0
' --- actual stretch code (very small?!)
For SCAN#=SW To _ZOOM Step SPEED
' - horizontal calculations
LIN1#=SW/SCAN#
OFFSET1=(SW/2)-(SW/LIN1#)/2
For XXX#=0 To SW Step(LIN1#*SPEED)
Screen Copy 0,XXX#,0,XXX#+SPEED,SH To 2,OFFSET1,0
Add OFFSET1,SPEED
Next XXX#
' - verticle calculations
LIN2#=SH/SCAN#
OFFSET2=(SH/2)-((SH/LIN2#)/2)
For YYY#=0 To SH Step(LIN2#*SPEED)
Screen Copy 2,0,YYY#,SW,YYY#+SPEED To 1,0,OFFSET2
Add OFFSET2,SPEED
Next YYY#
Screen Swap
Wait Vbl
Next SCAN#
' The higher the SPEED number the more crap the zoomed graphics look. HOWEVER
' if the speed is faster then the zoom looks much smoother/quicker and nobody
' will notice if you do it fast enough to show the effect but not sit and
' look at it !!!