Skip to content

Commit

Permalink
Update scripting reference (SuperTux/supertux@47541be)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperTux-bot committed Jul 8, 2024
1 parent d0a4083 commit bf00508
Show file tree
Hide file tree
Showing 35 changed files with 431 additions and 431 deletions.
8 changes: 4 additions & 4 deletions ScriptingAmbientSound.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Summary
-------

An `AmbientSound` that was given a name can be controlled by scripts
An `AmbientSound` that was given a name can be controlled by scripts.

Instances
--------

An `AmbientSound` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.
An `AmbientSound` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.

Inheritance
--------
Expand All @@ -24,8 +24,8 @@ Methods

Method | Explanation
-------|-------
`float get_pos_x()` | **Deprecated!** Use `get_x()` instead!<br /><br />Returns the ambient sound's X coordinate
`float get_pos_y()` | **Deprecated!** Use `get_y()` instead!<br /><br />Returns the ambient sound's Y coordinate
`float get_pos_x()` | **Deprecated!** Use `get_x()` instead! <br /><br />Returns the ambient sound's X coordinate.
`float get_pos_y()` | **Deprecated!** Use `get_y()` instead! <br /><br />Returns the ambient sound's Y coordinate.


Variables
Expand Down
20 changes: 10 additions & 10 deletions ScriptingAnchorPoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Summary
-------

This module contains global anchor constants
This module contains global anchor constants.

Instances
--------
Expand All @@ -30,13 +30,13 @@ Constants

Constant | Explanation
---------|---------
`int ANCHOR_TOP_LEFT = 0` | Top-left anchor point.
`int ANCHOR_TOP = 1` | Top anchor point.
`int ANCHOR_TOP_RIGHT = 2` | Top-right anchor point.
`int ANCHOR_LEFT = 3` | Left anchor point.
`int ANCHOR_MIDDLE = 4` | Middle anchor point.
`int ANCHOR_RIGHT = 5` | Right anchor point.
`int ANCHOR_BOTTOM_LEFT = 6` | Bottom-left anchor point.
`int ANCHOR_BOTTOM = 7` | Bottom anchor point.
`int ANCHOR_BOTTOM_RIGHT = 8` | Bottom-right anchor point.
`int ANCHOR_TOP_LEFT = 0` | Top-left anchor point.
`int ANCHOR_TOP = 1` | Top anchor point.
`int ANCHOR_TOP_RIGHT = 2` | Top-right anchor point.
`int ANCHOR_LEFT = 3` | Left anchor point.
`int ANCHOR_MIDDLE = 4` | Middle anchor point.
`int ANCHOR_RIGHT = 5` | Right anchor point.
`int ANCHOR_BOTTOM_LEFT = 6` | Bottom-left anchor point.
`int ANCHOR_BOTTOM = 7` | Bottom anchor point.
`int ANCHOR_BOTTOM_RIGHT = 8` | Bottom-right anchor point.

22 changes: 11 additions & 11 deletions ScriptingBackground.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Summary
-------

A `Background` that was given a name can be manipulated by scripts
A `Background` that was given a name can be manipulated by scripts.

Instances
--------

A `Background` can be accessed by its name from a script or via `sector.name` from the console.
A `Background` can be accessed by its name from a script or via `sector.name` from the console.

Inheritance
--------
Expand All @@ -22,15 +22,15 @@ Methods

Method | Explanation
-------|-------
`void set_image(string image)` | Sets the background's image
`void set_images(string top_image, string middle_image, string bottom_image)` | Sets the top, middle and bottom background images
`void set_speed(float speed)` | Sets the background speed
`float get_color_red()` | Returns the red color value
`float get_color_green()` | Returns the green color value
`float get_color_blue()` | Returns the blue color value
`float get_color_alpha()` | Returns the alpha color value
`void set_color(float red, float green, float blue, float alpha)` | Sets the background color
`void fade_color(float red, float green, float blue, float alpha, float time)` | Fades to specified background color in `time` seconds
`void set_image(string image)` | Sets the background's image.
`void set_images(string top_image, string middle_image, string bottom_image)` | Sets the top, middle and bottom background images.
`void set_speed(float speed)` | Sets the background speed.
`float get_color_red()` | Returns the red color value.
`float get_color_green()` | Returns the green color value.
`float get_color_blue()` | Returns the blue color value.
`float get_color_alpha()` | Returns the alpha color value.
`void set_color(float red, float green, float blue, float alpha)` | Sets the background color.
`void fade_color(float red, float green, float blue, float alpha, float time)` | Fades to specified background color in `time` seconds.


Variables
Expand Down
8 changes: 4 additions & 4 deletions ScriptingBadGuy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Summary
-------

A `BadGuy` that was given a name can be controlled by scripts.
A `BadGuy` that was given a name can be controlled by scripts.

Instances
--------

A `BadGuy` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.
A `BadGuy` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.

Inheritance
--------
Expand Down Expand Up @@ -97,8 +97,8 @@ Methods

Method | Explanation
-------|-------
`void kill()` | Sets the badguy to kill/falling state, which makes it fall of the screen (its sprite is turned upside-down)
`void ignite()` | Kills the badguy by igniting it
`void kill()` | Sets the badguy to kill/falling state, which makes it fall of the screen (its sprite is turned upside-down).
`void ignite()` | Kills the badguy by igniting it.


Variables
Expand Down
32 changes: 16 additions & 16 deletions ScriptingCamera.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Summary
-------

A `Camera` that was given a name can be manipulated by scripts
A `Camera` that was given a name can be manipulated by scripts.

Instances
--------

An instance named `Camera` (`sector.Camera` in the console) is available.

The mode of the camera is either `normal` (the camera is following the player) or `autoscroll`. In the latter mode, the camera is forced along a specified path.
The mode of the camera is either `normal` (the camera is following the player) or `autoscroll`. In the latter mode, the camera is forced along a specified path.

Inheritance
--------
Expand All @@ -25,20 +25,20 @@ Methods

Method | Explanation
-------|-------
`void set_pos(float x, float y)` | Moves the camera to the specified absolute position
`void move(float x, float y)` | Moves the camera `x` to the left and `y` down
`void set_mode(string mode)` | Sets the camera mode<br /><br /> `mode` - The mode can be "normal" or "manual".
`void scroll_to(float x, float y, float scrolltime)` | Scrolls the camera to specific coordinates in `scrolltime` seconds
`void set_scale(float scale)` | Sets the scale factor
`void set_scale_anchor(float scale, int anchor)` | Sets the scale factor and the target position anchor<br /><br /> `anchor` - Anchor point as represented by the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`void scale(float scale, float time)` | Fades to a specified scale factor in `time` seconds
`void scale_anchor(float scale, float time, int anchor)` | Fades to a specified scale factor and target position anchor in `time` seconds<br /><br /> `anchor` - Anchor point as represented by the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`void ease_scale(float scale, float time, string ease)` | Fades to a specified scale factor in `time` seconds with easing (smooth movement)
`void ease_scale_anchor(float scale, float time, int anchor, string ease)` | Fades to a specified scale factor and target position anchor in `time` seconds with easing (smooth movement)<br /><br /> `anchor` - Anchor point as represented by the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`float get_screen_width()` | Gets the current width of the screen
`float get_screen_height()` | Gets the current height of the screen
`float get_x()` | Gets the X coordinate of the top-left corner of the screen
`float get_y()` | Gets the Y coordinate of the top-left corner of the screen
`void set_pos(float x, float y)` | Moves the camera to the specified absolute position.
`void move(float x, float y)` | Moves the camera `x` to the left and `y` down.
`void set_mode(string mode)` | Sets the camera mode.<br /><br /> `mode` - The mode can be "normal" or "manual".
`void scroll_to(float x, float y, float scrolltime)` | Scrolls the camera to specific coordinates in `scrolltime` seconds.
`void set_scale(float scale)` | Sets the scale factor.
`void set_scale_anchor(float scale, int anchor)` | Sets the scale factor and the target position anchor.<br /><br /> `anchor` - Anchor point as represented by the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`void scale(float scale, float time)` | Fades to a specified scale factor in `time` seconds.
`void scale_anchor(float scale, float time, int anchor)` | Fades to a specified scale factor and target position anchor in `time` seconds.<br /><br /> `anchor` - Anchor point as represented by the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`void ease_scale(float scale, float time, string ease)` | Fades to a specified scale factor in `time` seconds with easing (smooth movement).
`void ease_scale_anchor(float scale, float time, int anchor, string ease)` | Fades to a specified scale factor and target position anchor in `time` seconds with easing (smooth movement).<br /><br /> `anchor` - Anchor point as represented by the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`float get_screen_width()` | Gets the current width of the screen.
`float get_screen_height()` | Gets the current height of the screen.
`float get_x()` | Gets the X coordinate of the top-left corner of the screen.
`float get_y()` | Gets the Y coordinate of the top-left corner of the screen.


Variables
Expand Down
10 changes: 5 additions & 5 deletions ScriptingCandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Summary
-------

A `Candle` that was given a name can be controlled by scripts.
A `Candle` that was given a name can be controlled by scripts.

Instances
--------

A `Candle` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.
A `Candle` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.

Inheritance
--------
Expand All @@ -25,9 +25,9 @@ Methods

Method | Explanation
-------|-------
`void puff_smoke()` | Spawns a puff of smoke
`bool get_burning()` | Returns `true` if the candle is lit up
`void set_burning(bool burning)` | Sets the burning state of the candle<br /><br /> `burning` - If `true`, the candle is lit up. If `false`, it's extinguished.
`void puff_smoke()` | Spawns a puff of smoke.
`bool get_burning()` | Returns `true` if the candle is lit up.
`void set_burning(bool burning)` | Sets the burning state of the candle.<br /><br /> `burning` - If `true`, the candle is lit up. If `false`, it's extinguished.


Variables
Expand Down
10 changes: 5 additions & 5 deletions ScriptingCloudParticleSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Summary
-------

A `CloudParticleSystem` that was given a name can be controlled by scripts
A `CloudParticleSystem` that was given a name can be controlled by scripts.

Instances
--------

A `CloudParticleSystem` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.
A `CloudParticleSystem` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.

Inheritance
--------
Expand All @@ -23,9 +23,9 @@ Methods

Method | Explanation
-------|-------
`void fade_speed(float speed, float time)` | Smoothly changes the rain speed to the given value in `time` seconds
`void fade_amount(int amount, float time, float time_between)` | Smoothly changes the amount of particles to the given value in `time` seconds
`void set_amount(int amount, float time)` | Smoothly changes the amount of particles to the given value in `time` seconds
`void fade_speed(float speed, float time)` | Smoothly changes the rain speed to the given value in `time` seconds.
`void fade_amount(int amount, float time, float time_between)` | Smoothly changes the amount of particles to the given value in `time` seconds.
`void set_amount(int amount, float time)` | Smoothly changes the amount of particles to the given value in `time` seconds.


Variables
Expand Down
4 changes: 2 additions & 2 deletions ScriptingConveyorBelt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Summary
-------

A `ConveyorBelt` that was given a name can be controlled by scripts.
A `ConveyorBelt` that was given a name can be controlled by scripts.

Instances
--------

A `ConveyorBelt` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.
A `ConveyorBelt` is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via `sector.name` from the console.

Inheritance
--------
Expand Down
Loading

0 comments on commit bf00508

Please sign in to comment.