Blitz3D+ Command Reference

EntityAnimTime

Parameters

None. EntityAnimTime is not a Blitz3D+ command.

Description

Legacy alias page - use AnimTime instead.

There has never been an EntityAnimTime command in the language; the name turns up in old tutorials and forum posts, where it was shorthand for the real command. Writing EntityAnimTime in a program is a compile error. This page exists only so that old links and bookmarks land somewhere useful.

The command you want is AnimTime, which returns how far through its current sequence an entity is, in animation frames.

See also: AnimTime, AnimLength, Animating, Animate.

Example

; EntityAnimTime Example
; ----------------------

Graphics3D 640,480,0,2
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,2,-6
RotateEntity camera,12,0,0

light=CreateLight()
RotateEntity light,45,45,0

; A grassy paddock for the fox to roam
ground=CreatePlane()
EntityTexture ground,LoadTexture("media/MossyGround.BMP")

; Load the rigged fox; it has the named clips "Survey", "Walk" and "Run"
fox=LoadAnimMesh("../../../samples/glTF/assets/Fox/Fox.glb")
If fox=0 Then RuntimeError "Could not load Fox.glb: "+ModelLoadError()

; Shrink the fox to game scale (the file is modelled about 100 units tall)
FitMesh fox,-0.8,0,-0.8,1.6,1.6,1.6,True

; Start the fox walking in a loop
walk=FindAnimSeq(fox,"Walk")
CrossFadeAnim fox,walk,0,1

While Not KeyDown(1)

    UpdateWorld

    ; Arrow keys move the camera
    If KeyDown(200) Then MoveEntity camera,0,0,0.1
    If KeyDown(208) Then MoveEntity camera,0,0,-0.1
    If KeyDown(203) Then TurnEntity camera,0,1,0
    If KeyDown(205) Then TurnEntity camera,0,-1,0

    RenderWorld

    Text 0,0,"Arrows: camera   Esc: exit"
    ; The entity's current animation time, read back each frame
    Text 0,20,"Animation time: "+AnimTime(fox)+" of "+AnimLength(fox)+" ticks"

    Flip

Wend

End

Index