Skip to content

Commit

Permalink
Update scripting reference (SuperTux/supertux@50743fb)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperTux Bot committed Jan 7, 2024
1 parent 532e097 commit 6527038
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions ScriptingTextArray.md → ScriptingTextArrayObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
Summary
-------

A `TextArrayObject` that was given a name can be controlled by scripts.
A `TextArrayObject` that was given a name (or manually instantiated) can be controlled by scripts.

Instance
--------

A `TextArrayObject` 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 `TextArrayObject` instance is already provided in sectors under `sector.TextArray`.

A `TextArrayObject` can also be created in a script or from the console. Constructor:

```<textarrayobj> <- TextArrayObject()```

Methods
-------
Expand Down
10 changes: 8 additions & 2 deletions ScriptingText.md → ScriptingTextObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
Summary
-------

A `TextObject` that was given a name can be controlled by scripts.
A `TextObject` that was given a name (or manually instantiated) can be controlled by scripts.

Instance
--------

A `TextObject` 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 `TextObject` instance is already provided in sectors under `sector.Text`.

A `TextObject` can also be created in a script or from the console. Constructor:

```<textobj> <- TextObject()```

Methods
-------
Expand All @@ -29,6 +33,8 @@ Method | Explanation
`set_anchor_point(int anchor)` | Sets the anchor point of the text. <br /><br /> `anchor` - One of the `ANCHOR_*` constants (see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`get_anchor_point()` | Returns the current anchor point of the text (one of the `ANCHOR_*` constants; see [AnchorPoints](https://github.com/SuperTux/supertux/wiki/ScriptingAnchorPoints)).
`set_anchor_offset(float x, float y)` | Sets the anchor offset of the text.
`get_wrap_width()` | Gets the text wrap width of the text.
`set_wrap_width(float width)` | Sets the text wrap width of the text.
`set_front_fill_color(float red, float green, float blue, float alpha)` | Sets the front fill color of the text.
`set_back_fill_color(float red, float green, float blue, float alpha)` | Sets the back fill color of the text.
`set_text_color(float red, float green, float blue, float alpha)` | Sets the text color.
Expand Down
4 changes: 2 additions & 2 deletions Scripting_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ using a function that actually doesn't exist.
* [Sector](https://github.com/SuperTux/supertux/wiki/ScriptingSector)
* [SoundObject](https://github.com/SuperTux/supertux/wiki/ScriptingSoundObject)
* [Spotlight](https://github.com/SuperTux/supertux/wiki/ScriptingSpotlight)
* [Text](https://github.com/SuperTux/supertux/wiki/ScriptingText)
* [TextArray](https://github.com/SuperTux/supertux/wiki/ScriptingTextArray)
* [TextArrayObject](https://github.com/SuperTux/supertux/wiki/ScriptingTextArrayObject)
* [TextObject](https://github.com/SuperTux/supertux/wiki/ScriptingTextObject)
* [Thunderstorm](https://github.com/SuperTux/supertux/wiki/ScriptingThunderstorm)
* [TileMap](https://github.com/SuperTux/supertux/wiki/ScriptingTileMap)
* [Torch](https://github.com/SuperTux/supertux/wiki/ScriptingTorch)
Expand Down

0 comments on commit 6527038

Please sign in to comment.