SetObjectAnimatedTexture: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetObjectAnimatedTexture(object, TextureFile, Rows, Columns [, MaterialSlot])}} {{FuncParameters}}..." |
No edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Sets a flipbook texture on an object.}} | ||
{{FuncSyntax|SetObjectAnimatedTexture(object, TextureFile, Rows, Columns [, MaterialSlot])}} | {{FuncSyntax|SetObjectAnimatedTexture(object, TextureFile, Rows, Columns [, MaterialSlot])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|object| | {{FuncParam|object|The object identifier.}} | ||
{{FuncParam|TextureFile| | {{FuncParam|TextureFile|The files in your package directory.}} | ||
{{FuncParam|Rows| | {{FuncParam|Rows|Number of rows of your flipbook texture.}} | ||
{{FuncParam|Columns | | {{FuncParam|Columns|Number of columns of your flipbook texture.}} | ||
{{FuncParamOptional|MaterialSlot| | {{FuncParamOptional|MaterialSlot|The objects model material slot. Default: 0}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' on success.}} | ||
== Example == | == Example == | ||
[[File:AnimatedBanana.PNG|300px]] | |||
<syntaxhighlight lang="Lua"> | |||
AddEvent("OnObjectStreamIn", function(object) | |||
local modelid = GetObjectModel(object) | |||
if modelid == 1 then | |||
SetObjectAnimatedTexture(object, GetPackageName().."/client/files/AnimatedBanana.PNG", 2, 4) | |||
end | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetObjectCount]] | |||
* [[GetObjectModelCount]] | |||
* [[GetObjectModelGroup]] | |||
* [[GetObjectModelName]] | |||
* [[GetStreamedObjects]] | |||
* [[GetObjectModel]] | |||
* [[GetObjectLocation]] | |||
* [[GetObjectRotation]] | |||
* [[GetObjectScale]] | |||
* [[GetObjectBoundingBox]] | |||
* [[GetObjectSize]] | |||
* [[EnableObjectHitEvents]] | |||
* [[GetObjectMass]] | |||
* [[SetObjectEditorSpeed]] | |||
* [[SetObjectEditable]] | |||
* [[SetObjectOutline]] | |||
* [[SetObjectCastShadow]] | |||
* [[SetObjectColor]] | |||
* [[SetObjectEmissiveColor]] | |||
* [[SetObjectTexture]] |
Latest revision as of 11:07, 1 September 2020
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
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
- GetObjectCount
- GetObjectModelCount
- GetObjectModelGroup
- GetObjectModelName
- GetStreamedObjects
- GetObjectModel
- GetObjectLocation
- GetObjectRotation
- GetObjectScale
- GetObjectBoundingBox
- GetObjectSize
- EnableObjectHitEvents
- GetObjectMass
- SetObjectEditorSpeed
- SetObjectEditable
- SetObjectOutline
- SetObjectCastShadow
- SetObjectColor
- SetObjectEmissiveColor
- SetObjectTexture