SetObjectEmissiveColor: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetObjectEmissiveColor(object, ColorHex, EmissiveStrength [, MaterialSlot])}} {{FuncParameters}} {..." |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Makes an object glow with a specified hexadecimal value, intensity and material slot on the object}} | ||
{{FuncSyntax|SetObjectEmissiveColor(object, ColorHex, EmissiveStrength [, MaterialSlot])}} | {{FuncSyntax|SetObjectEmissiveColor(object, ColorHex, EmissiveStrength [, MaterialSlot])}} | ||
<div class="noprint" style="float:right;"> | |||
[[File:glowing hat example.png|thumb|right|Glowing Hat Example (0x000FF)]] | |||
</div> | |||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|object| | {{FuncParam|object|The object identifier.}} | ||
{{FuncParam|ColorHex| | {{FuncParam|ColorHex|Hexadecimal color value}} | ||
{{FuncParam|EmissiveStrength| | {{FuncParam|EmissiveStrength|The strength/brightness of the glow}} | ||
{{FuncParamOptional|MaterialSlot| | {{FuncParamOptional|MaterialSlot|The material slot of the object model}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' on success.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function OnObjectStreamIn(object) | |||
local glow = GetObjectPropertyValue(object, "glow") -- 0x0000FF | |||
if glow ~= nil then | |||
local intensity = 30 | |||
SetObjectEmissiveColor(object, glow, intensity ) | |||
end | |||
end | |||
AddEvent("OnObjectStreamIn", OnObjectStreamIn) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetObjectCount]] | |||
* [[GetObjectModelCount]] | |||
* [[GetObjectModelGroup]] | |||
* [[GetObjectModelName]] | |||
* [[GetStreamedObjects]] | |||
* [[GetObjectModel]] | |||
* [[GetObjectLocation]] | |||
* [[GetObjectRotation]] | |||
* [[GetObjectScale]] | |||
* [[GetObjectBoundingBox]] | |||
* [[GetObjectSize]] | |||
* [[EnableObjectHitEvents]] | |||
* [[GetObjectMass]] | |||
* [[SetObjectEditorSpeed]] | |||
* [[SetObjectEditable]] | |||
* [[SetObjectOutline]] | |||
* [[SetObjectCastShadow]] | |||
* [[SetObjectColor]] | |||
* [[SetObjectTexture]] | |||
* [[SetObjectAnimatedTexture]] |
Latest revision as of 18:29, 30 August 2020
Description
Makes an object glow with a specified hexadecimal value, intensity and material slot on the object
Syntax
SetObjectEmissiveColor(object, ColorHex, EmissiveStrength [, MaterialSlot])
Parameters
- object
The object identifier. - ColorHex
Hexadecimal color value - EmissiveStrength
The strength/brightness of the glow - MaterialSlot (optional)
The material slot of the object model
Return Value
- Returns true on success.
Example
function OnObjectStreamIn(object)
local glow = GetObjectPropertyValue(object, "glow") -- 0x0000FF
if glow ~= nil then
local intensity = 30
SetObjectEmissiveColor(object, glow, intensity )
end
end
AddEvent("OnObjectStreamIn", OnObjectStreamIn)
See also
- GetObjectCount
- GetObjectModelCount
- GetObjectModelGroup
- GetObjectModelName
- GetStreamedObjects
- GetObjectModel
- GetObjectLocation
- GetObjectRotation
- GetObjectScale
- GetObjectBoundingBox
- GetObjectSize
- EnableObjectHitEvents
- GetObjectMass
- SetObjectEditorSpeed
- SetObjectEditable
- SetObjectOutline
- SetObjectCastShadow
- SetObjectColor
- SetObjectTexture
- SetObjectAnimatedTexture