File: SetPlayerZoomByViewRange.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 (90 lines) | stat: -rw-r--r-- 3,665 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?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>SetPlayerZoomByViewRange</title>
    <category>Player</category>
    <subcat>View</subcat>
    <version>5.1 OC</version>
    <syntax>
      <rtype>bool</rtype>
      <params>
        <param>
          <type>int</type>
          <name>player</name>
          <desc>Player whose zoom or zoom limits are to be adjusted. NO_OWNER for all players.</desc>
        </param>
        <param>
          <type>int</type>
          <name>range_x</name>
          <desc>Horizontal range that should be covered by the zoom. Zero to use range_y only. If both range_x and range_y are zero, a default range is assumed for range_x.</desc>
        </param>
        <param>
          <type>int</type>
          <name>range_y</name>
          <desc>Vertical range that should be covered by the zoom. Zero to use range_x only. If both range_x and range_y are nonzero, the number that yields the smaller zoom is used.</desc>
        </param>
        <param>
          <type>int</type>
          <name>flags</name>
          <desc>Flags controlling function behaviour:
            <table>
              <rowh>
                <col>Flag</col>
                <col>Description</col>
              </rowh>
              <row>
                <literal_col>PLRZOOM_Direct</literal_col>
                <col>The zoom does not scroll slowly towards the new value, but is set directly.</col>
              </row>
              <row>
                <literal_col>PLRZOOM_NoIncrease</literal_col>
                <col>The new zoom ranges are only to be set if they are smaller than the current values.</col>
              </row>
              <row>
                <literal_col>PLRZOOM_NoDecrease</literal_col>
                <col>The new zoom ranges are only to be set if they are greater than the current values.</col>
              </row>
              <row>
                <literal_col>PLRZOOM_LimitMin</literal_col>
                <col>Set the minimum limit for zooming. The player cannot zoom out further than this.</col>
              </row>
              <row>
                <literal_col>PLRZOOM_LimitMax</literal_col>
                <col>Set the maximum limit for zooming. The player cannot zoom in further than this.</col>
              </row>
              <row>
                <literal_col>PLRZOOM_Set</literal_col>
                <col>Set the current zoom. This flag is implied if neither PLRZOOM_LimitMin nor PLRZOOM_LimitMax is supplied but can be used if current zoom and limits should be set simultanuously.</col>
              </row>
            </table>
          </desc>
        </param>
      </params>
    </syntax>
    <desc>Adjusts the zoom or zoom limit of all viewports of a player.</desc>
    <examples>
      <example>
        <code>func InitializePlayer(int plr)
{
  SetPlayerZoomByViewRange(plr, 1000, 0, PLRZOOM_LimitMin);
  SetPlayerZoomByViewRange(plr, 1000, 0, PLRZOOM_LimitMax);
  <funclink>SetPlayerViewLock</funclink>(plr, true);
  return true;
}</code>
        <text>Code for a scenario script: Players can see exactly 1000 pixels wide around their Clonk and cannot scroll further.</text>
      </example>
    </examples>
    <related>
      <funclink>SetPlayerZoom</funclink>
      <funclink>GetPlayerZoomLimits</funclink>
      <funclink>SetPlayerViewLock</funclink>
      <funclink>SetPlrView</funclink>
      <funclink>SetLightRange</funclink>
      <funclink>SetFoW</funclink>
    </related>
  </func>
  <author>Sven2</author><date>2010-09</date>
</funcs>