-
-
Notifications
You must be signed in to change notification settings - Fork 491
ScriptingCamera
SuperTux Bot edited this page Jul 8, 2024
·
9 revisions
This file is auto-generated from the SuperTux source code, using the template ScriptingPage.md.
A Camera
that was given a name can be manipulated by scripts.
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.
This class inherits functions and variables from the following base classes:
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.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.anchor - Anchor point as represented by the ANCHOR_* constants (see AnchorPoints). |
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.anchor - Anchor point as represented by the ANCHOR_* constants (see AnchorPoints). |
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).anchor - Anchor point as represented by the ANCHOR_* constants (see AnchorPoints). |
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. |
None.
None.
Home
Guidelines
Game Mechanics
Tools
Engine
- Cameras in other games
- Collision
- Configuration File
- Console
- Cutscenes
- Game_Engine
- Lighting
- Map_transformer
- Portables
- SceneGraph
- Scripting
Specifications
Milestones
- Milestone 1 Analysis
- Milestone 2 Design Document
- Milestone 2 Design Document Old
- Milestone 3 Design Document
Building (mostly outdated)
- INSTALL.md
- Building
- Building on macOS
- Building SuperTux
- Building on Windows
- Building with MXE (cross-compile)
Meetings