SetObjectEmissiveColor: Difference between revisions

From Onset Developer Wiki
Justus (talk | contribs)
Added more info regarding EmissiveColor with a barebones example
Justus (talk | contribs)
m Added image of in game example
Line 4: Line 4:


{{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|The object identifier.}}
{{FuncParam|object|The object identifier.}}

Revision as of 19:02, 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])
Glowing Hat Example (0x000FF)

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