|
| Camera (const std::string &name) |
|
| Camera (const ReaderMapping &reader) |
|
virtual void | update (float dt_sec) override |
| This function is called once per frame and allows the object to update it's state. More...
|
|
virtual void | draw (DrawingContext &) override |
| The GameObject should draw itself onto the provided DrawingContext if this function is called. More...
|
|
virtual bool | is_singleton () const override |
| If true only a single object of this type is allowed in a given GameObjectManager.
|
|
virtual bool | is_saveable () const override |
| Indicates if the object will be saved. More...
|
|
virtual std::string | get_class_name () const override |
|
virtual std::string | get_exposed_class_name () const override |
|
virtual std::string | get_display_name () const override |
| Returns the display name of the object, translated to the user's locale.
|
|
virtual GameObjectClasses | get_class_types () const override |
| List notable classes in inheritance hierarchy of class. More...
|
|
virtual ObjectSettings | get_settings () override |
|
virtual void | after_editor_set () override |
|
void | save_state () override |
| Save/check the current state of the object. More...
|
|
void | check_state () override |
|
virtual const std::string | get_icon_path () const override |
|
Rectf | get_rect () const |
|
void | reset (const Vector &tuxpos) |
| reset camera position
|
|
const Vector | get_translation () const |
| return camera position
|
|
void | set_translation (const Vector &translation) |
|
void | set_translation_centered (const Vector &translation) |
|
void | keep_in_bounds (const Rectf &bounds) |
|
void | shake (float duration, float x, float y) |
| shake camera in a direction 1 time
|
|
void | start_earthquake (float strength, float delay) |
| Shake the camera vertically with a specified average strength, at a certain minimal delay, until stopped. More...
|
|
void | stop_earthquake () |
|
void | scroll_to (const Vector &goal, float scrolltime) |
| scroll the upper left edge of the camera in scrolltime seconds to the position goal
|
|
void | move (const Vector &offset) |
|
Vector | get_center () const |
| get the coordinates of the point directly in the center of this camera
|
|
const Vector & | get_position () const |
| get the coordinates of the point directly in the top left of this camera
|
|
const Sizef & | get_screen_size () const |
| get the width and height of the screen
|
|
void | set_mode (Mode mode_) |
|
Mode | get_mode () const |
|
float | get_current_scale () const |
| get the exact scale at this exact moment
|
|
float | get_target_scale () const |
| get the scale towards which the camera is moving
|
|
void | ease_scale (float scale, float time, easing ease, AnchorPoint anchor=AnchorPoint::ANCHOR_MIDDLE) |
| smoothly slide the scale and anchor position of the camera towards a new value
|
|
void | set_pos (float x, float y) |
| Moves the camera to the specified absolute position. More...
|
|
void | move (float x, float y) |
| Moves the camera ""x"" to the left and ""y"" down. More...
|
|
void | set_mode (const std::string &mode) |
| Sets the camera mode. More...
|
|
void | scroll_to (float x, float y, float scrolltime) |
| Scrolls the camera to specific coordinates in ""scrolltime"" seconds. More...
|
|
void | set_scale (float scale) |
| Sets the scale factor. More...
|
|
void | set_scale_anchor (float scale, int anchor) |
| Sets the scale factor and the target position anchor. More...
|
|
void | scale (float scale, float time) |
| Fades to a specified scale factor in ""time"" seconds. More...
|
|
void | scale_anchor (float scale, float time, int anchor) |
| Fades to a specified scale factor and target position anchor in ""time"" seconds. More...
|
|
void | ease_scale (float scale, float time, const std::string &ease) |
| Fades to a specified scale factor in ""time"" seconds with easing (smooth movement). More...
|
|
void | ease_scale_anchor (float scale, float time, int anchor, const std::string &ease) |
| Fades to a specified scale factor and target position anchor in ""time"" seconds with easing (smooth movement). More...
|
|
float | get_screen_width () const |
| Gets the current width of the screen.
|
|
float | get_screen_height () const |
| Gets the current height of the screen.
|
|
float | get_x () const |
| Gets the X coordinate of the top-left corner of the screen.
|
|
float | get_y () const |
| Gets the Y coordinate of the top-left corner of the screen.
|
|
| GameObject (const std::string &name) |
|
| GameObject (const ReaderMapping &reader) |
|
virtual void | finish_construction () |
| Called after all objects have been added to the Sector and the Sector is fully constructed. More...
|
|
UID | get_uid () const |
|
virtual void | save (Writer &writer) |
| This function saves the object. More...
|
|
std::string | save () |
|
virtual std::vector< std::string > | get_patches () const |
| Version checking/updating, patch information.
|
|
virtual void | update_version () |
|
int | get_version () const |
| Returns the current version of the object.
|
|
int | get_latest_version () const |
| Returns the latest version of the object.
|
|
bool | is_up_to_date () const |
| Checks whether the object's current version is equal to its latest one.
|
|
virtual bool | has_variable_size () const |
| Does this object have variable size (secret area trigger, wind, etc.)
|
|
virtual bool | track_state () const |
| Indicates if the object's state should be tracked. More...
|
|
virtual bool | has_object_manager_priority () const |
| Indicates if the object should be added at the beginning of the object list. More...
|
|
virtual bool | has_settings () const |
| Indicates if get_settings() is implemented. More...
|
|
virtual GameObjectTypes | get_types () const |
| Get all types of the object, if available. More...
|
|
int | get_type () const |
| Returns the type index of the object.
|
|
virtual void | on_flip (float height) |
| When level is flipped vertically.
|
|
virtual void | remove_me () |
| schedules this object to be removed at the end of the frame
|
|
bool | is_valid () const |
| returns true if the object is not scheduled to be removed yet
|
|
void | add_remove_listener (ObjectRemoveListener *listener) |
| registers a remove listener which will be called if the object gets removed/destroyed
|
|
void | del_remove_listener (ObjectRemoveListener *listener) |
| unregisters a remove listener, so it will no longer be called if the object gets removed/destroyed
|
|
void | set_name (const std::string &name) |
|
const std::string & | get_name () const |
| Returns the name of the object.
|
|
virtual void | stop_looping_sounds () |
| stops all looping sounds
|
|
virtual void | play_looping_sounds () |
| continues all looping sounds
|
|
template<typename T > |
T * | get_component () |
|
void | add_component (std::unique_ptr< GameObjectComponent > component) |
|
void | remove_component (GameObjectComponent *component) |
|
virtual void | editor_delete () |
| The editor requested the deletion of the object.
|
|
virtual void | editor_select () |
| The user clicked on the object in the editor and selected it.
|
|
virtual void | editor_deselect () |
| The object got deselected.
|
|
virtual void | editor_update () |
| Called each frame in the editor, used to keep linked objects together (e.g. More...
|
|
GameObjectManager * | get_parent () const |
|
void | init_path (const ReaderMapping &mapping, bool running_default) |
| For compatibilty reasons this needs to get the GameObjects main mapping, not the (path ...) mapping.
|
|
void | init_path_pos (const Vector &pos, bool running=false) |
|
PathGameObject * | get_path_gameobject () const |
|
Path * | get_path () const |
|
PathWalker * | get_walker () const |
|
void | editor_clone_path (PathGameObject *path_object) |
|
std::string | get_path_ref () const |
|
void | editor_set_path_by_ref (const std::string &new_ref) |
|
void | goto_node (int node_idx) |
| Moves the path object until at given node, then stops. More...
|
|
void | set_node (int node_idx) |
| Jumps instantly to the given node. More...
|
|
void | start_moving () |
| Starts moving the path object automatically.
|
|
void | stop_moving () |
| Stops moving the path object.
|
|
A ""Camera"" that was given a name can be manipulated by scripts.
An instance named ""Camera"" (""sector.Camera"" in the console) is available.${SRG_NEWPARAGRAPH} 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.