mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' into fix-remaining-missing-comments
Conflicts: cocos/base/CCIMEDelegate.h
This commit is contained in:
commit
b5d10fb246
|
@ -354,7 +354,7 @@ public:
|
|||
|
||||
/** Set the selector target.
|
||||
*
|
||||
* @param The selector target.
|
||||
* @param sel The selector target.
|
||||
*/
|
||||
inline void setTargetCallback(Ref* sel)
|
||||
{
|
||||
|
|
|
@ -404,7 +404,7 @@ public:
|
|||
virtual void startWithTarget(Node *target) override;
|
||||
virtual void stop(void) override;
|
||||
/**
|
||||
* @param dt In seconds.
|
||||
* @param time In seconds.
|
||||
*/
|
||||
virtual void update(float time) override;
|
||||
|
||||
|
@ -464,7 +464,7 @@ public:
|
|||
virtual RotateTo* reverse() const override;
|
||||
virtual void startWithTarget(Node *target) override;
|
||||
/**
|
||||
* @param dt In seconds.
|
||||
* @param time In seconds.
|
||||
*/
|
||||
virtual void update(float time) override;
|
||||
|
||||
|
@ -1429,7 +1429,7 @@ public:
|
|||
|
||||
/** Sets the Animation object to be animated
|
||||
*
|
||||
* @param A certain animation.
|
||||
* @param animation certain animation.
|
||||
*/
|
||||
void setAnimation( Animation* animation );
|
||||
/** returns the Animation object that is being animated
|
||||
|
|
|
@ -83,7 +83,6 @@ public:
|
|||
*
|
||||
* @param zoomX The zoom factor along the X-axis of the orthographic projection (the width of the ortho projection).
|
||||
* @param zoomY The zoom factor along the Y-axis of the orthographic projection (the height of the ortho projection).
|
||||
* @param aspectRatio The aspect ratio of the orthographic projection.
|
||||
* @param nearPlane The near plane distance.
|
||||
* @param farPlane The far plane distance.
|
||||
*/
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
* @return If you have custom stencil-based node with stencil drawing mechanics other then children-based,
|
||||
* then this method should return true every time you wish stencil to be visited.
|
||||
* By default returns true if has any children attached.
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool hasContent() const;
|
||||
|
||||
|
@ -114,22 +115,18 @@ public:
|
|||
|
||||
// Overrides
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onEnter() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onEnterTransitionDidFinish() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onExitTransitionDidStart() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onExit() override;
|
||||
|
|
|
@ -42,6 +42,7 @@ NS_CC_BEGIN
|
|||
/**
|
||||
@brief Clipping Rectangle Node.
|
||||
@details A node that clipped with specified rectangle.
|
||||
@js NA
|
||||
*/
|
||||
class CC_DLL ClippingRectangleNode : public Node
|
||||
{
|
||||
|
|
|
@ -49,7 +49,10 @@ public:
|
|||
* @lua NA
|
||||
*/
|
||||
virtual ~ComponentContainer(void);
|
||||
virtual Component* get(const std::string& name) const;
|
||||
/**
|
||||
* @js getComponent
|
||||
*/
|
||||
virtual Component* get(const std::string& name) const;
|
||||
virtual bool add(Component *com);
|
||||
virtual bool remove(const std::string& name);
|
||||
virtual bool remove(Component *com);
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
* @param point A Vec2 used to point.
|
||||
* @param pointSize The point size.
|
||||
* @param color The point color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawPoint(const Vec2& point, const float pointSize, const Color4F &color);
|
||||
|
||||
|
@ -71,6 +72,7 @@ public:
|
|||
* @param position A Vec2 pointer.
|
||||
* @param numberOfPoints The number of points.
|
||||
* @param color The point color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawPoints(const Vec2 *position, unsigned int numberOfPoints, const Color4F &color);
|
||||
|
||||
|
@ -80,6 +82,7 @@ public:
|
|||
* @param numberOfPoints The number of points.
|
||||
* @param pointSize The point size.
|
||||
* @param color The point color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawPoints(const Vec2 *position, unsigned int numberOfPoints, const float pointSize, const Color4F &color);
|
||||
|
||||
|
@ -88,6 +91,7 @@ public:
|
|||
* @param origin The line origin.
|
||||
* @param destination The line destination.
|
||||
* @param color The line color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawLine(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
||||
|
||||
|
@ -196,6 +200,7 @@ public:
|
|||
* @param origin The rectangle origin.
|
||||
* @param destination The rectangle destination.
|
||||
* @param color The rectangle color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawSolidRect(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
||||
|
||||
|
@ -204,6 +209,7 @@ public:
|
|||
* @param poli A solid polygon given a pointer to CGPoint coordinates.
|
||||
* @param numberOfPoints The number of vertices measured in points.
|
||||
* @param color The solid polygon color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, const Color4F &color);
|
||||
|
||||
|
@ -215,6 +221,7 @@ public:
|
|||
* @param scaleX The scale value in x.
|
||||
* @param scaleY The scale value in y.
|
||||
* @param color The solid circle color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY, const Color4F &color);
|
||||
|
||||
|
@ -224,6 +231,7 @@ public:
|
|||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param color The solid circle color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, const Color4F& color);
|
||||
|
||||
|
@ -247,6 +255,7 @@ public:
|
|||
* @param fillColor The color will fill in polygon.
|
||||
* @param borderWidth The border of line width.
|
||||
* @param borderColor The border of line color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawPolygon(const Vec2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor);
|
||||
|
||||
|
@ -256,6 +265,7 @@ public:
|
|||
* @param p2 The triangle vertex point.
|
||||
* @param p3 The triangle vertex point.
|
||||
* @param color The triangle color.
|
||||
* @js NA
|
||||
*/
|
||||
void drawTriangle(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Color4F &color);
|
||||
|
||||
|
@ -266,13 +276,13 @@ public:
|
|||
* @param to The destination of the bezier path.
|
||||
* @param segments The The number of segments.
|
||||
* @param color The quadratic bezier color.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void drawQuadraticBezier(const Vec2& from, const Vec2& control, const Vec2& to, unsigned int segments, const Color4F &color);
|
||||
|
||||
/** Clear the geometry in the node's buffer. */
|
||||
void clear();
|
||||
/** Get the color mixed mode.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
const BlendFunc& getBlendFunc() const;
|
||||
|
@ -285,8 +295,17 @@ public:
|
|||
*/
|
||||
void setBlendFunc(const BlendFunc &blendFunc);
|
||||
|
||||
void onDraw(const Mat4 &transform, uint32_t flags);
|
||||
void onDrawGLLine(const Mat4 &transform, uint32_t flags);
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
void onDraw(const Mat4 &transform, uint32_t flags);
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
void onDrawGLLine(const Mat4 &transform, uint32_t flags);
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
void onDrawGLPoint(const Mat4 &transform, uint32_t flags);
|
||||
|
||||
// Overrides
|
||||
|
|
|
@ -76,12 +76,21 @@ NS_CC_BEGIN
|
|||
|
||||
class PointArray;
|
||||
|
||||
/**
|
||||
* @js cc.DrawingPrimitiveCanvas/cc.DrawingPrimitiveWebGL
|
||||
*/
|
||||
namespace DrawPrimitives
|
||||
{
|
||||
/** Initializes the drawing primitives. */
|
||||
/**
|
||||
* Initializes the drawing primitives.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL init();
|
||||
|
||||
/** Frees allocated resources by the drawing primitives. */
|
||||
/**
|
||||
* Frees allocated resources by the drawing primitives.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL free();
|
||||
|
||||
/** Draws a point given x and y coordinate measured in points
|
||||
|
@ -169,6 +178,7 @@ namespace DrawPrimitives
|
|||
* @param segments The number of segments.
|
||||
* @param scaleX The scale value in x.
|
||||
* @param scaleY The scale value in y.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);
|
||||
|
||||
|
@ -177,6 +187,7 @@ namespace DrawPrimitives
|
|||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments);
|
||||
|
||||
|
@ -229,6 +240,7 @@ namespace DrawPrimitives
|
|||
* @param b The blue color with a unsigned bytes.
|
||||
* @param a Alpha with a unsigned bytes.
|
||||
* @since v2.0
|
||||
* @js setDrawColor
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL setDrawColor4B(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
|
||||
|
||||
|
@ -239,6 +251,7 @@ namespace DrawPrimitives
|
|||
* @param b The blue color with an floats.
|
||||
* @param a Alpha with an floats.
|
||||
* @since v2.0
|
||||
* @js setDrawColor
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL setDrawColor4F(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ namespace experimental{
|
|||
* http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
|
||||
|
||||
* @since v3.2
|
||||
* @js NA
|
||||
*/
|
||||
|
||||
class CC_DLL TMXLayer : public Node
|
||||
|
|
|
@ -94,6 +94,7 @@ class TMXLayer;
|
|||
* object->getProperty(name_of_the_property);
|
||||
|
||||
* @since v3.2
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL TMXTiledMap : public Node
|
||||
{
|
||||
|
|
|
@ -27,6 +27,9 @@ THE SOFTWARE.
|
|||
|
||||
#include "platform/CCGL.h"
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
class GLBufferedNode
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -34,7 +34,7 @@ NS_CC_BEGIN
|
|||
class Texture2D;
|
||||
|
||||
/**
|
||||
* @addtogroup effects
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class GLProgram;
|
|||
class Node;
|
||||
|
||||
/**
|
||||
* @addtogroup effects
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@ -103,6 +103,7 @@ public:
|
|||
|
||||
/**@{
|
||||
Interface for custom action when before or after draw.
|
||||
@js NA
|
||||
*/
|
||||
virtual void beforeBlit() {}
|
||||
virtual void afterBlit() {}
|
||||
|
@ -158,7 +159,6 @@ public:
|
|||
*/
|
||||
Vec3 getVertex(const Vec2& pos) const;
|
||||
/** @deprecated Use getVertex() instead
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Vec3 vertex(const Vec2& pos) const { return getVertex(pos); }
|
||||
|
@ -168,13 +168,11 @@ public:
|
|||
*/
|
||||
Vec3 getOriginalVertex(const Vec2& pos) const;
|
||||
/** @deprecated Use getOriginalVertex() instead
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Vec3 originalVertex(const Vec2& pos) const { return getOriginalVertex(pos); }
|
||||
|
||||
/** Sets a new vertex at a given position.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void setVertex(const Vec2& pos, const Vec3& vertex);
|
||||
|
@ -190,6 +188,7 @@ public:
|
|||
|
||||
/**@{
|
||||
Getter and Setter for depth test state when blit.
|
||||
@js NA
|
||||
*/
|
||||
void setNeedDepthTestForBlit( bool neededDepthTest) { _needDepthTestForBlit = neededDepthTest; }
|
||||
bool getNeedDepthTestForBlit() const { return _needDepthTestForBlit; }
|
||||
|
@ -233,7 +232,6 @@ public:
|
|||
*/
|
||||
Quad3 getTile(const Vec2& pos) const;
|
||||
/** returns the tile at the given position
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vec2& pos) const { return getTile(pos); }
|
||||
|
@ -243,13 +241,11 @@ public:
|
|||
*/
|
||||
Quad3 getOriginalTile(const Vec2& pos) const;
|
||||
/** returns the original tile (untransformed) at the given position
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vec2& pos) const { return getOriginalTile(pos); }
|
||||
|
||||
/** Sets a new tile.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void setTile(const Vec2& pos, const Quad3& coords);
|
||||
|
|
|
@ -106,6 +106,7 @@ typedef struct _ttfConfig
|
|||
* - http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
|
||||
* - http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
|
||||
* - http://www.angelcode.com/products/bmfont/ (Free, Windows only)
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL Label : public SpriteBatchNode, public LabelProtocol
|
||||
{
|
||||
|
|
|
@ -86,6 +86,9 @@ public:
|
|||
virtual const std::string& getString(void) const override;
|
||||
|
||||
virtual void updateAtlasValues() override;
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
#if CC_LABELATLAS_DEBUG_DRAW
|
||||
|
|
|
@ -84,17 +84,23 @@ public:
|
|||
static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION;
|
||||
#endif
|
||||
|
||||
/** Creates a Menu with a Array of MenuItem objects. */
|
||||
/**
|
||||
* Creates a Menu with a Array of MenuItem objects.
|
||||
* @js NA
|
||||
*/
|
||||
static Menu* createWithArray(const Vector<MenuItem*>& arrayOfItems);
|
||||
|
||||
/**
|
||||
* Creates a Menu with it's item, then use addChild() to add
|
||||
* other items. It is used for script, it can't init with undetermined
|
||||
* number of variables.
|
||||
* @js NA
|
||||
*/
|
||||
static Menu* createWithItem(MenuItem* item);
|
||||
|
||||
/** Creates a Menu with MenuItem objects. */
|
||||
/** Creates a Menu with MenuItem objects.
|
||||
* @js NA
|
||||
*/
|
||||
static Menu* createWithItems(MenuItem *firstItem, va_list args);
|
||||
|
||||
/** Align items vertically. */
|
||||
|
@ -119,7 +125,9 @@ public:
|
|||
/** Align items in rows of columns. */
|
||||
void alignItemsInColumns(int columns, va_list args);
|
||||
|
||||
/** Align items in array of columns. */
|
||||
/** Align items in array of columns.
|
||||
* @js NA
|
||||
*/
|
||||
void alignItemsInColumnsWithArray(const ValueVector& rows);
|
||||
|
||||
/** Align items in columns of rows. */
|
||||
|
@ -128,7 +136,9 @@ public:
|
|||
/** Align items in columns of rows. */
|
||||
void alignItemsInRows(int rows, va_list args);
|
||||
|
||||
/** Align items in array of rows. */
|
||||
/** Align items in array of rows.
|
||||
* @js NA
|
||||
*/
|
||||
void alignItemsInRowsWithArray(const ValueVector& columns);
|
||||
|
||||
/**
|
||||
|
|
|
@ -79,6 +79,9 @@ public:
|
|||
/** Returns whether or not the item is selected. */
|
||||
virtual bool isSelected() const;
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual void onExit() override;
|
||||
|
||||
/** Set the callback to the menu item.
|
||||
|
@ -90,12 +93,13 @@ public:
|
|||
void setCallback(const ccMenuCallback& callback);
|
||||
|
||||
/** Set the target/selector of the menu item.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void setTarget(Ref *rec, SEL_MenuHandler selector);
|
||||
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -115,7 +119,6 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
virtual ~MenuItem();
|
||||
|
||||
/** Initializes a MenuItem with a target/selector.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
bool initWithCallback(const ccMenuCallback& callback);
|
||||
|
@ -275,11 +278,13 @@ public:
|
|||
* c++ can not overload static and non-static member functions with the same parameter types.
|
||||
* so change the name to setFontSizeObj.
|
||||
* @js setFontSize
|
||||
* @js NA
|
||||
*/
|
||||
void setFontSizeObj(int size);
|
||||
|
||||
/** get font size .
|
||||
* @js getFontSize
|
||||
* @js NA
|
||||
*/
|
||||
int getFontSizeObj() const;
|
||||
CC_DEPRECATED_ATTRIBUTE int fontSizeObj() const { return getFontSizeObj(); };
|
||||
|
@ -289,15 +294,19 @@ public:
|
|||
* c++ can not overload static and non-static member functions with the same parameter types.
|
||||
* so change the name to setFontNameObj.
|
||||
* @js setFontName
|
||||
* @js NA
|
||||
*/
|
||||
void setFontNameObj(const std::string& name);
|
||||
|
||||
/** Returns the name of the Font.
|
||||
* @js getFontNameObj
|
||||
* @js NA
|
||||
*/
|
||||
const std::string& getFontNameObj() const;
|
||||
|
||||
/** Deprecated Use getFontNameObj() instead. */
|
||||
/** Deprecated Use getFontNameObj() instead.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE const std::string& fontNameObj() const { return getFontNameObj(); }
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
|
|
@ -731,7 +731,7 @@ public:
|
|||
* If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
|
||||
*
|
||||
* @param child A child node.
|
||||
* @param zOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`.
|
||||
* @param localZOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`.
|
||||
*/
|
||||
virtual void addChild(Node * child, int localZOrder);
|
||||
/**
|
||||
|
@ -752,7 +752,7 @@ public:
|
|||
* If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
|
||||
*
|
||||
* @param child A child node.
|
||||
* @param zOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`.
|
||||
* @param localZOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`.
|
||||
* @param name A string to identify the node easily. Please refer to `setName(int)`.
|
||||
*
|
||||
*/
|
||||
|
@ -1195,7 +1195,7 @@ public:
|
|||
* This node becomes the action's target. Refer to Action::getTarget().
|
||||
* @warning Actions don't retain their target.
|
||||
*
|
||||
* @param An Action pointer
|
||||
* @param action An Action pointer.
|
||||
*/
|
||||
virtual Action* runAction(Action* action);
|
||||
|
||||
|
@ -1631,7 +1631,7 @@ public:
|
|||
/**
|
||||
* Removes a component by its pointer.
|
||||
*
|
||||
* @param name A given component.
|
||||
* @param component A given component.
|
||||
* @return True if removed success.
|
||||
*/
|
||||
virtual bool removeComponent(Component *component);
|
||||
|
|
|
@ -180,7 +180,7 @@ public:
|
|||
http://particledesigner.71squared.com/
|
||||
@since v2.0
|
||||
*
|
||||
* @param Particle plist file name.
|
||||
* @param plistFile Particle plist file name.
|
||||
* @return An autoreleased ParticleSystem object.
|
||||
*/
|
||||
static ParticleSystem * create(const std::string& plistFile);
|
||||
|
@ -229,7 +229,7 @@ public:
|
|||
|
||||
/** Call the update mathod with no time..
|
||||
*/
|
||||
virtual void updateWithNoTime(void);
|
||||
virtual void updateWithNoTime();
|
||||
|
||||
/** Whether or not the particle system removed self on finish.
|
||||
*
|
||||
|
@ -453,7 +453,7 @@ public:
|
|||
inline const Vec2& getSourcePosition() const { return _sourcePosition; };
|
||||
/** Sets the source position of the emitter.
|
||||
*
|
||||
* @param The source position of the emitter.
|
||||
* @param pos The source position of the emitter.
|
||||
*/
|
||||
inline void setSourcePosition(const Vec2& pos) { _sourcePosition = pos; };
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
* If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
|
||||
*
|
||||
* @param child A child node
|
||||
* @param zOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`
|
||||
* @param localZOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`
|
||||
*/
|
||||
virtual void addProtectedChild(Node * child, int localZOrder);
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ public:
|
|||
* If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
|
||||
*
|
||||
* @param child A child node
|
||||
* @param zOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`
|
||||
* @param localZOrder Z order for drawing priority. Please refer to `setLocalZOrder(int)`
|
||||
* @param tag An integer to identify the node easily. Please refer to `setTag(int)`
|
||||
*/
|
||||
virtual void addProtectedChild(Node* child, int localZOrder, int tag);
|
||||
|
@ -141,6 +141,9 @@ public:
|
|||
|
||||
/// @} end of Children and Parent
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
|
||||
|
||||
virtual void cleanup() override;
|
||||
|
|
|
@ -113,7 +113,9 @@ public:
|
|||
*/
|
||||
virtual void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue);
|
||||
|
||||
/** End is key word of lua, use other name to export to lua. */
|
||||
/** End is key word of lua, use other name to export to lua.
|
||||
* @js NA
|
||||
*/
|
||||
inline void endToLua(){ end();};
|
||||
|
||||
/** Ends grabbing. */
|
||||
|
@ -145,6 +147,7 @@ public:
|
|||
*
|
||||
* @param flipImage Whether or not to flip image.
|
||||
* @return An image.
|
||||
* @js NA
|
||||
*/
|
||||
Image* newImage(bool flipImage = true);
|
||||
|
||||
|
@ -272,6 +275,7 @@ public:
|
|||
/** Flag: Use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.
|
||||
*
|
||||
* @param keepMatrix Wether or not use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.
|
||||
* @js NA
|
||||
*/
|
||||
void setKeepMatrix(bool keepMatrix);
|
||||
/**Used for grab part of screen to a texture.
|
||||
|
@ -285,8 +289,14 @@ public:
|
|||
/** FIXME: should be procted.
|
||||
* but due to a bug in PowerVR + Android,
|
||||
* the constructor is public again.
|
||||
* @js ctor
|
||||
*/
|
||||
RenderTexture();
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual ~RenderTexture();
|
||||
/** Initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid.
|
||||
*
|
||||
|
|
|
@ -244,7 +244,9 @@ public:
|
|||
* Returns the current displayed frame.
|
||||
*/
|
||||
virtual SpriteFrame* getSpriteFrame() const;
|
||||
/** @deprecated Use `getSpriteFrame()` instead. */
|
||||
/** @deprecated Use `getSpriteFrame()` instead.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE virtual SpriteFrame* getDisplayFrame() const { return getSpriteFrame(); }
|
||||
/** @deprecated Use `getSpriteFrame()` instead. */
|
||||
CC_DEPRECATED_ATTRIBUTE virtual SpriteFrame* displayFrame() const { return getSpriteFrame(); };
|
||||
|
@ -345,7 +347,9 @@ public:
|
|||
* @lua NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE bool isFlipX() { return isFlippedX(); };
|
||||
/** @deprecated Use setFlippedX() instead */
|
||||
/** @deprecated Use setFlippedX() instead
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void setFlipX(bool flippedX) { setFlippedX(flippedX); };
|
||||
|
||||
/**
|
||||
|
@ -368,9 +372,13 @@ public:
|
|||
|
||||
/// @} End of Sprite properties getter/setters
|
||||
|
||||
/** @deprecated Use isFlippedY() instead. */
|
||||
/** @deprecated Use isFlippedY() instead.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE bool isFlipY() { return isFlippedY(); };
|
||||
/** @deprecated Use setFlippedY() instead. */
|
||||
/** @deprecated Use setFlippedY() instead.
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void setFlipY(bool flippedY) { setFlippedY(flippedY); };
|
||||
|
||||
//
|
||||
|
@ -393,6 +401,9 @@ public:
|
|||
inline const BlendFunc& getBlendFunc() const override { return _blendFunc; }
|
||||
/// @}
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
/// @{
|
||||
|
@ -429,7 +440,9 @@ public:
|
|||
/// @}
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
||||
/**
|
||||
* @js ctor
|
||||
*/
|
||||
Sprite();
|
||||
virtual ~Sprite();
|
||||
|
||||
|
@ -500,7 +513,6 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
*
|
||||
* @param filename The path to an image file in local file system.
|
||||
* @return True if the sprite is initialized properly, false otherwise.
|
||||
* @js init
|
||||
* @lua init
|
||||
*/
|
||||
virtual bool initWithFile(const std::string& filename);
|
||||
|
@ -515,7 +527,6 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
* @param filename The path to an image file in local file system.
|
||||
* @param rect The rectangle assigned the content area from texture.
|
||||
* @return True if the sprite is initialized properly, false otherwise.
|
||||
* @js init
|
||||
* @lua init
|
||||
*/
|
||||
virtual bool initWithFile(const std::string& filename, const Rect& rect);
|
||||
|
|
|
@ -183,11 +183,13 @@ public:
|
|||
*/
|
||||
virtual void setBlendFunc(const BlendFunc &blendFunc) override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual const BlendFunc& getBlendFunc() const override;
|
||||
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
|
||||
|
||||
using Node::addChild;
|
||||
|
@ -195,10 +197,19 @@ public:
|
|||
virtual void addChild(Node * child, int zOrder, const std::string &name) override;
|
||||
virtual void reorderChild(Node *child, int zOrder) override;
|
||||
|
||||
virtual void removeChild(Node *child, bool cleanup) override;
|
||||
virtual void removeChild(Node *child, bool cleanup) override;
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual void removeAllChildrenWithCleanup(bool cleanup) override;
|
||||
virtual void sortAllChildren() override;
|
||||
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
||||
virtual void sortAllChildren() override;
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
/** Inserts a quad at a certain index into the texture atlas. The Sprite won't be added into the children array.
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
inline const Rect& getRect() const { return _rect; }
|
||||
/** Set rect of the frame.
|
||||
*
|
||||
* @param The rect of the sprite.
|
||||
* @param rect The rect of the sprite.
|
||||
*/
|
||||
void setRect(const Rect& rect);
|
||||
|
||||
|
|
|
@ -109,6 +109,9 @@ public:
|
|||
* @return Returns the tile (Sprite) at a given a tile coordinate.
|
||||
*/
|
||||
Sprite* getTileAt(const Vec2& tileCoordinate);
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Sprite* tileAt(const Vec2& tileCoordinate) { return getTileAt(tileCoordinate); };
|
||||
|
||||
/** Returns the tile gid at a given tile coordinate. It also returns the tile flags.
|
||||
|
@ -118,7 +121,10 @@ public:
|
|||
* @param flags Tile flags.
|
||||
* @return Returns the tile gid at a given tile coordinate. It also returns the tile flags.
|
||||
*/
|
||||
uint32_t getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr);
|
||||
uint32_t getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr);
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE uint32_t tileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr){
|
||||
return getTileGIDAt(tileCoordinate, flags);
|
||||
};
|
||||
|
@ -155,7 +161,10 @@ public:
|
|||
* @param tileCoordinate The tile coordinate.
|
||||
* @return The position in points of a given tile coordinate.
|
||||
*/
|
||||
Vec2 getPositionAt(const Vec2& tileCoordinate);
|
||||
Vec2 getPositionAt(const Vec2& tileCoordinate);
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Vec2 positionAt(const Vec2& tileCoordinate) { return getPositionAt(tileCoordinate); };
|
||||
|
||||
/** Return the value for the specific property name.
|
||||
|
@ -163,7 +172,10 @@ public:
|
|||
* @param propertyName The specific property name.
|
||||
* @return Return the value for the specific property name.
|
||||
*/
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE Value propertyNamed(const std::string& propertyName) const { return getProperty(propertyName); };
|
||||
|
||||
/** Creates the tiles. */
|
||||
|
@ -227,6 +239,7 @@ public:
|
|||
/** Set tileset information for the layer.
|
||||
*
|
||||
* @param info The tileset information for the layer.
|
||||
* @js NA
|
||||
*/
|
||||
inline void setTileSet(TMXTilesetInfo* info) {
|
||||
CC_SAFE_RETAIN(info);
|
||||
|
@ -275,6 +288,9 @@ public:
|
|||
virtual void addChild(Node * child, int zOrder, int tag) override;
|
||||
// super method
|
||||
void removeChild(Node* child, bool cleanup) override;
|
||||
/**
|
||||
* @js NA
|
||||
*/
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -71,6 +71,7 @@ public:
|
|||
*
|
||||
* @param propertyName The specific property name.
|
||||
* @return Return the value for the specific property name.
|
||||
* @js NA
|
||||
*/
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
* @param tmxString A TMX formatted XML string.
|
||||
* @param resourcePath The path to TMX resources.
|
||||
* @return An autorelease object.
|
||||
* @js NA
|
||||
*/
|
||||
static TMXTiledMap* createWithXML(const std::string& tmxString, const std::string& resourcePath);
|
||||
|
||||
|
@ -246,7 +247,9 @@ public:
|
|||
_properties = properties;
|
||||
};
|
||||
|
||||
/** Get the description. */
|
||||
/** Get the description.
|
||||
* @js NA
|
||||
*/
|
||||
virtual std::string getDescription() const override;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
|
|
@ -46,6 +46,7 @@ class CC_DLL TextFieldDelegate
|
|||
public:
|
||||
/**
|
||||
* Desctructor for TextFieldDelegate.
|
||||
* @js NA
|
||||
*/
|
||||
virtual ~TextFieldDelegate() {}
|
||||
|
||||
|
@ -91,6 +92,7 @@ public:
|
|||
|
||||
/**
|
||||
*@brief If the sender doesn't want to draw, return true.
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool onVisit(TextFieldTTF * sender,Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
||||
{
|
||||
|
@ -118,10 +120,14 @@ public:
|
|||
*/
|
||||
virtual ~TextFieldTTF();
|
||||
|
||||
/** Creates a TextFieldTTF from a fontname, alignment, dimension and font size. */
|
||||
/** Creates a TextFieldTTF from a fontname, alignment, dimension and font size.
|
||||
* @js NA
|
||||
*/
|
||||
static TextFieldTTF * textFieldWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize);
|
||||
|
||||
/** Creates a TextFieldTTF from a fontname and font size. */
|
||||
/** Creates a TextFieldTTF from a fontname and font size.
|
||||
* @js NA
|
||||
*/
|
||||
static TextFieldTTF * textFieldWithPlaceHolder(const std::string& placeholder, const std::string& fontName, float fontSize);
|
||||
|
||||
/** Initializes the TextFieldTTF with a font name, alignment, dimension and font size. */
|
||||
|
@ -144,12 +150,10 @@ public:
|
|||
// properties
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
inline TextFieldDelegate* getDelegate() const { return _delegate; };
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
inline void setDelegate(TextFieldDelegate* delegate) { _delegate = delegate; };
|
||||
|
@ -213,12 +217,14 @@ public:
|
|||
* Set enable secure text entry represention.
|
||||
* If you want to display password in TextField, this option is very helpful.
|
||||
*@param value Whether or not to display text with secure text entry.
|
||||
* @js NA
|
||||
*/
|
||||
virtual void setSecureTextEntry(bool value);
|
||||
|
||||
/**
|
||||
* Query whether the currently display mode is secure text entry or not.
|
||||
*@return Whether current text is displayed as secure text entry.
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool isSecureTextEntry();
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ IMPORTANT:
|
|||
This class is deprecated. It is maintained for compatibility reasons only.
|
||||
You SHOULD not use this class.
|
||||
Instead, use the newer TMX file format: TMXTiledMap
|
||||
@js NA
|
||||
*/
|
||||
class CC_DLL TileMapAtlas : public AtlasNode
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
|
||||
/** Returns the action that will be performed with size.
|
||||
*
|
||||
* @param size A given size.
|
||||
* @param vector A given size.
|
||||
* @return The action that will be performed.
|
||||
*/
|
||||
ActionInterval* actionWithSize(const Size& vector);
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Axis Aligned Bounding Box (AABB), usually caculate some rough but fast collision detection.
|
||||
*/
|
||||
|
@ -117,6 +122,9 @@ public:
|
|||
Vec3 _max;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
std::unordered_map<Sprite3D*, Animate3D*> Animate3D::s_fadeInAnimates;
|
||||
std::unordered_map<Sprite3D*, Animate3D*> Animate3D::s_fadeOutAnimates;
|
||||
std::unordered_map<Sprite3D*, Animate3D*> Animate3D::s_runningAnimates;
|
||||
std::unordered_map<Node*, Animate3D*> Animate3D::s_fadeInAnimates;
|
||||
std::unordered_map<Node*, Animate3D*> Animate3D::s_fadeOutAnimates;
|
||||
std::unordered_map<Node*, Animate3D*> Animate3D::s_runningAnimates;
|
||||
float Animate3D::_transTime = 0.1f;
|
||||
|
||||
//create Animate3D using Animation.
|
||||
|
@ -120,26 +120,98 @@ Animate3D* Animate3D::reverse() const
|
|||
return animate;
|
||||
}
|
||||
|
||||
Node* findChildByNameRecursively(Node* node, const std::string &childName)
|
||||
{
|
||||
const std::string& name = node->getName();
|
||||
if (name == childName)
|
||||
return node;
|
||||
|
||||
const Vector<Node*>& children = node->getChildren();
|
||||
for (const auto& child : children)
|
||||
{
|
||||
Node* findNode = findChildByNameRecursively(child, childName);
|
||||
if (findNode)
|
||||
return findNode;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//! called before the action start. It will also set the target.
|
||||
void Animate3D::startWithTarget(Node *target)
|
||||
{
|
||||
Sprite3D* sprite = dynamic_cast<Sprite3D*>(target);
|
||||
CCASSERT(sprite && sprite->getSkeleton() && _animation, "Animate3D apply to Sprite3D only");
|
||||
|
||||
ActionInterval::startWithTarget(target);
|
||||
|
||||
_boneCurves.clear();
|
||||
auto skin = sprite->getSkeleton();
|
||||
_nodeCurves.clear();
|
||||
|
||||
bool hasCurve = false;
|
||||
for (int i = 0; i < skin->getBoneCount(); i++) {
|
||||
auto bone = skin->getBoneByIndex(static_cast<unsigned int>(i));
|
||||
auto curve = _animation->getBoneCurveByName(bone->getName());
|
||||
if (curve)
|
||||
Sprite3D* sprite = dynamic_cast<Sprite3D*>(target);
|
||||
|
||||
if(sprite)
|
||||
{
|
||||
if (_animation)
|
||||
{
|
||||
_boneCurves[bone] = curve;
|
||||
hasCurve = true;
|
||||
const std::unordered_map<std::string, Animation3D::Curve*>& boneCurves = _animation->getBoneCurves();
|
||||
for (const auto& iter: boneCurves)
|
||||
{
|
||||
const std::string& boneName = iter.first;
|
||||
auto skin = sprite->getSkeleton();
|
||||
if(skin)
|
||||
{
|
||||
auto bone = skin->getBoneByName(boneName);
|
||||
if (bone)
|
||||
{
|
||||
auto curve = _animation->getBoneCurveByName(boneName);
|
||||
_boneCurves[bone] = curve;
|
||||
hasCurve = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Node* node = nullptr;
|
||||
if (target->getName() == boneName)
|
||||
node = target;
|
||||
else
|
||||
node = findChildByNameRecursively(target, boneName);
|
||||
|
||||
if (node)
|
||||
{
|
||||
auto curve = _animation->getBoneCurveByName(boneName);
|
||||
if (curve)
|
||||
{
|
||||
_nodeCurves[node] = curve;
|
||||
hasCurve = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::unordered_map<std::string, Animation3D::Curve*>& boneCurves = _animation->getBoneCurves();
|
||||
for (const auto& iter: boneCurves)
|
||||
{
|
||||
const std::string& boneName = iter.first;
|
||||
Node* node = nullptr;
|
||||
if (target->getName() == boneName)
|
||||
node = target;
|
||||
else
|
||||
node = findChildByNameRecursively(target, boneName);
|
||||
|
||||
if (node)
|
||||
{
|
||||
auto curve = _animation->getBoneCurveByName(boneName);
|
||||
if (curve)
|
||||
{
|
||||
_nodeCurves[node] = curve;
|
||||
hasCurve = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasCurve)
|
||||
{
|
||||
CCLOG("warning: no animation finde for the skeleton");
|
||||
|
@ -238,25 +310,52 @@ void Animate3D::update(float t)
|
|||
t = 1 - t;
|
||||
|
||||
t = _start + t * _last;
|
||||
for (const auto& it : _boneCurves) {
|
||||
auto bone = it.first;
|
||||
for (const auto& it : _boneCurves)
|
||||
{
|
||||
for (const auto& it : _boneCurves) {
|
||||
auto bone = it.first;
|
||||
auto curve = it.second;
|
||||
if (curve->translateCurve)
|
||||
{
|
||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
|
||||
trans = &transDst[0];
|
||||
}
|
||||
if (curve->rotCurve)
|
||||
{
|
||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
|
||||
rot = &rotDst[0];
|
||||
}
|
||||
if (curve->scaleCurve)
|
||||
{
|
||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
|
||||
scale = &scaleDst[0];
|
||||
}
|
||||
bone->setAnimationValue(trans, rot, scale, this, _weight);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& it : _nodeCurves)
|
||||
{
|
||||
auto node = it.first;
|
||||
auto curve = it.second;
|
||||
Mat4 transform;
|
||||
if (curve->translateCurve)
|
||||
{
|
||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
|
||||
trans = &transDst[0];
|
||||
transform.translate(transDst[0], transDst[1], transDst[2]);
|
||||
}
|
||||
if (curve->rotCurve)
|
||||
{
|
||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
|
||||
rot = &rotDst[0];
|
||||
Quaternion qua(rotDst[0], rotDst[1], rotDst[2], rotDst[3]);
|
||||
transform.rotate(qua);
|
||||
}
|
||||
if (curve->scaleCurve)
|
||||
{
|
||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
|
||||
scale = &scaleDst[0];
|
||||
transform.scale(scaleDst[0], scaleDst[1], scaleDst[2]);
|
||||
}
|
||||
bone->setAnimationValue(trans, rot, scale, this, _weight);
|
||||
node->setAdditionalTransform(&transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,8 +37,14 @@ NS_CC_BEGIN
|
|||
|
||||
class Bone3D;
|
||||
class Sprite3D;
|
||||
|
||||
/**
|
||||
* Animate3D, Animates a Sprite3D given with an Animation3D
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Animate3D, Animates a Sprite3D given with an Animation3D
|
||||
*/
|
||||
class CC_DLL Animate3D: public ActionInterval
|
||||
{
|
||||
|
@ -132,13 +138,17 @@ protected:
|
|||
float _lastTime; // last t (0 - 1)
|
||||
float _originInterval;// save origin interval time
|
||||
std::unordered_map<Bone3D*, Animation3D::Curve*> _boneCurves; //weak ref
|
||||
std::unordered_map<Node*, Animation3D::Curve*> _nodeCurves;
|
||||
|
||||
//sprite animates
|
||||
static std::unordered_map<Sprite3D*, Animate3D*> s_fadeInAnimates;
|
||||
static std::unordered_map<Sprite3D*, Animate3D*> s_fadeOutAnimates;
|
||||
static std::unordered_map<Sprite3D*, Animate3D*> s_runningAnimates;
|
||||
static std::unordered_map<Node*, Animate3D*> s_fadeInAnimates;
|
||||
static std::unordered_map<Node*, Animate3D*> s_fadeOutAnimates;
|
||||
static std::unordered_map<Node*, Animate3D*> s_runningAnimates;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCANIMATE3D_H__
|
||||
|
|
|
@ -34,9 +34,13 @@
|
|||
#include "3d/CCBundle3DData.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* static animation data, shared
|
||||
* @brief static animation data, shared
|
||||
*/
|
||||
class CC_DLL Animation3D: public Ref
|
||||
{
|
||||
|
@ -69,6 +73,8 @@ public:
|
|||
/**get bone curve*/
|
||||
Curve* getBoneCurveByName(const std::string& name) const;
|
||||
|
||||
const std::unordered_map<std::string, Curve*>& getBoneCurves() const {return _boneCurves;}
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
Animation3D();
|
||||
virtual ~Animation3D();
|
||||
|
@ -114,6 +120,8 @@ protected:
|
|||
std::unordered_map<std::string, Animation3D*> _animations; //cached animations
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCANIMATION3D_H__
|
||||
|
|
|
@ -36,6 +36,11 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Evaluate Type
|
||||
*/
|
||||
|
@ -48,7 +53,7 @@ enum class EvaluateType
|
|||
};
|
||||
|
||||
/**
|
||||
* curve of bone's position, rotation or scale
|
||||
* @brief curve of bone's position, rotation or scale
|
||||
*/
|
||||
template <int componentSize>
|
||||
class AnimationCurve: public Ref
|
||||
|
@ -95,6 +100,9 @@ protected:
|
|||
std::function<void(float time, float* dst)> _evaluateFun; //user defined function
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#include "CCAnimationCurve.inl"
|
||||
|
|
|
@ -29,11 +29,14 @@
|
|||
#include "2d/CCNode.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
class Bone3D;
|
||||
|
||||
/**
|
||||
* attach a node to a bone
|
||||
* @brief attach a node to a bone
|
||||
* usage: auto sprite = Sprite3D::create("girl.c3b");
|
||||
* auto weapon = Sprite3D::create("weapon.c3b");
|
||||
* auto attachNode = sprite->getAttachNode("left hand");
|
||||
|
@ -65,6 +68,8 @@ protected:
|
|||
mutable Mat4 _transformToParent;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
#endif // __CCATTACHNODE_H__
|
||||
|
|
|
@ -28,9 +28,13 @@
|
|||
#include "2d/CCSprite.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Inherit from Sprite, achieve BillBoard.
|
||||
* @brief Inherit from Sprite, achieve BillBoard.
|
||||
*/
|
||||
class CC_DLL BillBoard : public Sprite
|
||||
{
|
||||
|
@ -118,7 +122,8 @@ private:
|
|||
|
||||
};
|
||||
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -1616,7 +1616,7 @@ bool Bundle3D::loadNodesJson(NodeDatas& nodedatas)
|
|||
{
|
||||
const rapidjson::Value& jnode = nodes[i];
|
||||
std::string id = jnode[ID].GetString();
|
||||
NodeData* nodedata = parseNodesRecursivelyJson(jnode);
|
||||
NodeData* nodedata = parseNodesRecursivelyJson(jnode, nodes.Size() == 1);
|
||||
|
||||
bool isSkeleton = jnode[SKELETON].GetBool();
|
||||
if (isSkeleton)
|
||||
|
@ -1626,23 +1626,25 @@ bool Bundle3D::loadNodesJson(NodeDatas& nodedatas)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
|
||||
NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue, bool singleSprite)
|
||||
{
|
||||
NodeData* nodedata = new (std::nothrow) NodeData();;
|
||||
// id
|
||||
nodedata->id = jvalue[ID].GetString();
|
||||
|
||||
// transform
|
||||
Mat4 tranform;
|
||||
Mat4 transform;
|
||||
const rapidjson::Value& jtransform = jvalue[TRANSFORM];
|
||||
|
||||
for (rapidjson::SizeType j = 0; j < jtransform.Size(); j++)
|
||||
{
|
||||
tranform.m[j] = jtransform[j].GetDouble();
|
||||
transform.m[j] = jtransform[j].GetDouble();
|
||||
}
|
||||
|
||||
nodedata->transform = tranform;
|
||||
nodedata->transform = transform;
|
||||
|
||||
bool isSkin = false;
|
||||
|
||||
// parts
|
||||
if (jvalue.HasMember(PARTS))
|
||||
{
|
||||
|
@ -1690,11 +1692,31 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
|
|||
//invbindpos.inverse();
|
||||
modelnodedata->invBindPose.push_back(invbindpos);
|
||||
}
|
||||
|
||||
if (bones.Size() > 0)
|
||||
isSkin = true;
|
||||
}
|
||||
nodedata->modelNodeDatas.push_back(modelnodedata);
|
||||
}
|
||||
}
|
||||
|
||||
// set transform
|
||||
if(_version == "0.1" || _version == "0.2" || _version == "0.3" || _version == "0.4" || _version == "0.5" || _version == "0.6")
|
||||
{
|
||||
if(isSkin || singleSprite)
|
||||
{
|
||||
nodedata->transform = Mat4::IDENTITY;
|
||||
}
|
||||
else
|
||||
{
|
||||
nodedata->transform = transform;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nodedata->transform = transform;
|
||||
}
|
||||
|
||||
if (jvalue.HasMember(CHILDREN))
|
||||
{
|
||||
const rapidjson::Value& children = jvalue[CHILDREN];
|
||||
|
@ -1702,7 +1724,7 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
|
|||
{
|
||||
const rapidjson::Value& child = children[i];
|
||||
|
||||
NodeData* tempdata = parseNodesRecursivelyJson(child);
|
||||
NodeData* tempdata = parseNodesRecursivelyJson(child, singleSprite);
|
||||
nodedata->children.push_back(tempdata);
|
||||
}
|
||||
}
|
||||
|
@ -1725,7 +1747,7 @@ bool Bundle3D::loadNodesBinary(NodeDatas& nodedatas)
|
|||
for (rapidjson::SizeType i = 0; i < nodeSize; i++)
|
||||
{
|
||||
bool skeleton = false;
|
||||
NodeData* nodedata = parseNodesRecursivelyBinary(skeleton);
|
||||
NodeData* nodedata = parseNodesRecursivelyBinary(skeleton, nodeSize == 1);
|
||||
|
||||
if (skeleton)
|
||||
nodedatas.skeleton.push_back(nodedata);
|
||||
|
@ -1734,7 +1756,7 @@ bool Bundle3D::loadNodesBinary(NodeDatas& nodedatas)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
|
||||
NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton, bool singleSprite)
|
||||
{
|
||||
// id
|
||||
std::string id = _binaryReader.readString();
|
||||
|
@ -1765,7 +1787,9 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
|
|||
|
||||
NodeData* nodedata = new (std::nothrow) NodeData();
|
||||
nodedata->id = id;
|
||||
nodedata->transform = transform;
|
||||
|
||||
bool isSkin = false;
|
||||
|
||||
if (partsSize > 0)
|
||||
{
|
||||
for (unsigned int i = 0; i < partsSize; i++)
|
||||
|
@ -1804,6 +1828,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
|
|||
|
||||
modelnodedata->invBindPose.push_back(invbindpos);
|
||||
}
|
||||
isSkin = true;
|
||||
}
|
||||
unsigned int uvMapping = 0;
|
||||
if (_binaryReader.read(&uvMapping, 4, 1) != 1)
|
||||
|
@ -1832,6 +1857,23 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
|
|||
}
|
||||
}
|
||||
|
||||
// set transform
|
||||
if(_version == "0.1" || _version == "0.2" || _version == "0.3" || _version == "0.4" || _version == "0.5" || _version == "0.6")
|
||||
{
|
||||
if(isSkin || singleSprite)
|
||||
{
|
||||
nodedata->transform = Mat4::IDENTITY;
|
||||
}
|
||||
else
|
||||
{
|
||||
nodedata->transform = transform;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nodedata->transform = transform;
|
||||
}
|
||||
|
||||
unsigned int childrenSize = 0;
|
||||
if (_binaryReader.read(&childrenSize, 4, 1) != 1)
|
||||
{
|
||||
|
@ -1842,7 +1884,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
|
|||
{
|
||||
for (unsigned int i = 0; i < childrenSize; i++)
|
||||
{
|
||||
NodeData* tempdata = parseNodesRecursivelyBinary(skeleton);
|
||||
NodeData* tempdata = parseNodesRecursivelyBinary(skeleton, singleSprite);
|
||||
nodedata->children.push_back(tempdata);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,21 @@
|
|||
#include "json/document.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class Animation3D;
|
||||
class Data;
|
||||
|
||||
/**
|
||||
* Defines a bundle file that contains a collection of assets. Mesh, Material, MeshSkin, Animation
|
||||
* @brief Defines a bundle file that contains a collection of assets. Mesh, Material, MeshSkin, Animation
|
||||
* There are two types of bundle files, c3t and c3b.
|
||||
* c3t text file
|
||||
* c3b binary file
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL Bundle3D
|
||||
{
|
||||
|
@ -114,13 +121,13 @@ protected:
|
|||
* load nodes of json
|
||||
*/
|
||||
bool loadNodesJson(NodeDatas& nodedatas);
|
||||
NodeData* parseNodesRecursivelyJson(const rapidjson::Value& jvalue);
|
||||
NodeData* parseNodesRecursivelyJson(const rapidjson::Value& jvalue, bool singleSprite);
|
||||
|
||||
/**
|
||||
* load nodes of binary
|
||||
*/
|
||||
bool loadNodesBinary(NodeDatas& nodedatas);
|
||||
NodeData* parseNodesRecursivelyBinary(bool& skeleton);
|
||||
NodeData* parseNodesRecursivelyBinary(bool& skeleton, bool singleSprite);
|
||||
|
||||
/**
|
||||
* get define data type
|
||||
|
@ -174,6 +181,9 @@ protected:
|
|||
bool _isBinary;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCBUNDLE3D_H__
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**mesh vertex attribute*/
|
||||
/**mesh vertex attribute
|
||||
* @js NA
|
||||
*/
|
||||
struct MeshVertexAttrib
|
||||
{
|
||||
//attribute size
|
||||
|
@ -49,7 +51,9 @@ struct MeshVertexAttrib
|
|||
};
|
||||
|
||||
|
||||
/** model node data, since 3.3 */
|
||||
/** model node data, since 3.3
|
||||
* @js NA
|
||||
*/
|
||||
struct ModelData
|
||||
{
|
||||
std::string subMeshId;
|
||||
|
@ -68,7 +72,9 @@ struct ModelData
|
|||
}
|
||||
};
|
||||
|
||||
/** Node data, since 3.3 */
|
||||
/** Node data, since 3.3
|
||||
* @js NA
|
||||
*/
|
||||
struct NodeData
|
||||
{
|
||||
std::string id;
|
||||
|
@ -99,7 +105,9 @@ struct NodeData
|
|||
|
||||
};
|
||||
|
||||
/** node datas, since 3.3 */
|
||||
/** node datas, since 3.3
|
||||
* @js NA
|
||||
*/
|
||||
struct NodeDatas
|
||||
{
|
||||
std::vector<NodeData*> skeleton; //skeleton
|
||||
|
@ -120,7 +128,9 @@ struct NodeDatas
|
|||
}
|
||||
};
|
||||
|
||||
/**mesh data*/
|
||||
/**mesh data
|
||||
* @js NA
|
||||
*/
|
||||
struct MeshData
|
||||
{
|
||||
typedef std::vector<unsigned short> IndexArray;
|
||||
|
@ -173,7 +183,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/** mesh datas */
|
||||
/** mesh datas
|
||||
* @js NA
|
||||
*/
|
||||
struct MeshDatas
|
||||
{
|
||||
std::vector<MeshData*> meshDatas;
|
||||
|
@ -192,7 +204,9 @@ struct MeshDatas
|
|||
}
|
||||
};
|
||||
|
||||
/**skin data*/
|
||||
/**skin data
|
||||
* @js NA
|
||||
*/
|
||||
struct SkinData
|
||||
{
|
||||
std::vector<std::string> skinBoneNames; //skin bones affect skin
|
||||
|
@ -261,7 +275,9 @@ struct SkinData
|
|||
|
||||
};
|
||||
|
||||
/**material data, */
|
||||
/**material data,
|
||||
* @js NA
|
||||
*/
|
||||
struct MaterialData
|
||||
{
|
||||
std::map<int, std::string> texturePaths; //submesh id, texture path
|
||||
|
@ -272,7 +288,9 @@ struct MaterialData
|
|||
};
|
||||
|
||||
|
||||
/**new material, since 3.3 */
|
||||
/**new material, since 3.3
|
||||
* @js NA
|
||||
*/
|
||||
struct NTextureData
|
||||
{
|
||||
enum class Usage {
|
||||
|
@ -308,7 +326,9 @@ struct NMaterialData
|
|||
return nullptr;
|
||||
}
|
||||
};
|
||||
/** material datas, since 3.3 */
|
||||
/** material datas, since 3.3
|
||||
* @js NA
|
||||
*/
|
||||
struct MaterialDatas
|
||||
{
|
||||
std::vector<NMaterialData> materials;
|
||||
|
@ -326,7 +346,9 @@ struct MaterialDatas
|
|||
return nullptr;
|
||||
}
|
||||
};
|
||||
/**animation data*/
|
||||
/**animation data
|
||||
* @js NA
|
||||
*/
|
||||
struct Animation3DData
|
||||
{
|
||||
public:
|
||||
|
@ -396,7 +418,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/**reference data*/
|
||||
/**reference data
|
||||
* @js NA
|
||||
*/
|
||||
struct Reference
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -35,7 +35,13 @@
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* BundleReader is an interface for reading sequence of bytes.
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief BundleReader is an interface for reading sequence of bytes.
|
||||
* @js NA
|
||||
*/
|
||||
class BundleReader: public cocos2d::Ref
|
||||
{
|
||||
|
@ -201,6 +207,8 @@ inline bool BundleReader::readArray<std::string>(unsigned int *length, std::vect
|
|||
return true;
|
||||
}
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ class Camera;
|
|||
/**
|
||||
* the frustum is a six-side geometry, usually use the frustum to do fast-culling:
|
||||
* check a entity whether is a potential visible entity
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL Frustum
|
||||
{
|
||||
|
|
|
@ -36,13 +36,18 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class Texture2D;
|
||||
class MeshSkin;
|
||||
class MeshIndexData;
|
||||
class GLProgramState;
|
||||
class GLProgram;
|
||||
/**
|
||||
* Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on
|
||||
* @brief Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on
|
||||
*/
|
||||
class CC_DLL Mesh : public Ref
|
||||
{
|
||||
|
@ -158,6 +163,10 @@ protected:
|
|||
std::function<void()> _visibleChanged;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCMESH_H__
|
||||
|
|
|
@ -33,12 +33,18 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class Bone3D;
|
||||
class Skeleton3D;
|
||||
|
||||
/**
|
||||
* MeshSkin, A class maintain a collection of bones that affect Mesh vertex.
|
||||
* @brief MeshSkin, A class maintain a collection of bones that affect Mesh vertex.
|
||||
* And it is responsible for computing matrix palletes that used by skin mesh rendering.
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL MeshSkin: public Ref
|
||||
{
|
||||
|
@ -99,6 +105,9 @@ protected:
|
|||
Vec4* _matrixPalette;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCSKIN_H__
|
||||
|
|
|
@ -41,11 +41,17 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class MeshVertexData;
|
||||
|
||||
/**
|
||||
* the MeshIndexData class.
|
||||
* @brief the MeshIndexData contain all of the indices data which mesh need.
|
||||
* @js NA
|
||||
*/
|
||||
class MeshIndexData : public Ref
|
||||
{
|
||||
|
@ -132,6 +138,9 @@ protected:
|
|||
int _vertexCount; //vertex count
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCMESHVERTEXINDEXDATA_H__
|
||||
|
|
|
@ -29,9 +29,15 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Oritened Bounding Box(OBB)
|
||||
* @brief the OBB is similar to the AABB but the bounding box has the same direction as Sprite3D. so it's collistion detection more precise than AABB
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL OBB
|
||||
{
|
||||
|
@ -129,6 +135,9 @@ public:
|
|||
Vec3 _extents; // obb length along each axis
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif
|
||||
|
|
|
@ -613,6 +613,8 @@ std::string ObjLoader::LoadObj(shapes_t& shapes, const char* filename, const cha
|
|||
// use mtl
|
||||
if ((0 == strncmp(token, "usemtl", 6)) && isSpace((token[6])))
|
||||
{
|
||||
exportFaceGroupToShape(vertexCache, shapes, v, vn, vt, faceGroup, material, name);
|
||||
faceGroup.clear();
|
||||
|
||||
char namebuf[4096];
|
||||
token += 7;
|
||||
|
|
|
@ -17,7 +17,13 @@
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* .obj file Loader
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief .obj file Loader
|
||||
* @js NA
|
||||
**/
|
||||
class ObjLoader
|
||||
{
|
||||
|
@ -100,6 +106,9 @@ public:
|
|||
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // _TINY_OBJ_LOADER_H
|
||||
|
|
|
@ -39,6 +39,7 @@ enum class PointSide
|
|||
|
||||
/**
|
||||
* Defines plane
|
||||
* @js NA
|
||||
**/
|
||||
class CC_DLL Plane
|
||||
{
|
||||
|
|
|
@ -33,7 +33,13 @@
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB
|
||||
* @js NA
|
||||
**/
|
||||
class CC_DLL Ray
|
||||
{
|
||||
|
@ -93,6 +99,9 @@ public:
|
|||
Vec3 _direction; // The ray direction vector.
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif
|
||||
|
|
|
@ -33,7 +33,12 @@
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* Defines a basic hierachial structure of transformation spaces.
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Defines a basic hierachial structure of transformation spaces.
|
||||
*/
|
||||
class CC_DLL Bone3D : public Ref
|
||||
{
|
||||
|
@ -226,6 +231,9 @@ protected:
|
|||
Vector<Bone3D*> _rootBones;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCSKELETON3D_H__
|
||||
|
|
|
@ -478,6 +478,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m
|
|||
{
|
||||
if(it->bones.size() > 0 || singleSprite)
|
||||
{
|
||||
this->setName(nodedata->id);
|
||||
auto mesh = Mesh::create(nodedata->id, getMeshIndexData(it->subMeshId));
|
||||
if(mesh)
|
||||
{
|
||||
|
@ -518,6 +519,17 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vec3 pos;
|
||||
Quaternion qua;
|
||||
Vec3 scale;
|
||||
nodedata->transform.decompose(&scale, &qua, &pos);
|
||||
setPosition3D(pos);
|
||||
setRotationQuat(qua);
|
||||
setScaleX(scale.x);
|
||||
setScaleY(scale.y);
|
||||
setScaleZ(scale.z);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -41,12 +41,17 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class Mesh;
|
||||
class Texture2D;
|
||||
class MeshSkin;
|
||||
class AttachNode;
|
||||
struct NodeData;
|
||||
/** Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */
|
||||
/** @brief Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */
|
||||
class CC_DLL Sprite3D : public Node, public BlendProtocol
|
||||
{
|
||||
public:
|
||||
|
@ -286,5 +291,8 @@ protected:
|
|||
|
||||
extern std::string CC_DLL s_attributeNames[];//attribute names array
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
#endif // __SPRITE3D_H_
|
||||
|
|
|
@ -31,10 +31,16 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class Texture2D;
|
||||
|
||||
/**
|
||||
* the sprite3D material is only texture for now
|
||||
* @brief the sprite3D material is only texture for now
|
||||
* @js NA
|
||||
*/
|
||||
class Sprite3DMaterialCache
|
||||
{
|
||||
|
@ -65,6 +71,9 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCSPRIT3DMATERIAL_H__
|
||||
|
|
|
@ -48,6 +48,7 @@ NS_CC_BEGIN
|
|||
/**
|
||||
* @class AsyncTaskPool
|
||||
* @brief This class allows to perform background operations without having to manipulate threads.
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL AsyncTaskPool
|
||||
{
|
||||
|
@ -86,7 +87,6 @@ public:
|
|||
* @param callback callback when the task is finished. The callback is called in the main thread instead of task thread.
|
||||
* @param callbackParam parameter used by the callback.
|
||||
* @param f task can be lambda function.
|
||||
* @param args task parameters.
|
||||
*/
|
||||
template<class F>
|
||||
inline void enqueue(TaskType type, const TaskCallBack& callback, void* callbackParam, F&& f);
|
||||
|
|
|
@ -44,7 +44,7 @@ class CC_DLL AutoreleasePool
|
|||
{
|
||||
public:
|
||||
/**
|
||||
* @warn Don't create an autorelease pool in heap, create it in stack.
|
||||
* @warning Don't create an autorelease pool in heap, create it in stack.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
|
||||
/**
|
||||
* Create an autorelease pool with specific name. This name is useful for debugging.
|
||||
* @warn Don't create an autorelease pool in heap, create it in stack.
|
||||
* @warning Don't create an autorelease pool in heap, create it in stack.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*
|
||||
|
|
|
@ -52,9 +52,9 @@ private:
|
|||
friend class EventListenerAcceleration;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
||||
// end of base group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif /* defined(__cocos2d_libs__CCAccelerometerEvent__) */
|
||||
|
|
|
@ -61,7 +61,7 @@ class CC_DLL EventListenerCustom : public EventListener
|
|||
{
|
||||
public:
|
||||
/** Creates an event listener with type and callback.
|
||||
* @param eventType The type of the event.
|
||||
* @param eventName The type of the event.
|
||||
* @param callback The callback function when the specified event was emitted.
|
||||
* @return An autoreleased EventListenerCustom object.
|
||||
*/
|
||||
|
|
|
@ -56,21 +56,18 @@ public:
|
|||
|
||||
/**
|
||||
* @brief Dispatches the input text from IME.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void dispatchInsertText(const char * text, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Dispatches the delete-backward operation.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void dispatchDeleteBackward();
|
||||
|
||||
/**
|
||||
* @brief Get the content text from IMEDelegate, retrieved previously from IME.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
const std::string& getContentText();
|
||||
|
@ -79,22 +76,18 @@ public:
|
|||
// dispatch keyboard notification
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void dispatchKeyboardWillShow(IMEKeyboardNotificationInfo& info);
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void dispatchKeyboardDidShow(IMEKeyboardNotificationInfo& info);
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void dispatchKeyboardWillHide(IMEKeyboardNotificationInfo& info);
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
void dispatchKeyboardDidHide(IMEKeyboardNotificationInfo& info);
|
||||
|
|
|
@ -48,6 +48,7 @@ NS_CC_BEGIN
|
|||
* Similar to std::unordered_map, but it will manage reference count automatically internally.
|
||||
* Which means it will invoke Ref::retain() when adding an element, and invoke Ref::release() when removing an element.
|
||||
* @warning The element should be `Ref` or its sub-class.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
template <class K, class V>
|
||||
|
|
|
@ -31,7 +31,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup data_structures
|
||||
* @addtogroup base
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ public:
|
|||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
/** Unschedule a script entry.
|
||||
* @warn Don't invoke this function unless you know what you are doing.
|
||||
* @warning Don't invoke this function unless you know what you are doing.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
|
|
|
@ -35,15 +35,15 @@
|
|||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
|
||||
typedef struct lua_State lua_State;
|
||||
|
||||
/**
|
||||
* @addtogroup base
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
|
||||
typedef struct lua_State lua_State;
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
class TimerScriptHandler;
|
||||
|
@ -60,6 +60,7 @@ enum ccScriptType {
|
|||
|
||||
/**
|
||||
* This classes is wrapped to store the handler corresponding to the Lua function pointer and assign the handler a unique id
|
||||
* @js NA
|
||||
*/
|
||||
class ScriptHandlerEntry : public Ref
|
||||
{
|
||||
|
@ -120,6 +121,7 @@ protected:
|
|||
/**
|
||||
* The SchedulerScriptHandlerEntry is used to store the handler corresponding to the Lua function pointer and assign the handler a unique id like ScriptHandlerEntry.
|
||||
* Meanwhile,create a timer that named TimerScriptHandler to execute the Lua function corresponding to the handler in the interval time if the SchedulerScriptHandlerEntry object isn't paused.
|
||||
* @js NA
|
||||
*/
|
||||
class SchedulerScriptHandlerEntry : public ScriptHandlerEntry
|
||||
{
|
||||
|
@ -201,6 +203,7 @@ private:
|
|||
|
||||
/**
|
||||
* @cond
|
||||
* @js NA
|
||||
*/
|
||||
class TouchScriptHandlerEntry : public ScriptHandlerEntry
|
||||
{
|
||||
|
@ -239,6 +242,7 @@ private:
|
|||
|
||||
/**
|
||||
* @endcond
|
||||
* @js NA
|
||||
*/
|
||||
|
||||
/** ScriptEventType enum*/
|
||||
|
@ -260,6 +264,7 @@ enum ScriptEventType
|
|||
|
||||
/**
|
||||
* For Lua, Wrapper the script data that should be used to find the handler corresponding to the Lua function by the nativeobject pointer and store the value pointer which would be converted concretely by the different events,then the converted data would be passed into the Lua stack.
|
||||
* @js NA
|
||||
*/
|
||||
struct BasicScriptData
|
||||
{
|
||||
|
@ -293,6 +298,7 @@ struct BasicScriptData
|
|||
|
||||
/**
|
||||
* For Lua, the SchedulerScriptData is used to find the Lua function pointer by the handler, then call the Lua function by push the elapse into the Lua stack as a parameter when scheduler update event is triggered.
|
||||
* @js NA
|
||||
*/
|
||||
struct SchedulerScriptData
|
||||
{
|
||||
|
@ -329,6 +335,7 @@ struct SchedulerScriptData
|
|||
|
||||
/**
|
||||
* For Lua, the TouchesScriptData is used to find the Lua function pointer by the nativeObject, then call the Lua function by push touches data and actionType into the Lua stack as the parameters when the touches event is triggered.
|
||||
* @js NA
|
||||
*/
|
||||
struct TouchesScriptData
|
||||
{
|
||||
|
@ -378,6 +385,7 @@ struct TouchesScriptData
|
|||
|
||||
/**
|
||||
* For Lua, the TouchScriptData is used to find the Lua function pointer by the nativeObject, then call the Lua function by push touch data and actionType convered to string type into the Lua stack as the parameters when the touch event is triggered.
|
||||
* @js NA
|
||||
*/
|
||||
struct TouchScriptData
|
||||
{
|
||||
|
@ -428,6 +436,7 @@ struct TouchScriptData
|
|||
|
||||
/**
|
||||
* For Lua, the KeypadScriptData is used to find the Lua function pointer by the nativeObject, then call the Lua function by push the actionType convered to string type into the Lua stack as the parameters when the Keypad event is triggered.
|
||||
* @js NA
|
||||
*/
|
||||
struct KeypadScriptData
|
||||
{
|
||||
|
@ -461,6 +470,7 @@ struct KeypadScriptData
|
|||
|
||||
/**
|
||||
* For Lua, the CommonScriptData is used to find the Lua function pointer by the handler, then call the Lua function by push the eventName, eventSource(if it not nullptr), eventSourceClassName(if it is nullptr or "", and the eventSource is not nullptr,would give the default string "cc.Ref") into the Lua stack as the parameter when the common event such as is triggered.
|
||||
* @js NA
|
||||
*/
|
||||
struct CommonScriptData
|
||||
{
|
||||
|
@ -519,6 +529,7 @@ struct CommonScriptData
|
|||
/**
|
||||
* The ScriptEvent wrapper the different script data corresponding to the ScriptEventType in to the unified struct.
|
||||
* when the corresponding event is triggered, we could call the `sendEvent` of ScriptEngineProtocol to handle the event.
|
||||
* @js NA
|
||||
*/
|
||||
struct ScriptEvent
|
||||
{
|
||||
|
@ -554,6 +565,7 @@ struct ScriptEvent
|
|||
* Don't make ScriptEngineProtocol inherits from Object since setScriptEngine is invoked only once in AppDelegate.cpp,
|
||||
* It will affect the lifecycle of ScriptEngine instance, the autorelease pool will be destroyed before destructing ScriptEngine.
|
||||
* So a crash will appear on Win32 if you click the close button.
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL ScriptEngineProtocol
|
||||
{
|
||||
|
@ -701,6 +713,7 @@ class Node;
|
|||
* ScriptEngineManager is a singleton which manager an object instance of ScriptEngineProtocl, such as LuaEngine.
|
||||
*
|
||||
* @since v0.99.5-x-0.8.5
|
||||
* @js NA
|
||||
*/
|
||||
class CC_DLL ScriptEngineManager
|
||||
{
|
||||
|
@ -807,9 +820,11 @@ private:
|
|||
|
||||
NS_CC_END
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
|
||||
#endif // #if CC_ENABLE_SCRIPT_BINDING
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
#endif // __SCRIPT_SUPPORT_H__
|
||||
|
|
|
@ -32,7 +32,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup input
|
||||
* @addtogroup base
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@ -134,7 +134,7 @@ private:
|
|||
Vec2 _prevPoint;
|
||||
};
|
||||
|
||||
// end of input group
|
||||
// end of base group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -46,10 +46,10 @@ NS_CC_MATH_BEGIN
|
|||
* Vectors are treated as columns, resulting in a matrix that is represented as follows,
|
||||
* where x, y and z are the translation components of the matrix:
|
||||
*
|
||||
* 1 0 0 x
|
||||
* 0 1 0 y
|
||||
* 0 0 1 z
|
||||
* 0 0 0 1
|
||||
* 1 0 0 x
|
||||
* 0 1 0 y
|
||||
* 0 0 1 z
|
||||
* 0 0 0 1
|
||||
*
|
||||
* This matrix class is directly compatible with OpenGL since its elements are
|
||||
* laid out in memory exactly as they are expected by OpenGL.
|
||||
|
@ -98,13 +98,14 @@ public:
|
|||
float m[16];
|
||||
#endif
|
||||
|
||||
/**
|
||||
/**
|
||||
* Default constructor.
|
||||
* Constructs a matrix initialized to the identity matrix:
|
||||
*
|
||||
* 1 0 0 0
|
||||
* 0 1 0 0
|
||||
* 0 0 1 0
|
||||
* 0 0 0 1
|
||||
* 1 0 0 0
|
||||
* 0 1 0 0
|
||||
* 0 0 1 0
|
||||
* 0 0 0 1
|
||||
*/
|
||||
Mat4();
|
||||
|
||||
|
|
|
@ -102,13 +102,13 @@
|
|||
self.statusString = @"OK";
|
||||
|
||||
/*The individual values of the numeric status codes defined for HTTP/1.1
|
||||
| “200” ; OK
|
||||
| “201” ; Created
|
||||
| “202” ; Accepted
|
||||
| “203” ; Non-Authoritative Information
|
||||
| “204” ; No Content
|
||||
| “205” ; Reset Content
|
||||
| “206” ; Partial Content
|
||||
| "200" ; OK
|
||||
| "201" ; Created
|
||||
| "202" ; Accepted
|
||||
| "203" ; Non-Authoritative Information
|
||||
| "204" ; No Content
|
||||
| "205" ; Reset Content
|
||||
| "206" ; Partial Content
|
||||
*/
|
||||
if (responseCode < 200 || responseCode >= 300)
|
||||
{// something went wrong, abort the whole thing
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __CCHTTPREQUEST_H__
|
||||
#define __CCHTTPREQUEST_H__
|
||||
#ifndef __CCHTTPCLIENT_H__
|
||||
#define __CCHTTPCLIENT_H__
|
||||
|
||||
#include "network/HttpRequest.h"
|
||||
#include "network/HttpResponse.h"
|
||||
|
|
|
@ -52,6 +52,9 @@ namespace network {
|
|||
class WsThreadHelper;
|
||||
class WsMessage;
|
||||
|
||||
/**
|
||||
* WebSocket is wrapper of the libwebsockets-protocol, let the develop could call the websocket easily.
|
||||
*/
|
||||
class CC_DLL WebSocket
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -471,7 +471,7 @@ public:
|
|||
@param a A is the body to connect.
|
||||
@param b B is the body to connect.
|
||||
@param phase Phase is the initial offset to use when deciding where the ratchet angles are.
|
||||
@param ratchet Ratchet is the distance between “clicks”.
|
||||
@param ratchet Ratchet is the distance between "clicks".
|
||||
@return A object pointer.
|
||||
*/
|
||||
static PhysicsJointRatchet* construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet);
|
||||
|
@ -488,10 +488,10 @@ public:
|
|||
/** Set the initial offset.*/
|
||||
void setPhase(float phase);
|
||||
|
||||
/** Get the distance between “clicks”.*/
|
||||
/** Get the distance between "clicks".*/
|
||||
float getRatchet() const;
|
||||
|
||||
/** Set the distance between “clicks”.*/
|
||||
/** Set the distance between "clicks".*/
|
||||
void setRatchet(float ratchet);
|
||||
virtual bool createConstraints() override;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup platform
|
||||
* @addtogroup core
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
* If you don't want to system default implementation after setting delegate, you can just pass nullptr
|
||||
* to this function.
|
||||
*
|
||||
* @warm It will delete previous delegate
|
||||
* @warning It will delete previous delegate
|
||||
* @lua NA
|
||||
*/
|
||||
static void setDelegate(FileUtils *delegate);
|
||||
|
@ -103,8 +103,8 @@ public:
|
|||
* Gets resource file data
|
||||
*
|
||||
* @param[in] filename The resource file name which contains the path.
|
||||
* @param[in] pszMode The read mode of the file.
|
||||
* @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0.
|
||||
* @param[in] mode The read mode of the file.
|
||||
* @param[out] size If the file read operation succeeds, it will be the data size, otherwise 0.
|
||||
* @return Upon success, a pointer to the data is returned, otherwise NULL.
|
||||
* @warning Recall: you are responsible for calling free() on any Non-NULL pointer returned.
|
||||
*/
|
||||
|
|
|
@ -87,7 +87,7 @@ struct GLContextAttrs
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup platform
|
||||
* @addtogroup core
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
void insertQuad(V3F_C4B_T2F_Quad* quad, ssize_t index);
|
||||
|
||||
/** Inserts a c array of quads at a given index.
|
||||
@param quad Quad that are going to be rendered.
|
||||
@param quads Quad that are going to be rendered.
|
||||
@param index Index must be between 0 and the atlas capacity - 1.
|
||||
@param amount The quads array amount.
|
||||
@attention This method doesn't enlarge the array when amount + index > totalQuads.
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
-- @return Action#Action self (return value: cc.Action)
|
||||
|
||||
--------------------------------
|
||||
-- Return certain target..<br>
|
||||
-- Return certain target.<br>
|
||||
-- return A certain target.
|
||||
-- @function [parent=#Action] getTarget
|
||||
-- @param self
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Sets the delay in seconds of the "delay unit".<br>
|
||||
-- param setDelayPerUnit The delay in seconds of the "delay unit".
|
||||
-- param delayPerUnit The delay in seconds of the "delay unit".
|
||||
-- @function [parent=#Animation] setDelayPerUnit
|
||||
-- @param self
|
||||
-- @param #float delayPerUnit
|
||||
|
|
|
@ -11,12 +11,13 @@
|
|||
|
||||
--------------------------------
|
||||
-- Sets the current playback position of an audio instance.<br>
|
||||
-- param audioID An audioID returned by the play2d function.<br>
|
||||
-- param audioID An audioID returned by the play2d function.<br>
|
||||
-- param sec The offset in seconds from the start to seek to.<br>
|
||||
-- return
|
||||
-- @function [parent=#AudioEngine] setCurrentTime
|
||||
-- @param self
|
||||
-- @param #int audioID
|
||||
-- @param #float time
|
||||
-- @param #float sec
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
--------------------------------
|
||||
-- Initializes the action with a duration and an array of points.<br>
|
||||
-- param duration In seconds.<br>
|
||||
-- param point An PointArray.<br>
|
||||
-- param points An PointArray.<br>
|
||||
-- param tension Goodness of fit.
|
||||
-- @function [parent=#CardinalSplineTo] initWithDuration
|
||||
-- @param self
|
||||
|
|
|
@ -25,13 +25,14 @@
|
|||
-- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Apply user defined uniforms.
|
||||
-- @function [parent=#GLProgramState] applyUniforms
|
||||
-- @param self
|
||||
-- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Apply GLProgram, and built in uniforms.<br>
|
||||
-- param modelView The applied modelView matrix to shader.
|
||||
-- @function [parent=#GLProgramState] applyGLProgram
|
||||
-- @param self
|
||||
-- @param #mat4_table modelView
|
||||
|
@ -44,7 +45,8 @@
|
|||
-- @return long#long ret (return value: long)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Apply attributes.<br>
|
||||
-- param applyAttribFlags Call GL::enableVertexAttribs(_vertexAttribsFlags) or not.
|
||||
-- @function [parent=#GLProgramState] applyAttributes
|
||||
-- @param self
|
||||
-- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState)
|
||||
|
@ -115,14 +117,8 @@
|
|||
-- @return unsigned int#unsigned int ret (return value: unsigned int)
|
||||
|
||||
--------------------------------
|
||||
-- @{<br>
|
||||
-- Apply GLProgram, attributes and uniforms.<br>
|
||||
-- `apply` function will apply all the states, include GLProgram, attributes and uniforms.<br>
|
||||
-- `applyGLProgram` function will apply GLProgram and built in uniform.<br>
|
||||
-- `applyAttributes` will apply the vertex attributes.<br>
|
||||
-- `applyUniforms` will apply user defined uniforms.<br>
|
||||
-- param The applied modelView matrix to shader.<br>
|
||||
-- param applyAttribFlags Call GL::enableVertexAttribs(_vertexAttribsFlags) or not.
|
||||
-- param modelView The applied modelView matrix to shader.
|
||||
-- @function [parent=#GLProgramState] apply
|
||||
-- @param self
|
||||
-- @param #mat4_table modelView
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
-- param t Duration in seconds.<br>
|
||||
-- param radius The start radius.<br>
|
||||
-- param deltaRadius The delta radius.<br>
|
||||
-- param angelZ The start Angel in Z.<br>
|
||||
-- param angleZ The start Angel in Z.<br>
|
||||
-- param deltaAngleZ The delta angle in Z.<br>
|
||||
-- param angelX The start Angel in X.<br>
|
||||
-- param angleX The start Angel in X.<br>
|
||||
-- param deltaAngleX The delta angle in X.<br>
|
||||
-- return An OrbitCamera.
|
||||
-- @function [parent=#OrbitCamera] create
|
||||
|
|
|
@ -306,7 +306,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- brief Set the body mass.<br>
|
||||
-- attension If you need add/subtract mass to body, don't use setMass(getMass() +/- mass), because the mass of body may be equal to PHYSICS_INFINITY, it will cause some unexpected result, please use addMass() instead.
|
||||
-- attention If you need add/subtract mass to body, don't use setMass(getMass() +/- mass), because the mass of body may be equal to PHYSICS_INFINITY, it will cause some unexpected result, please use addMass() instead.
|
||||
-- @function [parent=#PhysicsBody] setMass
|
||||
-- @param self
|
||||
-- @param #float mass
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Get this box's width and height.<br>
|
||||
-- preturn An Size object.
|
||||
-- return An Size object.
|
||||
-- @function [parent=#PhysicsShapeBox] getSize
|
||||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Get this chain's points array count.<br>
|
||||
-- preturn An interger number.
|
||||
-- return An interger number.
|
||||
-- @function [parent=#PhysicsShapeEdgeChain] getPointsCount
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Get this polygon's points array count.<br>
|
||||
-- preturn An interger number.
|
||||
-- return An interger number.
|
||||
-- @function [parent=#PhysicsShapeEdgePolygon] getPointsCount
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Get this polygon's points array count.<br>
|
||||
-- preturn An interger number.
|
||||
-- return An interger number.
|
||||
-- @function [parent=#PhysicsShapePolygon] getPointsCount
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Clears the texture with a specified stencil value.<br>
|
||||
-- param A specified stencil value.
|
||||
-- param stencilValue A specified stencil value.
|
||||
-- @function [parent=#RenderTexture] clearStencil
|
||||
-- @param self
|
||||
-- @param #int stencilValue
|
||||
|
@ -54,7 +54,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Sets the Sprite being used. <br>
|
||||
-- param A Sprite.
|
||||
-- param sprite A Sprite.
|
||||
-- @function [parent=#RenderTexture] setSprite
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
|
@ -146,7 +146,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Clears the texture with a specified depth value. <br>
|
||||
-- param A specified depth value.
|
||||
-- param depthValue A specified depth value.
|
||||
-- @function [parent=#RenderTexture] clearDepth
|
||||
-- @param self
|
||||
-- @param #float depthValue
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
--------------------------------
|
||||
-- Set the group name. <br>
|
||||
-- param groupname A string,it is used to set the group name.
|
||||
-- param groupName A string,it is used to set the group name.
|
||||
-- @function [parent=#TMXObjectGroup] setGroupName
|
||||
-- @param self
|
||||
-- @param #string groupName
|
||||
|
|
|
@ -57,6 +57,9 @@ typedef enum {
|
|||
/**
|
||||
* Build bridge between ObjC and Lua.
|
||||
* It makes Lua and ObjC can call each other conveniently.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
class LuaBridge
|
||||
{
|
||||
|
@ -65,8 +68,6 @@ public:
|
|||
* Get the LuaStack of LuaEngine.
|
||||
*
|
||||
* @return the LuaStack object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static LuaStack *getStack(void);
|
||||
/**
|
||||
|
@ -74,8 +75,6 @@ public:
|
|||
* If it don't find the function pointer corresponding to functionId, it will reset stack top index to the index before searching.
|
||||
*
|
||||
* @param functionId the value used to search the `lua_bridge_function_id` table.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static int pushLuaFunctionById(int functionId);
|
||||
|
||||
|
@ -86,8 +85,6 @@ public:
|
|||
*
|
||||
* @param functionId the value used to search the `lua_bridge_function_id_retain` table.
|
||||
* @return the retain count or 0.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static int retainLuaFunctionById(int functionId);
|
||||
|
||||
|
@ -99,8 +96,6 @@ public:
|
|||
*
|
||||
* @param functionId the value used to search the `lua_bridge_function_id` table and `lua_bridge_function_id` table.
|
||||
* @return the retain count or 0.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static int releaseLuaFunctionById(int functionId);
|
||||
|
||||
|
|
|
@ -45,6 +45,9 @@ NS_CC_BEGIN
|
|||
|
||||
/**
|
||||
* The Lua engine integrated into the cocos2d-x to process the interactive operation between lua and c++.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
class LuaEngine : public ScriptEngineProtocol
|
||||
{
|
||||
|
@ -53,23 +56,17 @@ public:
|
|||
* Get instance of LuaEngine.
|
||||
*
|
||||
* @return the instance of LuaEngine.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static LuaEngine* getInstance(void);
|
||||
/**
|
||||
* Get defaultEngine of LuaEngine, it was deprecated.
|
||||
*
|
||||
* @return the instance of LuaEngine.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); }
|
||||
|
||||
/**
|
||||
* Destrutor of LuaEngine.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual ~LuaEngine(void);
|
||||
|
||||
|
@ -77,8 +74,6 @@ public:
|
|||
* Get ccScriptType of LuaEngine used, it is always kScriptTypeLua.
|
||||
*
|
||||
* @return kScriptTypeLua.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual ccScriptType getScriptType() override {
|
||||
return kScriptTypeLua;
|
||||
|
@ -89,8 +84,6 @@ public:
|
|||
* All the interactive operation are all base on the LuaStack.
|
||||
*
|
||||
* @return LuaStack object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
LuaStack *getLuaStack(void) {
|
||||
return _stack;
|
||||
|
@ -100,8 +93,6 @@ public:
|
|||
* Add a path to find lua files in.
|
||||
*
|
||||
* @param path to be added to the Lua path.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void addSearchPath(const char* path);
|
||||
|
||||
|
@ -109,8 +100,6 @@ public:
|
|||
* Add lua loader.
|
||||
*
|
||||
* @param func a function pointer point to the loader function.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void addLuaLoader(lua_CFunction func);
|
||||
|
||||
|
@ -120,8 +109,6 @@ public:
|
|||
*
|
||||
* @param moduleFileName String object holding the filename of the script file that is to be executed.
|
||||
* @return 0 if the string is excuted correctly or other if the string is excuted wrongly.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int reload(const char* moduleFileName);
|
||||
|
||||
|
@ -133,8 +120,6 @@ public:
|
|||
* In current mechanism, this function is called in the destructor of Ref object, developer don't call this functions.
|
||||
*
|
||||
* @param object the key object to remove script object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void removeScriptObjectByObject(Ref* object) override;
|
||||
|
||||
|
@ -142,8 +127,6 @@ public:
|
|||
* Remove Lua function reference by nHandler by setting toluafix_refid_function_mapping[nHandle] nil.
|
||||
*
|
||||
* @param nHandler the function refrence index to find the correspoinding Lua function pointer.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void removeScriptHandler(int nHandler) override;
|
||||
|
||||
|
@ -151,8 +134,6 @@ public:
|
|||
* Reallocate Lua function reference index to the Lua function pointer to add refrence.
|
||||
*
|
||||
* @param nHandler the function refrence index to find the correspoinding Lua function pointer.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int reallocateScriptHandler(int nHandler) override;
|
||||
|
||||
|
@ -161,8 +142,6 @@ public:
|
|||
*
|
||||
* @param codes holding the valid script code that should be executed.
|
||||
* @return 0 if the string is excuted correctly,other if the string is excuted wrongly.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeString(const char* codes) override;
|
||||
|
||||
|
@ -171,8 +150,6 @@ public:
|
|||
*
|
||||
* @param filename String object holding the filename of the script file that is to be executed.
|
||||
* @return the return values by calling executeFunction.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeScriptFile(const char* filename) override;
|
||||
|
||||
|
@ -182,8 +159,6 @@ public:
|
|||
*
|
||||
* @param functionName String object holding the name of the function, in the global script environment, that is to be executed.
|
||||
* @return The integer value returned from the script function.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeGlobalFunction(const char* functionName) override;
|
||||
virtual int executeNodeEvent(Node* pNode, int nAction);
|
||||
|
@ -200,8 +175,6 @@ public:
|
|||
* Handle the assert message.
|
||||
*
|
||||
* @return return true if current _callFromLua of LuaStack is not equal to 0 otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool handleAssert(const char *msg) override;
|
||||
|
||||
|
@ -211,8 +184,6 @@ public:
|
|||
* @param type in current mechanism,it always ConfigType::COCOSTUDIO.
|
||||
* @param str the information data.
|
||||
* @return if __onParseConfig function exist in the Lua, it return the value that _stack->executeFunction returns otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool parseConfig(ConfigType type, const std::string& str) override;
|
||||
|
||||
|
@ -221,8 +192,6 @@ public:
|
|||
*
|
||||
* @param message the ScriptEvent object that has ScriptEventType and the pointer to information data.
|
||||
* @return default return 0 otherwise return values the same as handleNodeEvent, handleMenuClickedEvent or handleCallFuncActionEvent,etc.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int sendEvent(ScriptEvent* message) override;
|
||||
|
||||
|
@ -232,8 +201,6 @@ public:
|
|||
* @param type Different ScriptHandlerMgr::HandlerType means different processing for the data.
|
||||
* @param data The pointer point to the information which should be pass on to lua, it would be parsed in the function to convert to the specific data according to the ScriptHandlerMgr::HandlerType,then pass to lua as function parameters.
|
||||
* @return default return 0 otherwise return values according different ScriptHandlerMgr::HandlerType.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int handleEvent(ScriptHandlerMgr::HandlerType type,void* data);
|
||||
/**
|
||||
|
@ -244,8 +211,6 @@ public:
|
|||
* @param numResults The number of the return values.
|
||||
* @param func The callback would be called when numResults is > 0.
|
||||
* @return default return 0 otherwise return values according different ScriptHandlerMgr::HandlerType.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int handleEvent(ScriptHandlerMgr::HandlerType type, void* data, int numResults, const std::function<void(lua_State*,int)>& func);
|
||||
private:
|
||||
|
|
|
@ -43,22 +43,19 @@ NS_CC_BEGIN
|
|||
/**
|
||||
* LuaStack is used to manager the operation on the lua_State,eg., push data onto the lua_State, execute the function depended on the lua_State.
|
||||
* In the current mechanism, there is only one lua_State in one LuaStack object.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
class LuaStack : public Ref
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create a LuaStack object, it will new a lua_State.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static LuaStack *create(void);
|
||||
/**
|
||||
* Create a LuaStack object with the existed lua_State.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static LuaStack *attach(lua_State *L);
|
||||
|
||||
|
@ -69,8 +66,6 @@ public:
|
|||
* Method used to get a pointer to the lua_State that the script module is attached to.
|
||||
*
|
||||
* @return A pointer to the lua_State that the script module is attached to.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
lua_State* getLuaState(void) {
|
||||
return _state;
|
||||
|
@ -80,8 +75,6 @@ public:
|
|||
* Add a path to find lua files in.
|
||||
*
|
||||
* @param path to be added to the Lua search path.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void addSearchPath(const char* path);
|
||||
|
||||
|
@ -89,8 +82,6 @@ public:
|
|||
* Add lua loader.
|
||||
*
|
||||
* @param func a function pointer point to the loader function.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void addLuaLoader(lua_CFunction func);
|
||||
|
||||
|
@ -100,8 +91,6 @@ public:
|
|||
*
|
||||
* @param moduleFileName String object holding the filename of the script file that is to be executed.
|
||||
* @return 0 if the string is excuted correctly or other if the string is excuted wrongly.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int reload(const char* moduleFileName);
|
||||
|
||||
|
@ -113,8 +102,6 @@ public:
|
|||
* In current mechanism, this function is called in the destructor of Ref object, developer don't call this functions.
|
||||
*
|
||||
* @param object the key object to remove script object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void removeScriptObjectByObject(Ref* object);
|
||||
|
||||
|
@ -122,8 +109,6 @@ public:
|
|||
* Remove Lua function reference by nHandler by setting toluafix_refid_function_mapping[nHandle] nil.
|
||||
*
|
||||
* @param nHandler the function refrence index to find the correspoinding Lua function pointer.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void removeScriptHandler(int nHandler);
|
||||
|
||||
|
@ -131,8 +116,6 @@ public:
|
|||
* Reallocate Lua function reference index to the Lua function pointer to add refrence.
|
||||
*
|
||||
* @param nHandler the function refrence index to find the correspoinding Lua function pointer.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int reallocateScriptHandler(int nHandler);
|
||||
|
||||
|
@ -141,8 +124,6 @@ public:
|
|||
*
|
||||
* @param codes holding the valid script code that should be executed.
|
||||
* @return 0 if the string is excuted correctly,other if the string is excuted wrongly.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeString(const char* codes);
|
||||
|
||||
|
@ -151,8 +132,6 @@ public:
|
|||
*
|
||||
* @param filename String object holding the filename of the script file that is to be executed.
|
||||
* @return the return values by calling executeFunction.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeScriptFile(const char* filename);
|
||||
|
||||
|
@ -162,16 +141,11 @@ public:
|
|||
*
|
||||
* @param functionName String object holding the name of the function, in the global script environment, that is to be executed.
|
||||
* @return The integer value returned from the script function.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeGlobalFunction(const char* functionName);
|
||||
|
||||
/**
|
||||
* Set the stack top index 0.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void clean(void);
|
||||
|
||||
|
@ -179,8 +153,6 @@ public:
|
|||
* Pushes a integer number with value intVaule onto the stack.
|
||||
*
|
||||
* @param intValue a integer number.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushInt(int intValue);
|
||||
|
||||
|
@ -188,8 +160,6 @@ public:
|
|||
* Pushes a float number with value floatValue onto the stack.
|
||||
*
|
||||
* @param floatValue a float number.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushFloat(float floatValue);
|
||||
|
||||
|
@ -197,8 +167,6 @@ public:
|
|||
* Pushes a long number with value longValue onto the stack.
|
||||
*
|
||||
* @param longValue a long number.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushLong(long longValue);
|
||||
|
||||
|
@ -206,8 +174,6 @@ public:
|
|||
* Pushes a bool value with boolValue onto the stack.
|
||||
*
|
||||
* @param boolValue a bool value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushBoolean(bool boolValue);
|
||||
|
||||
|
@ -215,8 +181,6 @@ public:
|
|||
* Pushes the zero-terminated string pointed to by stringValue onto the stack.
|
||||
*
|
||||
* @param stringValue a pointer point to a zero-terminated string stringValue.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushString(const char* stringValue);
|
||||
|
||||
|
@ -225,16 +189,11 @@ public:
|
|||
*
|
||||
* @param stringValue a pointer point to the string stringValue.
|
||||
* @param length the size.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushString(const char* stringValue, int length);
|
||||
|
||||
/**
|
||||
* Pushes a nil value onto the stack.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushNil(void);
|
||||
|
||||
|
@ -242,8 +201,6 @@ public:
|
|||
* Pushes a Ref object onto the stack.
|
||||
*
|
||||
* @see toluafix_pushusertype_ccobject.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushObject(Ref* objectValue, const char* typeName);
|
||||
|
||||
|
@ -259,8 +216,6 @@ public:
|
|||
* LuaValueTypeObject pushObject
|
||||
*
|
||||
* @param value a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushLuaValue(const LuaValue& value);
|
||||
|
||||
|
@ -270,8 +225,6 @@ public:
|
|||
* The value of table is according to the the type of LuaValue of LuaValueDict by calling pushLuaValue,@see pushLuaValue.
|
||||
*
|
||||
* @param dict a LuaValueDict object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushLuaValueDict(const LuaValueDict& dict);
|
||||
|
||||
|
@ -279,9 +232,6 @@ public:
|
|||
* Pushes a lua array table onto the stack.
|
||||
* The index of array table is begin at 1.
|
||||
* The value of array table is according to the the type of LuaValue of LuaValueDict by calling pushLuaValue,@see pushLuaValue.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void pushLuaValueArray(const LuaValueArray& array);
|
||||
|
||||
|
@ -290,8 +240,6 @@ public:
|
|||
* If the lua function pointer corresponding to the nHanlder isn't found, it would push nil on the top index of stack, then it would output the error log in the debug model.
|
||||
*
|
||||
* @return true if get the no-null function pointer otherwise false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool pushFunctionByHandler(int nHandler);
|
||||
|
||||
|
@ -300,8 +248,6 @@ public:
|
|||
*
|
||||
* @param numArgs the number of variables.
|
||||
* @return 0 if it happen the error or it hasn't return value, otherwise it return the value by calling the lua function.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeFunction(int numArgs);
|
||||
|
||||
|
@ -311,8 +257,6 @@ public:
|
|||
* @param nHandler the index count corresponding to the lua function.
|
||||
* @param numArgs the number of variables.
|
||||
* @return the return value is the same as executeFunction,please @see executeFunction.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeFunctionByHandler(int nHandler, int numArgs);
|
||||
|
||||
|
@ -326,8 +270,6 @@ public:
|
|||
* @param numResults the number of return value.
|
||||
* @param resultArray a array used to store the return value.
|
||||
* @return 0 if it happen error or it hasn't return value, otherwise return 1.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeFunctionReturnArray(int handler,int numArgs,int numResults,__Array& resultArray);
|
||||
|
||||
|
@ -341,8 +283,6 @@ public:
|
|||
* @param numResults the number of return value.
|
||||
* @param func callback function which is called if the numResults > 0.
|
||||
* @return 0 if it happen error or it hasn't return value, otherwise return 1.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual int executeFunction(int handler, int numArgs, int numResults, const std::function<void(lua_State*,int)>& func);
|
||||
|
||||
|
@ -350,8 +290,6 @@ public:
|
|||
* Handle the assert message.
|
||||
*
|
||||
* @return return true if current _callFromLua of LuaStack is not equal to 0 otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual bool handleAssert(const char *msg);
|
||||
|
||||
|
@ -362,16 +300,11 @@ public:
|
|||
* @param keyLen the length of key
|
||||
* @param sign a string sign
|
||||
* @param signLen the length of sign
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void setXXTEAKeyAndSign(const char *key, int keyLen, const char *sign, int signLen);
|
||||
|
||||
/**
|
||||
* free the key and sign for xxtea encryption algorithm.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual void cleanupXXTEAKeyAndSign();
|
||||
|
||||
|
@ -384,8 +317,6 @@ public:
|
|||
* @param chunkSize the size of buffer.
|
||||
* @param chunkName the name of chunk pointer.
|
||||
* @return 0, LUA_ERRSYNTAX or LUA_ERRMEM:.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
int luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, const char *chunkName);
|
||||
|
||||
|
@ -394,8 +325,6 @@ public:
|
|||
*
|
||||
* @param zipFilePath file path to zip file.
|
||||
* @return 1 if load sucessfully otherwise 0.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
int loadChunksFromZIP(const char *zipFilePath);
|
||||
|
||||
|
@ -404,8 +333,6 @@ public:
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @return 1 if load sucessfully otherwise 0.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
int luaLoadChunksFromZIP(lua_State *L);
|
||||
|
||||
|
|
|
@ -87,6 +87,9 @@ typedef union {
|
|||
/**
|
||||
* Wrap different general types of data into a same specific type named LuaValue.
|
||||
* The general types supported as follows:int,float,bool,std::string,const char*,LuaValueDict,LuaValueArray,Ref.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
class LuaValue
|
||||
{
|
||||
|
@ -97,8 +100,6 @@ public:
|
|||
*
|
||||
* @param intValue a int value.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue intValue(const int intValue);
|
||||
|
||||
|
@ -107,8 +108,6 @@ public:
|
|||
*
|
||||
* @param floatValue a float value.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue floatValue(const float floatValue);
|
||||
|
||||
|
@ -117,8 +116,6 @@ public:
|
|||
*
|
||||
* @param booleanValue a bool value.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue booleanValue(const bool booleanValue);
|
||||
|
||||
|
@ -127,8 +124,6 @@ public:
|
|||
*
|
||||
* @param stringValue a string pointer.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue stringValue(const char* stringValue);
|
||||
|
||||
|
@ -137,8 +132,6 @@ public:
|
|||
*
|
||||
* @param stringValue a std::string object.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue stringValue(const std::string& stringValue);
|
||||
|
||||
|
@ -147,8 +140,6 @@ public:
|
|||
*
|
||||
* @param dictValue a LuaValueDict object.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue dictValue(const LuaValueDict& dictValue);
|
||||
|
||||
|
@ -157,8 +148,6 @@ public:
|
|||
*
|
||||
* @param arrayValue a LuaValueArray object.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue arrayValue(const LuaValueArray& arrayValue);
|
||||
|
||||
|
@ -168,8 +157,6 @@ public:
|
|||
* @param ccobjectValue a Ref object.
|
||||
* @param objectTypename a string pointer point to the typename of object.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue ccobjectValue(Ref* ccobjectValue, const char* objectTypename);
|
||||
|
||||
|
@ -179,8 +166,6 @@ public:
|
|||
* @param ccobjectValue a Ref object.
|
||||
* @param objectTypename a std::string object represent the typename of object.
|
||||
* @return a LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static const LuaValue ccobjectValue(Ref* ccobjectValue, const std::string& objectTypename);
|
||||
|
||||
|
@ -188,9 +173,6 @@ public:
|
|||
/**
|
||||
* Default constuctor of LuaValue.
|
||||
* Set the default value for _type(LuaValueTypeInt) and _ccobjectType(nullptr),and init the _field.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
LuaValue(void)
|
||||
: _type(LuaValueTypeInt)
|
||||
|
@ -201,25 +183,16 @@ public:
|
|||
|
||||
/**
|
||||
* Copy constructor of Data.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
LuaValue(const LuaValue& rhs);
|
||||
|
||||
/**
|
||||
* Override of operator= .
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
LuaValue& operator=(const LuaValue& rhs);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
~LuaValue(void);
|
||||
|
||||
|
@ -227,8 +200,6 @@ public:
|
|||
* Get the type of LuaValue object.
|
||||
*
|
||||
* @return the type of LuaValue object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
const LuaValueType getType(void) const {
|
||||
return _type;
|
||||
|
@ -238,8 +209,6 @@ public:
|
|||
* Get the typename of the Ref object.
|
||||
*
|
||||
* @return the refrence of _ccobjectType.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
const std::string& getObjectTypename(void) const {
|
||||
return *_ccobjectType;
|
||||
|
@ -249,8 +218,6 @@ public:
|
|||
* Get the int value of LuaValue object.
|
||||
*
|
||||
* @return the int value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
int intValue(void) const {
|
||||
return _field.intValue;
|
||||
|
@ -260,8 +227,6 @@ public:
|
|||
* Get the float value of LuaValue object.
|
||||
*
|
||||
* @return the float value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
float floatValue(void) const {
|
||||
return _field.floatValue;
|
||||
|
@ -271,8 +236,6 @@ public:
|
|||
* Get the boolean value of LuaValue object.
|
||||
*
|
||||
* @return the boolean value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
bool booleanValue(void) const {
|
||||
return _field.booleanValue;
|
||||
|
@ -282,8 +245,6 @@ public:
|
|||
* Get the boolean value of LuaValue object.
|
||||
*
|
||||
* @return the refrence about string value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
const std::string& stringValue(void) const {
|
||||
return *_field.stringValue;
|
||||
|
@ -293,8 +254,6 @@ public:
|
|||
* Get the LuaValueDict value of LuaValue object.
|
||||
*
|
||||
* @return the LuaValueDict value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
const LuaValueDict& dictValue(void) const {
|
||||
return *_field.dictValue;
|
||||
|
@ -304,8 +263,6 @@ public:
|
|||
* Get the LuaValueArray value of LuaValue object.
|
||||
*
|
||||
* @return the LuaValueArray value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
const LuaValueArray& arrayValue(void) const {
|
||||
return *_field.arrayValue;
|
||||
|
@ -315,8 +272,6 @@ public:
|
|||
* Get the Ref object of LuaValue object.
|
||||
*
|
||||
* @return the pointer point to a Ref object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
Ref* ccobjectValue(void) const {
|
||||
return _field.ccobjectValue;
|
||||
|
|
|
@ -60,11 +60,10 @@ cocos2d::log(__VA_ARGS__); \
|
|||
* @param type the typename used to judge.
|
||||
* @param def whether has default value.
|
||||
* @return Return true if the typename of userdata at the given accepteable index of stack is equal to type, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def);
|
||||
// to native
|
||||
|
||||
/**
|
||||
* @name luaval_to_native
|
||||
* The following function are all used to convert the Lua values at the given acceptable index to the corresponding c++ values.
|
||||
|
@ -73,6 +72,7 @@ extern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def);
|
|||
* @{
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Get a unsigned long value from the given accpetable index of stack.
|
||||
* If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false .
|
||||
|
@ -82,8 +82,6 @@ extern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def);
|
|||
* @param outValue the pointer to store the value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue, const char* funcName="");
|
||||
|
||||
|
@ -96,8 +94,6 @@ extern bool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue, const
|
|||
* @param outValue the pointer to store the unsigned short value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -110,8 +106,6 @@ extern bool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue, con
|
|||
* @param outValue the pointer to store the int value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_int32(lua_State* L,int lo,int* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -124,8 +118,6 @@ extern bool luaval_to_int32(lua_State* L,int lo,int* outValue, const char* funcN
|
|||
* @param outValue the pointer to store the unsigned int value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -138,8 +130,6 @@ extern bool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue, const
|
|||
* @param outValue the pointer to store the uint16_t value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_uint16(lua_State* L,int lo,uint16_t* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -154,8 +144,6 @@ extern bool luaval_to_uint16(lua_State* L,int lo,uint16_t* outValue, const char*
|
|||
* @param outValue the pointer to store the boolean value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_boolean(lua_State* L,int lo,bool* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -168,8 +156,6 @@ extern bool luaval_to_boolean(lua_State* L,int lo,bool* outValue, const char* fu
|
|||
* @param outValue the pointer to store the double value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_number(lua_State* L,int lo,double* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -182,8 +168,6 @@ extern bool luaval_to_number(lua_State* L,int lo,double* outValue, const char* f
|
|||
* @param outValue the pointer to store the long long value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_long_long(lua_State* L,int lo,long long* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -196,8 +180,6 @@ extern bool luaval_to_long_long(lua_State* L,int lo,long long* outValue, const c
|
|||
* @param outValue the pointer to store std::string value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is is a string or a number convertible to a string, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -210,8 +192,6 @@ extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, co
|
|||
* @param outValue the pointer to store the long value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_long(lua_State* L,int lo, long* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -224,8 +204,6 @@ extern bool luaval_to_long(lua_State* L,int lo, long* outValue, const char* func
|
|||
* @param outValue the pointer to store the ssize_t value converted from the Lua value.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -239,8 +217,6 @@ extern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue, const char*
|
|||
* @param outValue the pointer to a Size object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_size(lua_State* L,int lo,Size* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -254,8 +230,6 @@ extern bool luaval_to_size(lua_State* L,int lo,Size* outValue, const char* funcN
|
|||
* @param outValue the pointer to a Rect object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -269,8 +243,6 @@ extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue, const char* funcN
|
|||
* @param outValue the pointer to a Color3B object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -284,8 +256,6 @@ extern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue, const char*
|
|||
* @param outValue the pointer to a Color4B object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_color4b(lua_State* L,int lo,Color4B* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -299,8 +269,6 @@ extern bool luaval_to_color4b(lua_State* L,int lo,Color4B* outValue, const char*
|
|||
* @param outValue the pointer to a Color4F object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue, const char* funcName = "");
|
||||
#if CC_USE_PHYSICS
|
||||
|
@ -315,8 +283,6 @@ extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue, const char*
|
|||
* @param outValue the pointer to a cocos2d::PhysicsMaterial object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue, const char* funcName = "");
|
||||
#endif //#if CC_USE_PHYSICS
|
||||
|
@ -330,8 +296,6 @@ extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMate
|
|||
* @param outValue the pointer to a AffineTransform object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -345,8 +309,6 @@ extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outV
|
|||
* @param outValue the pointer to a FontDefinition object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue , const char* funcName = "");
|
||||
|
||||
|
@ -360,26 +322,18 @@ extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outVa
|
|||
* @param outValue the pointer to a Mat object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_mat4(lua_State* L, int lo, cocos2d::Mat4* outValue , const char* funcName = "");
|
||||
|
||||
/**
|
||||
* Get a __Array object value frome the given accpetable index of stack.
|
||||
* Because __Array is deprecated, so this function would be not called anymore.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_array(lua_State* L,int lo, __Array** outValue, const char* funcName = "");
|
||||
|
||||
/**
|
||||
* Get a __Dictionary object value from the given accpetable index of stack.
|
||||
* Because __Dictionary is deprecated, so this function would be not called anymore.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue, const char* funcName = "");
|
||||
|
||||
|
@ -393,17 +347,12 @@ extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue, c
|
|||
* @param numPoints a int pointer to store the size of a Vec2 object array.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_array_of_vec2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints, const char* funcName = "");
|
||||
|
||||
/**
|
||||
* Get a __Array object value by the argc numbers of Lua values in the stack.
|
||||
* Because __Array is deprecated, so this function would be not called anymore.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret);
|
||||
|
||||
|
@ -414,8 +363,6 @@ extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret);
|
|||
* @param argc the numbers of Lua values in the stack.
|
||||
* @param ret the pointer to a ValueVector object which stores the values from the Lua table.
|
||||
* @return Return false if argc equal to 0 or L equal to nullptr, otherwise return true.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret);
|
||||
|
||||
|
@ -429,8 +376,6 @@ extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::V
|
|||
* @param outValue the pointer to a Vec2 object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_vec2(lua_State* L,int lo,cocos2d::Vec2* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -444,8 +389,6 @@ extern bool luaval_to_vec2(lua_State* L,int lo,cocos2d::Vec2* outValue, const ch
|
|||
* @param outValue the pointer to a Vec3 object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -459,8 +402,6 @@ extern bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue, const ch
|
|||
* @param outValue the pointer to a Vec4 object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_vec4(lua_State* L,int lo,cocos2d::Vec4* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -474,8 +415,6 @@ extern bool luaval_to_vec4(lua_State* L,int lo,cocos2d::Vec4* outValue, const ch
|
|||
* @param outValue the pointer to a BlendFunc object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -489,8 +428,6 @@ extern bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outVal
|
|||
* @param outValue the pointer to a TTFConfig object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ttfconfig(lua_State* L, int lo, cocos2d::TTFConfig* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -504,8 +441,6 @@ extern bool luaval_to_ttfconfig(lua_State* L, int lo, cocos2d::TTFConfig* outVal
|
|||
* @param outValue the pointer to a Uniform object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_uniform(lua_State* L, int lo, cocos2d::Uniform* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -519,8 +454,6 @@ extern bool luaval_to_uniform(lua_State* L, int lo, cocos2d::Uniform* outValue,
|
|||
* @param outValue the pointer to a VertexAttrib object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_vertexattrib(lua_State* L, int lo, cocos2d::VertexAttrib* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -529,9 +462,6 @@ extern bool luaval_to_vertexattrib(lua_State* L, int lo, cocos2d::VertexAttrib*
|
|||
* Get a Vec2 object value from the given accpetable index of stack.
|
||||
* At current, the Point is typedef of Vec2.
|
||||
* @see luaval_to_vec2
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vec2* outValue, const char* funcName = "")
|
||||
{
|
||||
|
@ -554,8 +484,6 @@ CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L
|
|||
* @param argc the numbers of Lua values in the stack.
|
||||
* @param ret a cocos2d::Vector of type T objects.
|
||||
* @return Return false if argc equal to 0 , L equal to nullptr or the Lua userdata at the index isn't `cc.Ref` type, otherwise return true.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
template <class T>
|
||||
bool luavals_variadic_to_ccvector( lua_State* L, int argc, cocos2d::Vector<T>* ret)
|
||||
|
@ -593,8 +521,6 @@ bool luavals_variadic_to_ccvector( lua_State* L, int argc, cocos2d::Vector<T>* r
|
|||
* @param ret a cocos2d::Vector of type T objects.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
template <class T>
|
||||
bool luaval_to_ccvector(lua_State* L, int lo , cocos2d::Vector<T>* ret, const char* funcName = "")
|
||||
|
@ -642,8 +568,6 @@ bool luaval_to_ccvector(lua_State* L, int lo , cocos2d::Vector<T>* ret, const ch
|
|||
* @param ret a pointer points to a std::vector<std::string>.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector<std::string>* ret, const char* funcName = "");
|
||||
|
||||
|
@ -655,8 +579,6 @@ bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector<std::string>*
|
|||
* @param ret a pointer points to a std::vector<int>.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret, const char* funcName = "");
|
||||
|
||||
|
@ -669,8 +591,6 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret, const
|
|||
* @param ret a pointer points to a cocos2d::Map whose key/value pair is string value and T object.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
template <class T>
|
||||
bool luaval_to_ccmap_string_key(lua_State* L, int lo, cocos2d::Map<std::string, T>* ret, const char* funcName = "")
|
||||
|
@ -727,8 +647,6 @@ bool luaval_to_ccmap_string_key(lua_State* L, int lo, cocos2d::Map<std::string,
|
|||
* @param ret a pointer points to a cocos2d::Value object.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the L and ret is not nullptr,otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ccvalue(lua_State* L, int lo, cocos2d::Value* ret, const char* funcName = "");
|
||||
|
||||
|
@ -741,8 +659,6 @@ extern bool luaval_to_ccvalue(lua_State* L, int lo, cocos2d::Value* ret, const c
|
|||
* @param ret a pointer points to a cocos2d::ValueMap object.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the type of Lua value at the index is a Lua table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret, const char* funcName = "");
|
||||
|
||||
|
@ -755,8 +671,6 @@ extern bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret, c
|
|||
* @param ret a pointer points to a cocos2d::ValueMapIntKey object.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the type of Lua value at the index is a Lua table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* ret, const char* funcName = "");
|
||||
|
||||
|
@ -769,8 +683,6 @@ extern bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIn
|
|||
* @param ret a pointer points to a cocos2d::ValueVector object.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the type of Lua value at the index is a Lua table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* ret, const char* funcName = "");
|
||||
|
||||
|
@ -783,8 +695,6 @@ extern bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector*
|
|||
* @param type a string pointer points to the type name.
|
||||
* @param ret the pointer points to a Type T object.
|
||||
* @return Return true if the type of Lua value at the index is a Lua userdata, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
template <class T>
|
||||
bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret)
|
||||
|
@ -812,8 +722,6 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret)
|
|||
* @param ret the pointer to a cocos2d::MeshVertexAttrib object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttrib* ret, const char* funcName = "");
|
||||
|
||||
|
@ -825,8 +733,6 @@ extern bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVert
|
|||
* @param ret a pointer points to a std::vector<float>.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector<float>* ret, const char* funcName = "");
|
||||
|
||||
|
@ -838,8 +744,6 @@ extern bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector<float>*
|
|||
* @param ret a pointer points to a std::vector<unsigned short>.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return Return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector<unsigned short>* ret, const char* funcName = "");
|
||||
|
||||
|
@ -852,8 +756,6 @@ extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector<unsign
|
|||
* @param outValue the pointer to a cocos2d::Quaternion object which stores the values from the Lua table.
|
||||
* @param funcName the name of calling function, it is used for error output in the debug model.
|
||||
* @return true if the value at the given accpetable index of stack is a table, otherwise return false.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern bool luaval_to_quaternion(lua_State* L,int lo,cocos2d::Quaternion* outValue, const char* funcName = "");
|
||||
|
||||
|
@ -874,8 +776,6 @@ extern bool luaval_to_quaternion(lua_State* L,int lo,cocos2d::Quaternion* outVal
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param vec2 a cocos2d::Vec2 object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2);
|
||||
|
||||
|
@ -885,8 +785,6 @@ extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param vec3 a cocos2d::Vec3 object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3);
|
||||
|
||||
|
@ -896,8 +794,6 @@ extern void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param vec4 a cocos2d::Vec4 object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec4);
|
||||
|
||||
|
@ -909,8 +805,6 @@ extern void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec4);
|
|||
* @param L the current lua_State.
|
||||
* @param points a pointer points to a cocos2d::Vec2 array.
|
||||
* @param count the number of cocos2d::Vec2 object should be converted to a Lua table and push into the Lua stack.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count);
|
||||
|
||||
|
@ -920,8 +814,6 @@ extern void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int c
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param sz a cocos2d::Size object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void size_to_luaval(lua_State* L,const Size& sz);
|
||||
|
||||
|
@ -931,8 +823,6 @@ extern void size_to_luaval(lua_State* L,const Size& sz);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param rt a cocos2d::Rect object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void rect_to_luaval(lua_State* L,const Rect& rt);
|
||||
|
||||
|
@ -942,8 +832,6 @@ extern void rect_to_luaval(lua_State* L,const Rect& rt);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param cc a cocos2d::Color3B object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void color3b_to_luaval(lua_State* L,const Color3B& cc);
|
||||
|
||||
|
@ -953,8 +841,6 @@ extern void color3b_to_luaval(lua_State* L,const Color3B& cc);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param cc a cocos2d::Color4B object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void color4b_to_luaval(lua_State* L,const Color4B& cc);
|
||||
|
||||
|
@ -964,8 +850,6 @@ extern void color4b_to_luaval(lua_State* L,const Color4B& cc);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param cc a cocos2d::Color4F object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void color4f_to_luaval(lua_State* L,const Color4F& cc);
|
||||
#if CC_USE_PHYSICS
|
||||
|
@ -976,8 +860,6 @@ extern void color4f_to_luaval(lua_State* L,const Color4F& cc);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param pm a cocos2d::PhysicsMaterial object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm);
|
||||
|
||||
|
@ -987,8 +869,6 @@ extern void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param info a cocos2d::PhysicsRayCastInfo object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info);
|
||||
|
||||
|
@ -998,8 +878,6 @@ extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param data a cocos2d::PhysicsContactData object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data);
|
||||
#endif //#if CC_USE_PHYSICS
|
||||
|
@ -1010,8 +888,6 @@ extern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::AffineTransform object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue);
|
||||
|
||||
|
@ -1021,14 +897,12 @@ extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValu
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::FontDefinition object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue);
|
||||
/// @cond
|
||||
|
||||
extern void array_to_luaval(lua_State* L, __Array* inValue);
|
||||
extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict);
|
||||
/// @endcond
|
||||
|
||||
|
||||
/**
|
||||
* Push a table converted from a cocos2d::Mat4 object into the Lua stack.
|
||||
|
@ -1036,8 +910,6 @@ extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param mat a cocos2d::Mat4 object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void mat4_to_luaval(lua_State* L, const cocos2d::Mat4& mat);
|
||||
|
||||
|
@ -1047,8 +919,6 @@ extern void mat4_to_luaval(lua_State* L, const cocos2d::Mat4& mat);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param func a cocos2d::BlendFunc object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void blendfunc_to_luaval(lua_State* L, const cocos2d::BlendFunc& func);
|
||||
|
||||
|
@ -1058,8 +928,6 @@ extern void blendfunc_to_luaval(lua_State* L, const cocos2d::BlendFunc& func);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param config a cocos2d::TTFConfig object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void ttfconfig_to_luaval(lua_State* L, const cocos2d::TTFConfig& config);
|
||||
|
||||
|
@ -1069,8 +937,6 @@ extern void ttfconfig_to_luaval(lua_State* L, const cocos2d::TTFConfig& config);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param uniform a cocos2d::Uniform object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void uniform_to_luaval(lua_State* L, const cocos2d::Uniform& uniform);
|
||||
|
||||
|
@ -1080,12 +946,10 @@ extern void uniform_to_luaval(lua_State* L, const cocos2d::Uniform& uniform);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param verAttrib a cocos2d::VertexAttrib object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
extern void vertexattrib_to_luaval(lua_State* L, const cocos2d::VertexAttrib& verAttrib);
|
||||
|
||||
/// @cond
|
||||
|
||||
static inline void point_to_luaval(lua_State* L,const cocos2d::Vec2& pt)
|
||||
{
|
||||
vec2_to_luaval(L, pt);
|
||||
|
@ -1096,7 +960,6 @@ CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const c
|
|||
{
|
||||
vec2_array_to_luaval(L, points, count);
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
/**
|
||||
* Push a table converted from a cocos2d::Vector object into the Lua stack.
|
||||
|
@ -1105,8 +968,6 @@ CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const c
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::Vector object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
template <class T>
|
||||
void ccvector_to_luaval(lua_State* L,const cocos2d::Vector<T>& inValue)
|
||||
|
@ -1147,8 +1008,6 @@ void ccvector_to_luaval(lua_State* L,const cocos2d::Vector<T>& inValue)
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param v a cocos2d::Map object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
template <class T>
|
||||
void ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map<std::string, T>& v)
|
||||
|
@ -1191,8 +1050,6 @@ void ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map<std::string, T>
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::Value object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue);
|
||||
|
||||
|
@ -1202,8 +1059,6 @@ void ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::ValueMap object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue);
|
||||
|
||||
|
@ -1213,8 +1068,6 @@ void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::ValueMapIntKey object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue);
|
||||
|
||||
|
@ -1224,8 +1077,6 @@ void ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inV
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::ValueVector object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue);
|
||||
|
||||
|
@ -1296,8 +1147,6 @@ void object_to_luaval(lua_State* L,const char* type, T* ret)
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::MeshVertexAttrib object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void mesh_vertex_attrib_to_luaval(lua_State* L, const cocos2d::MeshVertexAttrib& inValue);
|
||||
|
||||
|
@ -1307,8 +1156,6 @@ void mesh_vertex_attrib_to_luaval(lua_State* L, const cocos2d::MeshVertexAttrib&
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a std::vector<std::string> value.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvector_std_string_to_luaval(lua_State* L, const std::vector<std::string>& inValue);
|
||||
|
||||
|
@ -1318,8 +1165,6 @@ void ccvector_std_string_to_luaval(lua_State* L, const std::vector<std::string>&
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a std::vector<int> vaule.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvector_int_to_luaval(lua_State* L, const std::vector<int>& inValue);
|
||||
|
||||
|
@ -1329,8 +1174,6 @@ void ccvector_int_to_luaval(lua_State* L, const std::vector<int>& inValue);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a std::vector<float> vaule.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvector_float_to_luaval(lua_State* L, const std::vector<float>& inValue);
|
||||
|
||||
|
@ -1340,8 +1183,6 @@ void ccvector_float_to_luaval(lua_State* L, const std::vector<float>& inValue);
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a std::vector<float> vaule.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void ccvector_ushort_to_luaval(lua_State* L, const std::vector<unsigned short>& inValue);
|
||||
|
||||
|
@ -1351,8 +1192,6 @@ void ccvector_ushort_to_luaval(lua_State* L, const std::vector<unsigned short>&
|
|||
*
|
||||
* @param L the current lua_State.
|
||||
* @param inValue a cocos2d::Quaternion object.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
void quaternion_to_luaval(lua_State* L,const cocos2d::Quaternion& inValue);
|
||||
|
||||
|
|
|
@ -32,17 +32,22 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup lua
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Call this function can import the lua bindings for the audioengine module.
|
||||
* After registering, we could call the related audioengine code conveniently in the lua.eg,.ccexp.AudioEngine:stop(audioID).
|
||||
* If you don't want to use the audioengine module in the lua, you only don't call this registering function.
|
||||
* If you don't register the audioengine module, the package size would become smaller .
|
||||
* The current mechanism,this function is called in the lua_module_register.h
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
|
||||
TOLUA_API int register_audioengine_module(lua_State* L);
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_AUDIOENGINE_LUA_COCOS2DX_AUDIOENGINE_MANUAL_H__
|
||||
|
|
|
@ -72,24 +72,21 @@ private:
|
|||
|
||||
/**
|
||||
* The LuaCallFunc is wrapped to call the callback function in the Lua Conveniently and don't insert useless code to processing the lua in the CallFuncN.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
class LuaCallFunc:public cocos2d::CallFuncN
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default construtor.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
LuaCallFunc():_functionLua(nullptr)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Destrutor.
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
virtual ~LuaCallFunc()
|
||||
{}
|
||||
|
@ -98,8 +95,6 @@ public:
|
|||
* Create a LuaCallFunc object by a function pointer for callback.
|
||||
*
|
||||
* @param func a function pointer for callback.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
static LuaCallFunc* create(const std::function<void(void* self,Node*)>& func);
|
||||
|
||||
|
@ -107,15 +102,11 @@ public:
|
|||
* Init a LuaCallFunc object by a function pointer for callback.
|
||||
*
|
||||
* @param func a function pointer for callback.
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
bool initWithFunction(const std::function<void(void* self,Node*)>& func);
|
||||
virtual LuaCallFunc* clone() const override;
|
||||
virtual void execute() override;
|
||||
protected:
|
||||
/**
|
||||
*/
|
||||
std::function<void(void* self,Node*)> _functionLua;
|
||||
|
||||
};
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
* Get the true type name of pNode.
|
||||
* By using the dynamic_cast function, we coulde get the true type name of pNode.
|
||||
*
|
||||
* @Node pNode the Node object used to query.
|
||||
* @param pNode the Node object used to query.
|
||||
* @return a string pointer point to the true type name otherwise return "No Support".
|
||||
* @js NA
|
||||
*/
|
||||
|
|
|
@ -34,16 +34,21 @@ extern "C" {
|
|||
|
||||
TOLUA_API int register_all_cocos2dx_cocosbuilder_manual(lua_State* tolua_S);
|
||||
|
||||
/**
|
||||
* @addtogroup lua
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Call this function can import the lua bindings for the cocosbuilder module.
|
||||
* After registering, we could call the related cocosbuilder code conveniently in the lua.eg,.cc.CCBProxy:create().
|
||||
* If you don't want to use the cocosbuilder module in the lua, you only don't call this registering function.
|
||||
* If you don't register the cocosbuilder module, the package size would become smaller .
|
||||
* The current mechanism,this registering function is called in the lua_module_register.h
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
TOLUA_API int register_cocosbuilder_module(lua_State* tolua_S);
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_LUA_COCOS2DX_COCOSBUILDER_H
|
||||
|
|
|
@ -44,9 +44,6 @@ extern "C" {
|
|||
* If you don't want to use the cocosdenshion module in the lua, you only don't call this registering function.
|
||||
* If you don't register the cocosdenshion module, the package size would become smaller .
|
||||
* The current mechanism,this registering function is called in the lua_module_register.h
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
TOLUA_API int register_cocosdenshion_module(lua_State* L);
|
||||
|
||||
|
|
|
@ -36,8 +36,24 @@ extern "C" {
|
|||
#include <string>
|
||||
|
||||
TOLUA_API int register_all_cocos2dx_coco_studio_manual(lua_State* L);
|
||||
|
||||
/**
|
||||
* @addtogroup lua
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Call this function can import the lua bindings for the coco studio module.
|
||||
* After registering, we could call the related coco studio code conveniently in the lua.
|
||||
* If you don't want to use the coco studio module in the lua, you only don't call this registering function.
|
||||
* If you don't register the coco studio module, the package size would become smaller .
|
||||
* The current mechanism,this registering function is called in the lua_module_register.h
|
||||
*/
|
||||
TOLUA_API int register_cocostudio_module(lua_State* L);
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
struct LuaArmatureWrapperEventData
|
||||
{
|
||||
enum class LuaArmatureWrapperEventType
|
||||
|
|
|
@ -46,13 +46,13 @@ extern "C" {
|
|||
*/
|
||||
TOLUA_API int register_extension_module(lua_State* tolua_S);
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
/// @cond
|
||||
TOLUA_API int register_all_cocos2dx_extension_manual(lua_State* tolua_S);
|
||||
/// @endcond
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
|
||||
struct LuaAssetsManagerEventData
|
||||
{
|
||||
int value;
|
||||
|
|
|
@ -43,9 +43,6 @@ extern "C" {
|
|||
* If you don't want to use the network module in the lua, you only don't call this registering function.
|
||||
* If you don't register the network module, the package size would become smaller .
|
||||
* The current mechanism,this registering function is called in the lua_module_register.h
|
||||
*
|
||||
* @lua NA
|
||||
* @js NA
|
||||
*/
|
||||
TOLUA_API int register_network_module(lua_State* L);
|
||||
|
||||
|
|
|
@ -32,7 +32,24 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
|
||||
/// @cond
|
||||
TOLUA_API int register_all_cocos2dx_spine_manual(lua_State* L);
|
||||
/// @endcond
|
||||
|
||||
/**
|
||||
* @addtogroup lua
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Call this function can import the lua bindings for the spine module.
|
||||
* After registering, we could call the related spine code conveniently in the lua.
|
||||
* If you don't want to use the spine module in the lua, you only don't call this registering function.
|
||||
* If you don't register the spine module, the package size would become smaller .
|
||||
* The current mechanism,this registering function is called in the lua_module_register.h
|
||||
*/
|
||||
TOLUA_API int register_spine_module(lua_State* L);
|
||||
|
||||
// end group
|
||||
/// @}
|
||||
#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_SPINE_MANUAL_H
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue