03-25-2023, 05:56 PM
If you have a 100x100 image, you can treat it like a 1000x100 image and draw it 10 times with one command... or two commands since you need two triangles. I checked the wiki to see if the feature was described, and I think a comment about achieving a "tiling effect" was the only reference to it.
I mainly use it for scrolling backgrounds, but here's an example of how it works:
I mainly use it for scrolling backgrounds, but here's an example of how it works:
Code: (Select All)
scr = _NewImage(1000, 600, 32)
Screen scr
'DRAW SINGLE SMALL TILE
'---------------------
img = _NewImage(40, 100, 32)
_Dest img
Line (0, 0)-(20, 50), _RGB32(128, 0, 0), BF
Line (21, 0)-(40, 50), _RGB32(255, 0, 0), BF
Line (21, 51)-(40, 100), _RGB32(128, 0, 0), BF
Line (0, 51)-(20, 100), _RGB32(255, 0, 0), BF
'----------------------
'FILL ENTIRE SCREEN WITH MAPTRIANGLE
_MapTriangle (0, 0)-(1000, 0)-(0, 600), img To(0, 0)-(1000, 0)-(0, 600), scr
_MapTriangle (0, 600)-(1000, 600)-(1000, 0), img To(0, 600)-(1000, 600)-(1000, 0), scr