You can do it like this:
Made very quickly but it shows how to do it...
Graphics3D 640,480,0,2 SetBuffer BackBuffer() dummytex = CreateDummyTex() camera = CreateCamera() quad = CreateMesh() UpdateQuad(quad,1,1,0,0) EntityTexture quad,dummytex PositionEntity quad,0,0,10 EntityFX quad,1 s# = 0.0 tu = 0 tv = 0 While Not KeyHit(1) If KeyHit(57) tu = tu+1 If tu>1 tv = tv+1 tu = 0 If tv>1 Then tv = 0 EndIf EndIf s = s + 1 UpdateQuad(quad,2.0+Sin(s)*1.5,2.0+Cos(s)*1.5,tu,tv) RenderWorld Color 255,255,255 Text 0,0,"Space to change texture tile" Text 0,300,"The texture looks like this:" CopyRect 0,0,128,128,0,320,TextureBuffer(dummytex),BackBuffer() Flip Wend End Function UpdateQuad(mesh,w#,h#,tilex,tiley) s = CountSurfaces(mesh) If s<1 surf = CreateSurface(mesh) Else surf = GetSurface(mesh,1) EndIf ClearSurface surf tx = Floor(w) ty = Floor(h) tu# = tilex*0.5 tv# = tiley*0.5 For x = 0 To tx For y = 0 To ty x2# = x + 1.0 y2# = y + 1.0 tu2# = tu + 0.5 tv2# = tv + 0.5 If x = tx x2 = w tu2 = tu + (0.5 * (w-tx)) EndIf If y = ty y2 = h tv2 = tv + (0.5 * (h-ty)) EndIf v0 = AddVertex(surf,x ,y ,0,tu ,tv ) v1 = AddVertex(surf,x2,y ,0,tu2,tv ) v2 = AddVertex(surf,x2,y2,0,tu2,tv2) v3 = AddVertex(surf,x ,y2,0,tu ,tv2) AddTriangle surf,v0,v1,v2 AddTriangle surf,v0,v2,v3 Next Next UpdateNormals mesh FlipMesh mesh End Function Function CreateDummyTex() Color 255,0,0 Oval 4,4,56,56 Color 255,255,0 Rect 68,4,56,56 Color 0,255,0 Line 4,68,60,124 Line 60,68, 4,124 Color 0,255,255 Rect 68,68,56,56,False tex = CreateTexture(128,128) CopyRect 0,0,128,128,0,0,BackBuffer(),TextureBuffer(tex) Return tex End Function
Made very quickly but it shows how to do it...