File: GetPXSCount.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 (61 lines) | stat: -rw-r--r-- 2,115 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
55
56
57
58
59
60
61
<?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>GetPXSCount</title>
    <category>Landscape</category>
    <subcat>Material</subcat>
    <version>5.2 OC</version>
    <syntax>
      <rtype>int</rtype>
      <params>
        <param>
          <type>int</type>
          <name>material</name>
          <desc>Index of material. If nil or -1, any material is counted.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>x</name>
          <desc>Left side of search rectangle. Offset in local calls. Set to nil to search the whole map.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>y</name>
          <desc>Top side of search rectangle. Offset in local calls.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>wdt</name>
          <desc>Width of search rectangle. Right border is not included in search.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>wdt</name>
          <desc>Height of search rectangle. Bottom border is not included in search.</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Determines how many loose pixels (PXS) are present of a given material in a given rectangle.</desc>
    <examples>
      <example>
        <code><funclink>if</funclink>(GetPXSCount(<funclink>Material</funclink>(&quot;Snow&quot;), -100,-100,200,100) > 5) <funclink>Message</funclink>(&quot;It is snowing!&quot;);</code>
        <text>Part of a clonk script: if snow is found around the clonk, he shows a message above his head.</text>
      </example>
    </examples>
    <related>
      <funclink>Material</funclink>
      <funclink>CastPXS</funclink>
      <funclink>InsertMaterial</funclink>
      <funclink>GetMaterial</funclink>
    </related>
  </func>
  <author>Sven2</author><date>2014-12</date>
</funcs>