Logo

Blitz3D Forums/Blitz3D Beginners Area/Logo

; sets the graphics mode
Graphics 800,600,0,2

; lets windows know the name of the program
AppTitle "Bounce Back v1.0"

;does everything in the background ready to show when "flip" is used
SetBuffer BackBuffer()

;The globals we'll need to use
Global Start 

;loads the images we'll need to use
Start = LoadImage("Images\Start.bmp")

;Stuff to show the Logo fade in and out
Delay 500

Blend_Black(logo,0,0,0,1000)

time = MilliSecs()+1000

While MilliSecs()<time

	DrawBlock logo,0,0
	Flip
	
Wend


Blend_Black(logo,0,0,1,1000)

Cls

;while esc. key isn't pressed
While Not KeyHit(1)

;program stuff, nothing goes wrong here

wend 
end


Function MainMenu()

	Cls
	
	DrawImage Start,300,125 ;;;;;;;;;;;;;;;;;;Problem is here, image not found
result=0

    While result=0

        mx=MouseX():my=MouseY()

		If RectsOverlap(300,125,200,100,mx,my,0,0) Then DrawImage StartOver,300,125 Else DrawImage Start,300,125 ;;;;;;;;;;;;;;;Problem here too, with Start image

flip
endif
wend
Function Blend_Black(image,x,y,mode,time)

;------------------------------------------------------------------
; Blends an Image with a Black Background (In & Out)
; -----------------------------------------------------------------
; Image = The Image to Blend
; x     = X Coordinate in the Screen
; y     = Y Coordinate in the Screen
;         50000 for both to center image
; Mode  = 0 Blend In
;       = 1 Blend Out
; Time  = Time in Milliseconds
;------------------


	source = ImageBuffer(image)
	dest   = BackBuffer()
	maxx   = ImageWidth(image)-1
	maxy   = ImageHeight(image)-1
	start  = MilliSecs()
	
	LockBuffer source
	
	If X = 50000 And y = 50000
		x = (GraphicsWidth()/2)-(ImageWidth(image)/2)
		y = (GraphicsHeight()/2)-(ImageHeight(image)/2)
	EndIf
	
	While MilliSecs()-start<time
Cls
		LockBuffer dest
		count=(count+1) Mod 4
		If count=0 Then minx=0: miny=0
		If count=1 Then minx=1: miny=1
		If count=2 Then minx=1: miny=0
		If count=3 Then minx=0: miny=1
		If mode=0 Then value=MilliSecs()-start
		If mode=1 Then value=time-MilliSecs()+start
		For ii=miny To maxy Step 2
			For i=minx To maxx Step 2
				rgb=ReadPixelFast(i,ii,source)
				r=(rgb And $FF0000)/$10000
				g=(rgb And $FF00)/$100
				b=rgb And $FF
				rgb=r*value/time*65536+g*value/time*256+b*value/time
				WritePixelFast x+i,y+ii,rgb,dest
			Next
		Next
		UnlockBuffer dest
		Flip
	Wend
	UnlockBuffer source
	If mode=0 Then DrawBlock image,x,y
	If mode=1 Then Color 0,0,0: Rect x,y,maxx+1,maxy+1
	Flip

End Function