SetObjectEmissiveColor: Difference between revisions

From Onset Developer Wiki
No edit summary
(Added more info regarding EmissiveColor with a barebones example)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{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])}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|object|__EDIT_ME__}}
{{FuncParam|object|The object identifier.}}
{{FuncParam|ColorHex|__EDIT_ME__}}
{{FuncParam|ColorHex|Hexadecimal color value}}
{{FuncParam|EmissiveStrength|__EDIT_ME__}}
{{FuncParam|EmissiveStrength|The strength/brightness of the glow}}
{{FuncParamOptional|MaterialSlot|__EDIT_ME__}}
{{FuncParamOptional|MaterialSlot|The material slot of the object model}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|__EDIT_ME__}}


== Example ==
== Example ==
__EDIT_ME__
<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}}

Revision as of 18:56, 19 December 2019

SetObjectEmissiveColor

Type: Function
Context: Client
Introduced: v1.0

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

  • __EDIT_ME__

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