Result = CreateAnimatedMaterial(#Material, TextureArray(), Duration.f)
Creates a new animated material using the specified textures.


#Material A number to identify the new animated material. #PB_Any can be used to auto-generate this number.
TextureArray() An array of TextureID, with all the textures to use for the animation. TextureID() can be used to get a valid texture identifier.
Duration The animation duration in seconds. It can be a fractional number, for example: 1.5 which will be one second and half. Once the animation is finished, it will automatically start again.

Return value

Nonzero if the animated material was successfully created, zero otherwise. If #PB_Any was used for the #Material parameter, then the generated number is returned on success.


  CreateTexture(0, 256, 256)
  CreateTexture(1, 256, 256)
  CreateTexture(2, 256, 256)

  Dim Textures(2)
  Textures(0) = TextureID(0)
  Textures(1) = TextureID(1)
  Textures(2) = TextureID(2)

  ; Creates an animated material with 3 textures, which will play for 500ms
  CreateAnimatedMaterial(0, Textures(), 0.5)

Supported OS


<- CountMaterialLayers() - Material Index - CreateMaterial() ->