File: SetLightRange.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (54 lines) | stat: -rw-r--r-- 1,932 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>SetLightRange</title>
    <category>Objects</category>
    <version>6.0 OC</version>
    <syntax>
      <rtype>void</rtype>
      <params>
        <param>
          <type>int</type>
          <name>range</name>
          <desc>Light reach in pixels. In this range, the light has 100% intensity.</desc>
        </param>
        <param>
          <type>int</type>
          <name>fadeout</name>
          <desc>Light fadeout reach in pixels. Default is 80. If the range is set to 0 and this parameter is not defined, the fadeout will also be 0.</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Sets the light reach of the object. When a clonk is added to the crew via <funclink>MakeCrewMember</funclink>, a light is added automatically with the default range of 300 and a fadeout of 80.</desc>
    <remark>A local offset for the light center can be defined by setting the object property LightOffset to an array with two elements for X- and Y-offset respectively.</remark>
    <examples>
      <example>
        <code>func ControlUse(object clonk)
{
	clonk-&gt;SetLightRange(0);
	<funclink>Sound</funclink>(&quot;Scream&quot;);
	return true;
}</code>
        <text>Confused the acid phile with the eye drops, did ya?</text>
      </example>
      <example>
        <code>func Construction()
{
	SetLightRange(100, 100);
	this.LightOffset = [0,-100];
	return true;
}</code>
        <text>Script for a lamp post. A light coming from 100 pixel above the object center is enabled when the object is created.</text>
      </example>
    </examples>
    <related>
      <funclink>SetPlrView</funclink>
      <funclink>SetFoW</funclink>
      <funclink>SetLightColor</funclink>
    </related>
  </func>
</funcs>