Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
CallFunc Class Reference

Calls a 'callback'. More...

#include <ActionInstant.h>

Inherits ActionInstant.

Inherited by CallFuncN.

Public Member Functions

virtual void execute ()
 Executes the callback.
 
virtual void update (float time) override
 
bool initWithFunction (const std::function< void()> &func)
 initializes the action with the std::function<void()> @lua NA
 
- Public Member Functions inherited from ActionInstant
virtual void step (float dt) override
 

Static Public Member Functions

static CallFunccreate (const std::function< void()> &func)
 Creates the action with the callback of type std::function<void()>.
 

Detailed Description

Calls a 'callback'.

Member Function Documentation

◆ create()

static CallFunc * create ( const std::function< void()> & func)
static

Creates the action with the callback of type std::function<void()>.

This is the preferred way to create the callback. When this function bound in js or lua ,the input param will be changed. In js: var create(var func, var this, var [data]) or var create(var func). In lua:local create(local funcID).

Parameters
funcA callback function need to be executed.
Returns
An autoreleased CallFunc object.

◆ update()

virtual void update ( float time)
overridevirtual
Parameters
timeIn seconds.

Reimplemented from ActionInstant.


The documentation for this class was generated from the following file: