Fading effect on bitmaps by Anonymous Coder13th Oct 2004 23:30
|
---|
Summary Finds all images within the folder of the executable with extension "jpg". Fades out one by one those images. Description Bugs: Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com Rem Project: bitmap Rem Created: 12/10/2004 2:55:26 μμ Rem ***** Main Source File ***** global files$ global file_name$ global fade_value = 100 global fade_operation$ = "decrease" global state$="null" global file_number=0 directory$=get dir$() display() get_file_name(directory$) end function display() set display mode 800, 600,32 endfunction function get_file_name(directory$) find first repeat if get file type()=0 and get file name$()<> "bitmap.exe" files$=get file name$() if right$(files$, 3) = "jpg" then : show_image(files$) endif find next until get file type()=-1 wait key endfunction function show_image(file_name$) load bitmap file_name$ , file_number fade_bitmap() endfunction function fade_bitmap() do fade bitmap current bitmap() , fade_value if ( fade_operation$ = "decrease" ) then:fade_value= fade_value-15 if ( fade_operation$ = "increase" ) then:fade_value= fade_value+15 if ( fade_value < 0 ) then: fade_operation$ = "increase":exit if ( fade_value > 100 ) then: fade_operation$ = "decrease" fastsync loop fade_value=100 endfunction |