Кажется баг Blitz3d %)... В инклуде, в функцие есть переход на закладку ( закладка в этом же инклуде, но не в функцие ). При компиляции дебаг выдает, что закладки не существует.
Вот код (это главное меню моей игры):
Code
MP3_Init()
HidePointer
cur = LoadImage("dat\gfx\Cursor.bmp")
MP3_Load("dat\sfx\mus\enter_the_east.mp3")
MP3_Play()
TextFile = ReadFile("dat\text.dat")
Dim TextIt$(10)
NFont = LoadFont("Comic Sans MS",(g_width+g_height)/2/40,1,0,0)
SetFont NFont
TextIt$(0) = ReadLine(TextFile)
FonIm = LoadImage("dat\gfx\menu_"+rp$+".jpg")
LogIm = LoadImage("dat\gfx\ssl_"+rp$+".jpg")
DrawImage LogIm,0,0
Flip
Wait(3000)
ButsIm = LoadImage("dat\gfx\buts_"+rp$+".bmp")
MaskImage ButsIm,255,0,255
While eom = 0
Cls
Color 255,0,0
If KeyDown(1) Then End
DrawImage FonIm,0,0
DrawImage ButsIm,0,0
Text GraphicsWidth()-FontWidth()*Len(TextIt$(0))*1.5,GraphicsHeight()-FontWidth()*1.5,TextIt$(0)+"(c)"
DrawImage cur,MouseX(),MouseY()
UpdateMenu()
Flip
Wend
.MenuNext ;закладки пока для красоты
.MenuNewGame
.MenuLoad
.MenuOptions
End
Function UpdateMenu()
If MouseZone(GraphicsWidth()/1.882352941176,GraphicsHeight()/30,GraphicsWidth()/3.720930232558,GraphicsHeight()/9.230769230769)=1 And MouseDown(1) Then Goto MenuNext
If MouseZone(GraphicsWidth()/1.939393939394,GraphicsHeight()/5.714285714286,GraphicsWidth()/2.191780821918,GraphicsHeight()/8.888888888889)=1 And MouseDown(1) Then Goto MenuNewGame
If MouseZone(GraphicsWidth()/1.882352941176,GraphicsHeight()/3.157894736842,GraphicsWidth()/2.461538461538,GraphicsHeight()/8.888888888889)=1 And MouseDown(1) Then Goto MenuLoad
If MouseZone(GraphicsWidth()/1.951219512195,GraphicsHeight()/2.181818181818,GraphicsWidth()/3.855421686747,GraphicsHeight()/9.6) And MouseDown(1) Then Goto MenuOptions
If MouseZone(GraphicsWidth()/1.860465116279,GraphicsHeight()/1.666666666667,GraphicsWidth()/3.855421686747,GraphicsHeight()/9.230769230769) And MouseDown(1) Then End
End Function
Ах да, функция MouseZone:
Code
Function MouseZone(mz_x,mz_y,mz_w,mz_h)
If MouseX()>= mz_x And MouseX()<= mz_x+mz_w And MouseY()>= mz_y And MouseY()<= mz_y+mz_h Then Return True
End Function
И Wait:
Code
Function Wait(per)
ot = MilliSecs()
Wk = 0
Wmk = 0
While ot+per>MilliSecs()
Wk = GetKey()
Wmk = GetMouse()
If Wk <> 0 Or Wmk <> 0 Then Exit
Wend
End Function
Добавлено (30.05.2009, 11:53)
---------------------------------------------
Не забудьте поставить перед кодом графический режим!