Skip to content

TextureFrameDelay

Narta Xaymar Dirks edited this page Oct 28, 2026 · 2 revisions

TextureFrameDelay

TextureFrameDelay:Int32 texture:Int32, frame:Int32
Parameter Mode Type Default Description
texture In Int32 required The texture to ask about.
frame In Int32 required The frame, from 0.

Returns: The time in milliseconds, or 0 for a texture that is not from an animated picture or a frame that it does not have.

Description

Says how long a frame of an animated picture lasts, in milliseconds, so that a program can step through the frames at the speed that the file asks for. LoadAnimTexture with a frame size of 0 loads GIF, animated WebP and animated AVIF files this way. A frame that the file gives no time (or 0) lasts 100 milliseconds, like in web browsers.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
anim = LoadAnimTexture("spinner.gif", 1, 0, 0, 0, 0)
frame = 0 : next_change = MilliSecs() + TextureFrameDelay(anim, 0)
While Not KeyHit(1)
	If MilliSecs() >= next_change Then
		frame = (frame + 1) Mod TextureFrames(anim)
		next_change = MilliSecs() + TextureFrameDelay(anim, frame)
	EndIf
	; EntityTexture entity, anim, frame
Wend

This is a BlitzLLVM extension: the originals cannot load animated pictures.

Related Commands

TextureBlend, TextureBuffer, TextureCoords, TextureFilter, TextureFrames, TextureHeight, TextureName, TextureReady 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally