Hey Bengismo, that worked! Clever hack!
// Project: test_planeAni
// Created: 2018-05-16
// Used to display a sprite sheet animation on a 3D plane
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "test_planeAni" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 60, 0 )
SetScissor( 0,0,0,0 )
UseNewDefaultFonts( 1 )
#constant numberOfFramesHori 8 // set this to the number of frames horizontally in the spritesheet
#constant numberOfFramesVert 13 // set this to the number of frames vertically in the spritesheet
#constant numberOfFrames 101 // you will need to manually count the number of frames in the spritesheet
planeAni as integer = 0 // the currently active animation frame
horiPos as integer // used to store the horizontal position of the active frame
vertPos as integer // used to store the vertical position of the active frame
scaleU as float // horizontal scale 1.0=normal --- smaller values upscales graphic --- larger values downscale and repeats graphic
scaleU = 1.0 / numberOfFramesHori // scales to the width of a single frame
scaleV as float // vertical scale
scaleV = 1.0 / numberOfFramesVert // scales to the height of a single frame
mePlane = CreateObjectPlane (2.5, 1.0)
SetObjectPosition (mePlane, 0.0, 0.0, 5.0)
setObjectColor (mePlane, 255,255,255,255)
confirmAniImg = LoadImage("confirmAni.png")
setObjectImage (mePlane, confirmAniImg, 0)
SetObjectMeshUVScale( mePlane, 1, 0, scaleU, scaleV )
// Camera movement stuff
#constant TRUE 1
#constant FALSE 0
#constant KEY_A 65
#constant KEY_S 83
#constant KEY_D 68
#constant KEY_W 87
#constant KEY_Q 81
#constant KEY_E 69
camX as float = 0.0
camY as float = 0.0
camZ as float = 0.0
camMove as float = 0.2
do
// automatically loops the animation
inc planeAni
if planeAni => numberOfFrames then planeAni = 0
// Returns the remainder of the integer division planeAni/numberOfFramesHori
// which gives us the horizontal position
horiPos = Mod( planeAni, numberOfFramesHori )
// gives us the vertical position
vertPos = Trunc( planeAni/numberOfFramesHori )
// animation!
SetObjectMeshUVOffset( mePlane, 1, 0, horiPos, vertPos )
// Camera movement stuff
if GetRawKeyState( KEY_A ) = TRUE then camX = camX-camMove
if GetRawKeyState( KEY_D ) = TRUE then camX = camX+camMove
if GetRawKeyState( KEY_S ) = TRUE then camZ = camZ-camMove
if GetRawKeyState( KEY_W ) = TRUE then camZ = camZ+camMove
if GetRawKeyState( KEY_Q ) = TRUE then camY = camY-camMove
if GetRawKeyState( KEY_E ) = TRUE then camY = camY+camMove
setCameraPosition (1, camX, camY, camZ)
SetCameraLookAt (1, getObjectX(mePlane), getObjectY(mePlane), getObjectZ(mePlane), 0)
Sync()
loop