Hi ya thought im very new to this and I have been searching the forums when I came upon this. This was exactly what I was looking for. So I've saved off the images for the sprite method and pasted the code from the tutorial. But it doesnt work properly. The buttons appear and function as expexted but the background is blue?
Any ideas anyone
heres my code altho should be same as tutorial apart from the file paths
Rem Example 6 - Sprite Buttons
Rem From TDK_Man's Tutorial On Menu Screens
Gosub Setup
Do
Mx=MouseX(): My=MouseY(): Mc=MouseClick()
Sprite 100,Mx,My,100
OverButton = Sprite Collision(100,0)
If OverButton <> 0 Then Gosub HandleButton
Sync
Loop
End
HandleButton:
Rem If we are here then a collision was detected
Select OverButton
Case 1
Rem Button 1
If Mc=1
Center Text 400,580,"You Clicked On Button 1"
Endif
EndCase
Case 2
Rem Button 2
If Mc=1
Center Text 400,580,"You Clicked On Button 2"
Endif
EndCase
Case 3
Rem Button 3
If Mc=1
Center Text 400,580,"You Clicked On Button 3"
Endif
EndCase
Case 4
Rem Button 4
If Mc=1
Center Text 400,580,"You Clicked On Button 4"
Endif
EndCase
Case 5
Rem Button 5
If Mc=1
Center Text 400,580,"You Clicked On Button 5"
Endif
EndCase
Case 6
Rem Button 6
If Mc=1
Center Text 400,580,"You Clicked On Button 6"
Endif
EndCase
EndSelect
Return
Setup:
Set Display Mode 800,600,32
Sync On: Sync Rate 60
Load Image "C:\Documents and Settings\neilo\My Documents\Screen4.jpg",10
Load Image "C:\Documents and Settings\neilo\My Documents\M3B1.jpg",1
Load Image "C:\Documents and Settings\neilo\My Documents\M3B2.jpg",2
Load Image "C:\Documents and Settings\neilo\My Documents\M3B3.jpg",3
Load Image "C:\Documents and Settings\neilo\My Documents\M3B4.jpg",4
Load Image "C:\Documents and Settings\neilo\My Documents\M3B5.jpg",5
Load Image "C:\Documents and Settings\neilo\My Documents\M3B6.jpg",6
Set Text Opaque
Rem Create and place button sprites
SprNum = 1
For Ny=0 To 2
For Nx=0 To 1
Sprite SprNum,Nx*300+130,Ny*100+200,SprNum
Inc SprNum
Next Nx
Next Ny
Rem Get Image For Hidden Sprite
CLS 141241: Get Image 100,0,0,2,2
Rem Create Hidden Sprite
Sprite 100,400,300,100
Hide Sprite 100
Ink RGB(255,255,255),0
Paste Image 10,0,0
Sync
Return