I've had very good results making my own textured quads parented to the camera, and rendering them with their EntityOrder set to -1. I've had over 50 of them on the screen at once, with no noticable slowdown even on my 2-year-old laptop. The code below uses the globals Camera, ScrWidth, and ScrHeight. It also uses "quit.png", which should be a 24-bit PNG image of a button with transparency. The CreateButton routine expects the arguments of Brush handle, X position, Y position, Width and Height.
BtnImgQuit = LoadBrush("quit.png",3)
QuitBtn = CreateButton(BtnImgQuit, 0, -2.6, .8, .2)
While(1)
If (MouseHit(1))
BtnHit = CameraPick(Camera, MouseX(), MouseY())
If (BtnHit = QuitBtn) End
EndIf
UpdateWorld():RenderWorld():Flip()
Wend
Function CreateButton(img, x#, y#, w#, h#)
BtnMesh = CreateMesh(Camera)
BtnSurf = CreateSurface(BtnMesh, img)
AddVertex (BtnSurf, -w, -h, 0)
AddVertex (BtnSurf, -w, h, 0)
AddVertex (BtnSurf, w, h, 0)
AddVertex (BtnSurf, w, -h, 0)
VertexTexCoords (BtnSurf, 0, 0, 1)
VertexTexCoords (BtnSurf, 1, 0, 0)
VertexTexCoords (BtnSurf, 2, 1, 0)
VertexTexCoords (BtnSurf, 3, 1, 1)
AddTriangle (BtnSurf, 0, 1, 2)
AddTriangle (BtnSurf, 2, 3, 0)
EntityParent (BtnMesh, Camera)
EntityOrder (BtnMesh, -2)
EntityBox (BtnMesh, -w, -h, 0, w*2, h*2, .01)
EntityPickMode (BtnMesh, 3)
EntityFX (BtnMesh, 1)
PositionEntity (BtnMesh, x, y, 3.5 * ScrWidth / ScrHeight)
Return BtnMesh
End Function