emfunctions.hpp

Specialized, useful function for Empirical.

Defines

AlertVar(VAR)

Functions

static void DelayCall(const std::function<void()> &in_fun, int delay)

Call a function after a specified amount of time.

static void OnResize(const std::function<void()> &in_fun)

Provide a function to call whenever a window’s size changes (no arguments).

static void OnResize(const std::function<void(int, int)> &in_fun)

Provide a function to call whenever a window’s size changes (new size as arguments)

inline double GetTime()

Get the current time, as provided by the web browser.

inline int GetWindowInnerWidth()

Determine with width of the current window.

inline int GetWindowInnerHeight()

Determine with height of the current window.

static void SetBackgroundColor(const std::string color)

Set the background color of this web page.

static void SetColor(const std::string color)
static void SetCursor(const char *type)
static void OpenWindow(const std::string &url)
static std::string text2html(const std::string &text)
inline std::string GetElementAttribute(const std::string &id, const std::string &attribute)

Get the value of.

Parameters:
  • attribute – in the element with

  • id – as its id.