SetObjectAnimatedTexture

From Onset Developer Wiki
Revision as of 13:07, 1 September 2020 by BlueMountains (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
SetObjectAnimatedTexture

Type: Function
Context: Client
Introduced: v1.0

Description

Sets a flipbook texture on an object.

Syntax

SetObjectAnimatedTexture(object, TextureFile, Rows, Columns [, MaterialSlot])

Parameters

  • object
    The object identifier.
  • TextureFile
    The files in your package directory.
  • Rows
    Number of rows of your flipbook texture.
  • Columns
    Number of columns of your flipbook texture.
  • MaterialSlot (optional)
    The objects model material slot. Default: 0

Return Value

  • Returns true on success.

Example

AnimatedBanana.PNG

AddEvent("OnObjectStreamIn", function(object)
	
	local modelid = GetObjectModel(object)

	if modelid == 1 then
		SetObjectAnimatedTexture(object, GetPackageName().."/client/files/AnimatedBanana.PNG", 2, 4)
	end

end)

See also