SetObjectAnimatedTexture: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
{{FuncParam|Rows|Number of rows of your flipbook texture.}} | {{FuncParam|Rows|Number of rows of your flipbook texture.}} | ||
{{FuncParam|Columns|Number of columns of your flipbook texture.}} | {{FuncParam|Columns|Number of columns of your flipbook texture.}} | ||
{{FuncParamOptional|MaterialSlot|The objects model material slot.}} | {{FuncParamOptional|MaterialSlot|The objects model material slot. Default: 0}} | ||
{{FuncReturnValue|Returns '''true''' on success.}} | {{FuncReturnValue|Returns '''true''' on success.}} | ||
Line 17: | Line 17: | ||
[[File:AnimatedBanana.PNG|300px]] | [[File:AnimatedBanana.PNG|300px]] | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
AddEvent("OnObjectStreamIn", function(object) | |||
local | |||
SetObjectAnimatedTexture( | local modelid = GetObjectModel(object) | ||
end | |||
if modelid == 1 then | |||
SetObjectAnimatedTexture(object, GetPackageName().."/client/files/AnimatedBanana.PNG", 2, 4) | |||
end | |||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
[[ | * [[GetObjectCount]] | ||
[[SetObjectColor]] | * [[GetObjectModelCount]] | ||
[[SetObjectEmissiveColor]] | * [[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