Skip to content

ScriptingFloatingImage

SuperTux Bot edited this page Aug 12, 2024 · 7 revisions

This file is auto-generated from the SuperTux source code, using the template ScriptingPage.md.

Summary

This class provides the ability to create, edit, and remove images floating in midair on the screen.

Instances

Floating Images are created in a script or from the console. Constructor:

<floatimage> <- FloatingImage(string filename)

This creates a FloatingImage from filename (which is relative to the data directory root).

Inheritance

This class inherits functions and variables from the following base classes:

Methods

Method Explanation
void set_layer(int layer) Sets the layer of the floating image.
int get_layer() Returns the layer the floating image is on.
void set_pos(float x, float y) Sets the location of the image in relation to the current anchor point.
float get_x() Returns the image's X coordinate relative to the current anchor point.
float get_y() Returns the image's Y coordinate relative to the current anchor point.
float get_pos_x() Deprecated! Use get_x() instead!

Returns the image's X coordinate relative to the current anchor point.
float get_pos_y() Deprecated! Use get_y() instead!

Returns the image's Y coordinate relative to the current anchor point.
void set_anchor_point(int anchor) Sets the image's anchor point.

anchor - Anchor point as represented by the ANCHOR_* constants (see AnchorPoints).
int get_anchor_point() Returns the current anchor point.
void set_visible(bool visible) Sets the visibility of the floating image.
bool get_visible() Returns the visibility state of the floating image.
void set_action(string action) Sets the action of the image.

action - Name of the action, as defined in the sprite.
string get_action() Returns the name of the action of the image, as defined in the sprite.
void fade_in(float time) Fades in the image for the next time seconds.
void fade_out(float time) Fades out the image for the next time seconds.

Variables

Variable Explanation
int layer
bool visible
int anchor_point The current anchor point.

Constants

None.

Clone this wiki locally