Skip to content

TutorialWindow

#include "GUI/Elements/Windows/TutorialWindow.h"

Inherits from IWindow, ITutorialRenderer, std::enable_shared_from_this< IWindow >

Public Functions

Name
TutorialWindow(bool show)
voidemptyTutorial()
Ptr< Tutorial >getTutorial()
boolhasTutorial() const
voidreloadTutorial()
virtual voidrender() override<br>Renders the tutorial window using ImGui.
voidsetStep(int step_number)<br>Sets which step of currently set tutorial should be shown.
voidsetTutorial(std::shared_ptr< Tutorial > tutorial)<br>Sets the passed tutorial as the current one.
voidsetTutorial(std::shared_ptr< TutorialHeader > & header)<br>Calls load and parse for a tutorial from file and sets it as the current one to be shown.
voidsetTutorial(std::string path)<br>Calls load and parse for a tutorial from file and sets it as the current one to be shown.

Additional inherited members

Public Functions inherited from IWindow

Name
IWindow(std::string title, bool show =false)
virtual~IWindow() =default
virtual const char *getID() const =0
WPtr< InputController >getInput()<br>Returns window input controller.
const char *getName()
bool *getShowPtr()
const std::string &getTitle() const
voidhide()
boolisVisible() const
const voidsetTitle(std::string title)
voidshow()

Protected Functions inherited from IWindow

Name
voidupdateWindowInfo()<br>Collect information about the current window.

Public Attributes inherited from IWindow

Name
boolm_autoFocus <br>When true the window will get focus immediately upon hovering over it.
std::stringm_title <br>Visible window title.
boolm_windowInfoUpdated <br>A flag indicating the updateWindowInfo() method was called.
WindowManager *m_windowManager <br>Weak reference to a WindowManager set when this window is added to it.
glm::vec2m_windowMax <br>Bottom right corner of the window.
glm::vec2m_windowMin <br>Top left corner of the window, same as m_windowPos (separate variable for clarity)
glm::vec2m_windowPos <br>Top-left corner of the window in screen coordinates.
glm::ivec2m_windowSize <br>Window width and height dimensions.

Protected Attributes inherited from IWindow

Name
Ptr< InputController >m_input
std::stringm_name <br>Full ImGui window identifier.
boolm_nameNeedsUpdate <br>Workaround to avoid setting the name in the constructor (cannot call getID there)
boolm_show

Friends inherited from IWindow

Name
classWindowManager

Public Functions inherited from ITutorialRenderer

Name
virtual~ITutorialRenderer() =default

Public Functions Documentation

function TutorialWindow

cpp
TutorialWindow(
    bool show
)
TutorialWindow(
    bool show
)

function emptyTutorial

cpp
void emptyTutorial()
void emptyTutorial()

function getTutorial

cpp
inline Ptr< Tutorial > getTutorial()
inline Ptr< Tutorial > getTutorial()

function hasTutorial

cpp
bool hasTutorial() const
bool hasTutorial() const

function reloadTutorial

cpp
void reloadTutorial()
void reloadTutorial()

function render

cpp
virtual void render() override
virtual void render() override

Renders the tutorial window using ImGui.

Reimplements: IWindow::render

function setStep

cpp
void setStep(
    int step_number
)
void setStep(
    int step_number
)

Sets which step of currently set tutorial should be shown.

Parameters:

  • step_number A step number counted from 0.

Return: true if successful, false if number out of range or no currently set tutorial

function setTutorial

cpp
void setTutorial(
    std::shared_ptr< Tutorial > tutorial
)
void setTutorial(
    std::shared_ptr< Tutorial > tutorial
)

Sets the passed tutorial as the current one.

Parameters:

  • tutorial Ptr to an already loaded tutorial

function setTutorial

cpp
void setTutorial(
    std::shared_ptr< TutorialHeader > & header
)
void setTutorial(
    std::shared_ptr< TutorialHeader > & header
)

Calls load and parse for a tutorial from file and sets it as the current one to be shown.

Parameters:

  • header Ptr to an already loaded tutorial header object describing a specific tutorial.

function setTutorial

cpp
void setTutorial(
    std::string path
)
void setTutorial(
    std::string path
)

Calls load and parse for a tutorial from file and sets it as the current one to be shown.

Parameters:

  • path Path to the .tut file to be loaded. All dependent files (such as pictures) should lie in the same folder.

Updated on 2024-11-06 at 20:16:53 +0000