mirror of https://github.com/axmolengine/axmol.git
changes needed for swift bindings to work
This commit is contained in:
parent
30c8f42217
commit
92e08265cd
|
@ -1310,6 +1310,9 @@ Mat4 Node::transform(const Mat4& parentTransform)
|
|||
|
||||
void Node::onEnter()
|
||||
{
|
||||
if (onEnterCallback)
|
||||
onEnterCallback();
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
|
@ -1337,6 +1340,9 @@ void Node::onEnter()
|
|||
|
||||
void Node::onEnterTransitionDidFinish()
|
||||
{
|
||||
if (onEnterTransitionDidFinishCallback)
|
||||
onEnterTransitionDidFinishCallback();
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
|
@ -1359,6 +1365,9 @@ void Node::onEnterTransitionDidFinish()
|
|||
|
||||
void Node::onExitTransitionDidStart()
|
||||
{
|
||||
if (onExitTransitionDidStartCallback)
|
||||
onExitTransitionDidStartCallback();
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
|
@ -1380,6 +1389,9 @@ void Node::onExitTransitionDidStart()
|
|||
|
||||
void Node::onExit()
|
||||
{
|
||||
if (onExitCallback)
|
||||
onExitCallback();
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
|
|
|
@ -1464,6 +1464,15 @@ public:
|
|||
virtual void setOpacityModifyRGB(bool value) {CC_UNUSED_PARAM(value);}
|
||||
virtual bool isOpacityModifyRGB() const { return false; };
|
||||
|
||||
/*
|
||||
* Public pointers to various callbacks on this class. They can be treated as properties and
|
||||
* set to call any method or lambda function.
|
||||
*/
|
||||
std::function<void()> onEnterCallback;
|
||||
std::function<void()> onExitCallback;
|
||||
std::function<void()> onEnterTransitionDidFinishCallback;
|
||||
std::function<void()> onExitTransitionDidStartCallback;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
// Nodes should be created using create();
|
||||
Node();
|
||||
|
|
|
@ -47,6 +47,7 @@ typedef SSIZE_T ssize_t;
|
|||
#include <mutex>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "base/CCRef.h"
|
||||
#include "base/ccMacros.h"
|
||||
#include "base/CCPlatformMacros.h"
|
||||
|
||||
|
@ -73,6 +74,7 @@ void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);
|
|||
|
||||
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
||||
class CC_DLL Console
|
||||
: public Ref
|
||||
{
|
||||
public:
|
||||
struct Command {
|
||||
|
|
|
@ -46,6 +46,7 @@ Ref::Ref()
|
|||
static unsigned int uObjectCount = 0;
|
||||
_luaID = 0;
|
||||
_ID = ++uObjectCount;
|
||||
_scriptObject = nullptr;
|
||||
#endif
|
||||
|
||||
#if CC_USE_MEM_LEAK_DETECTION
|
||||
|
|
|
@ -142,6 +142,8 @@ public:
|
|||
unsigned int _ID;
|
||||
/// Lua reference id
|
||||
int _luaID;
|
||||
/// scriptObject, support for swift
|
||||
void* _scriptObject;
|
||||
#endif
|
||||
|
||||
// Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined and its value isn't zero)
|
||||
|
|
|
@ -33,6 +33,7 @@ THE SOFTWARE.
|
|||
#include "math/CCGeometry.h"
|
||||
#include "math/CCMath.h"
|
||||
#include "CCGL.h"
|
||||
#include "CCRef.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -484,6 +485,7 @@ public:
|
|||
@brief The device accelerometer reports values for each axis in units of g-force
|
||||
*/
|
||||
class Acceleration
|
||||
: public Ref
|
||||
{
|
||||
public:
|
||||
double x;
|
||||
|
|
Loading…
Reference in New Issue