User Tools

Site Tools


set_entity_light_color

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
set_entity_light_color [2017/08/09 07:11] justinset_entity_light_color [2021/04/21 18:50] (current) justin
Line 2: Line 2:
 ---- ----
  
-Changes the color of the light attached to the specified entity over a duration of time (with the assumption that the entity is a light source).+Changes the [[color]] of the light attached to the specified [[entity]] over a duration of time (with the assumption that the [[entity]] is a light source).
  
 +====Signature:====
 <code python> <code python>
 set_entity_light_color(entity, color, duration) set_entity_light_color(entity, color, duration)
Line 9: Line 10:
  
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
-|entity|Entity that will have its light color changed.|[[String]]|Yes| +|entity|[[Entity]] that will have its light [[color]] changed.|[[Entity]]|Yes| 
-|color|New color for the light.|[[Color]]|Yes| +|color|New [[color]] for the light.|[[Color]]|Yes| 
-|duration|Duration of the change from current color to new color.|[[Decimal]]|No|+|duration|Fade duration from its current [[color]] to the new [[color]].|[[Number]]|No| 
 + 
 +<WRAP center round info 100%> 
 +If you'd like to instantly toggle the [[entity|entity's]] light on or off instead of changing its [[color]], see the related [[Set Entity Light Enabled]] function. 
 +</WRAP>
  
 ====Example:==== ====Example:====
-<code lua+<code bauxite
-set_entity_light_color(self, color[255, 0, 255], 1)+set_entity_light_color(self, color[255, 0, 255], 1);
 </code> </code>
-//Results:// The entity to which the script is attached (i.e. "self") will have the color of its light changed to purple over a duration of one second.+//Results:// The [[entity]] to which the [[script]] is attached (i.e. "self") will have the [[color]] of its light change to magenta over a duration of one second.
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Load Map** function to launch an initial map from your game's startup script or to link tile in one map to another (for example, stairs leading down into dungeon).+Use the **Set Entity Light Color** function to dim/brighten lamp in a room or to emulate multi-color light (like an LED on an electronic device).
 </WRAP> </WRAP>
  
Line 30: Line 35:
  
 <WRAP half column> <WRAP half column>
-====Visual Demo:==== +====Visual Demo:====
 {{:wiki:set_entity_light_color_demo.gif?nolink|}} {{:wiki:set_entity_light_color_demo.gif?nolink|}}
 </WRAP> </WRAP>
set_entity_light_color.1502287865.txt.gz · Last modified: 2017/08/09 07:11 by justin