mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of github.com:cocos2d/cocos2d-x into v3
This commit is contained in:
commit
657f270855
|
@ -2,7 +2,7 @@ cocos2d-x-3.5 Mar.23 2015
|
|||
[NEW] EditBox: support Color4B
|
||||
|
||||
[FIX] AutoRelasePool: memory leak if adding an element into pool when releasing auto release pool
|
||||
[FIX] FileUtils: getWritablePath() will not return corrent setted writable path on Mac & Windows
|
||||
[FIX] FileUtils: getWritablePath() does not return corret setted writable path on Mac & Windows
|
||||
[FIX] HttpAsynConnection: can not get error content if response code less than 200 or response code greater or equal than 300
|
||||
|
||||
cocos2d-x-3.5rc0 Mar.13 2015
|
||||
|
@ -22,7 +22,7 @@ cocos2d-x-3.5rc0 Mar.13 2015
|
|||
|
||||
cocos2d-x-3.5beta0 Feb.27 2015
|
||||
[NEW] Added Particle3D
|
||||
[NEW] C++: add Romanian languange support
|
||||
[NEW] C++: add Romanian language support
|
||||
|
||||
[FIX] Audio: audio can not resume if it is interrupt, and back from background
|
||||
[FIX] Cocos Studio UI: setCameraMask does not work for the Cocos Studio UI
|
||||
|
|
|
@ -38,7 +38,7 @@ endif()
|
|||
project (Cocos2d-X)
|
||||
|
||||
# The version number
|
||||
set(COCOS2D_X_VERSION 3.5beta0)
|
||||
set(COCOS2D_X_VERSION 3.5)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
|
||||
include(CocosBuildHelpers)
|
||||
|
|
|
@ -41,7 +41,7 @@ class Texture2D;
|
|||
class SpriteFrame;
|
||||
|
||||
/**
|
||||
* @addtogroup sprite_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ NS_CC_BEGIN
|
|||
class Animation;
|
||||
|
||||
/**
|
||||
* @addtogroup sprite_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup base_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -174,14 +174,24 @@ public:
|
|||
//override
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
|
||||
|
||||
/**
|
||||
* Get the visiting camera , the visiting camera shall be set on Scene::render
|
||||
*/
|
||||
static const Camera* getVisitingCamera() { return _visitingCamera; }
|
||||
|
||||
/**
|
||||
* Get the default camera of the current running scene.
|
||||
*/
|
||||
static Camera* getDefaultCamera();
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
Camera();
|
||||
~Camera();
|
||||
|
||||
/**
|
||||
* Set the scene,this method shall not be invoke manually
|
||||
*/
|
||||
void setScene(Scene* scene);
|
||||
|
||||
/**set additional matrix for the projection matrix, it multiplys mat to projection matrix when called, used by WP8*/
|
||||
|
|
|
@ -34,51 +34,82 @@
|
|||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
/** ClippingNode is a subclass of Node.
|
||||
It draws its content (childs) clipped using a stencil.
|
||||
The stencil is an other Node that will not be drawn.
|
||||
The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
|
||||
* It draws its content (childs) clipped using a stencil.
|
||||
* The stencil is an other Node that will not be drawn.
|
||||
* The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
|
||||
*/
|
||||
class CC_DLL ClippingNode : public Node
|
||||
{
|
||||
public:
|
||||
/** Creates and initializes a clipping node without a stencil.
|
||||
*
|
||||
* @return An autorelease ClippingNode.
|
||||
*/
|
||||
static ClippingNode* create();
|
||||
|
||||
/** Creates and initializes a clipping node with an other node as its stencil.
|
||||
The stencil node will be retained.
|
||||
* The stencil node will be retained.
|
||||
* @param stencil The stencil node.
|
||||
*/
|
||||
static ClippingNode* create(Node *stencil);
|
||||
|
||||
/** The Node to use as a stencil to do the clipping.
|
||||
The stencil node will be retained.
|
||||
This default to nil.
|
||||
* The stencil node will be retained.
|
||||
* This default to nil.
|
||||
*
|
||||
* @return The stencil node.
|
||||
*/
|
||||
Node* getStencil() const;
|
||||
|
||||
/** Set the Node to use as a stencil to do the clipping.
|
||||
*
|
||||
* @param stencil The Node to use as a stencil to do the clipping.
|
||||
*/
|
||||
void setStencil(Node *stencil);
|
||||
|
||||
/** If stencil has no childre it will not be drawn.
|
||||
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.
|
||||
*/
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
virtual bool hasContent() const;
|
||||
|
||||
/** The alpha threshold.
|
||||
The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.
|
||||
Should be a float between 0 and 1.
|
||||
This default to 1 (so alpha test is disabled).
|
||||
* The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.
|
||||
* Should be a float between 0 and 1.
|
||||
* This default to 1 (so alpha test is disabled).
|
||||
*
|
||||
* @return The alpha threshold value,Should be a float between 0 and 1.
|
||||
*/
|
||||
GLfloat getAlphaThreshold() const;
|
||||
|
||||
/** Set the alpha threshold.
|
||||
*
|
||||
* @param alphaThreshold The alpha threshold.
|
||||
*/
|
||||
void setAlphaThreshold(GLfloat alphaThreshold);
|
||||
|
||||
/** Inverted. If this is set to true,
|
||||
the stencil is inverted, so the content is drawn where the stencil is NOT drawn.
|
||||
This default to false.
|
||||
* the stencil is inverted, so the content is drawn where the stencil is NOT drawn.
|
||||
* This default to false.
|
||||
*
|
||||
* @return If the clippingNode is Inverted, it will be return true.
|
||||
*/
|
||||
bool isInverted() const;
|
||||
|
||||
/** Set the ClippingNode whether or not invert.
|
||||
*
|
||||
* @param inverted A bool Type,to set the ClippingNode whether or not invert.
|
||||
*/
|
||||
void setInverted(bool inverted);
|
||||
|
||||
// Overrides
|
||||
|
@ -162,7 +193,7 @@ protected:
|
|||
private:
|
||||
CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode);
|
||||
};
|
||||
|
||||
/** @} */
|
||||
NS_CC_END
|
||||
|
||||
#endif // __MISCNODE_CCCLIPPING_NODE_H__
|
||||
|
|
|
@ -38,59 +38,202 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/** DrawNode
|
||||
Node that draws dots, segments and polygons.
|
||||
Faster than the "drawing primitives" since they draws everything in one single batch.
|
||||
|
||||
@since v2.1
|
||||
class PointArray;
|
||||
/**
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class PointArray;
|
||||
|
||||
/** @class DrawNode
|
||||
* @brief Node that draws dots, segments and polygons.
|
||||
* Faster than the "drawing primitives" since they draws everything in one single batch.
|
||||
* @since v2.1
|
||||
*/
|
||||
class CC_DLL DrawNode : public Node
|
||||
{
|
||||
public:
|
||||
/** creates and initialize a DrawNode node */
|
||||
/** creates and initialize a DrawNode node.
|
||||
*
|
||||
* @return Return an autorelease object.
|
||||
*/
|
||||
static DrawNode* create();
|
||||
|
||||
|
||||
/** Draw a point.
|
||||
*
|
||||
* @param point A Vec2 used to point.
|
||||
* @param pointSize The point size.
|
||||
* @param color The point color.
|
||||
*/
|
||||
void drawPoint(const Vec2& point, const float pointSize, const Color4F &color);
|
||||
|
||||
/** Draw a group point.
|
||||
*
|
||||
* @param position A Vec2 pointer.
|
||||
* @param numberOfPoints The number of points.
|
||||
* @param color The point color.
|
||||
*/
|
||||
void drawPoints(const Vec2 *position, unsigned int numberOfPoints, const Color4F &color);
|
||||
|
||||
/** Draw a group point.
|
||||
*
|
||||
* @param position A Vec2 pointer.
|
||||
* @param numberOfPoints The number of points.
|
||||
* @param pointSize The point size.
|
||||
* @param color The point color.
|
||||
*/
|
||||
void drawPoints(const Vec2 *position, unsigned int numberOfPoints, const float pointSize, const Color4F &color);
|
||||
|
||||
/** Draw an line from origin to destination with color.
|
||||
*
|
||||
* @param origin The line origin.
|
||||
* @param destination The line destination.
|
||||
* @param color The line color.
|
||||
*/
|
||||
void drawLine(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
||||
|
||||
/** Draws a rectangle given the origin and destination point measured in points.
|
||||
* The origin and the destination can not have the same x and y coordinate.
|
||||
*
|
||||
* @param origin The rectangle origin.
|
||||
* @param destination The rectangle destination.
|
||||
* @param color The rectangle color.
|
||||
*/
|
||||
void drawRect(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
||||
|
||||
/** Draws a polygon given a pointer to point coordinates and the number of vertices measured in points.
|
||||
* The polygon can be closed or open.
|
||||
*
|
||||
* @param poli A pointer to point coordinates.
|
||||
* @param numberOfPoints The number of vertices measured in points.
|
||||
* @param closePolygon The polygon can be closed or open.
|
||||
* @param color The polygon color.
|
||||
*/
|
||||
void drawPoly(const Vec2 *poli, unsigned int numberOfPoints, bool closePolygon, const Color4F &color);
|
||||
|
||||
/** Draws a circle given the center, radius and number of segments.
|
||||
*
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param drawLineToCenter Whether or not draw the line from the origin to center.
|
||||
* @param scaleX The scale value in x.
|
||||
* @param scaleY The scale value in y.
|
||||
* @param color Set the circle color.
|
||||
*/
|
||||
void drawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY, const Color4F &color);
|
||||
|
||||
/** Draws a circle given the center, radius and number of segments.
|
||||
*
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param drawLineToCenter Whether or not draw the line from the origin to center.
|
||||
* @param color Set the circle color.
|
||||
*/
|
||||
void drawCircle(const Vec2 ¢er, float radius, float angle, unsigned int segments, bool drawLineToCenter, const Color4F &color);
|
||||
|
||||
/** Draws a quad bezier path.
|
||||
*
|
||||
* @param origin The origin of the bezier path.
|
||||
* @param control The control of the bezier path.
|
||||
* @param destination The destination of the bezier path.
|
||||
* @param segments The The number of segments.
|
||||
* @param color Set the quad bezier color.
|
||||
*/
|
||||
void drawQuadBezier(const Vec2 &origin, const Vec2 &control, const Vec2 &destination, unsigned int segments, const Color4F &color);
|
||||
|
||||
/** draw a cubic bezier curve with color and number of segments */
|
||||
/** Draw a cubic bezier curve with color and number of segments
|
||||
*
|
||||
* @param origin The origin of the bezier path.
|
||||
* @param control1 The first control of the bezier path.
|
||||
* @param control2 The second control of the bezier path.
|
||||
* @param destination The destination of the bezier path.
|
||||
* @param segments The The number of segments.
|
||||
* @param color Set the cubic bezier color.
|
||||
*/
|
||||
void drawCubicBezier(const Vec2 &origin, const Vec2 &control1, const Vec2 &control2, const Vec2 &destination, unsigned int segments, const Color4F &color);
|
||||
|
||||
/** Draws a Cardinal Spline path.
|
||||
*
|
||||
* @param config A array point.
|
||||
* @param tension The tension of the spline.
|
||||
* @param segments The The number of segments.
|
||||
* @param color Set the Spline color.
|
||||
*/
|
||||
void drawCardinalSpline(PointArray *config, float tension, unsigned int segments, const Color4F &color);
|
||||
|
||||
/** Draws a Catmull Rom path.
|
||||
*
|
||||
* @param points A point array of control point.
|
||||
* @param segments The The number of segments.
|
||||
* @param color The Catmull Rom color.
|
||||
*/
|
||||
void drawCatmullRom(PointArray *points, unsigned int segments, const Color4F &color);
|
||||
|
||||
/** draw a dot at a position, with a given radius and color */
|
||||
/** draw a dot at a position, with a given radius and color.
|
||||
*
|
||||
* @param pos The dot center.
|
||||
* @param radius The dot radius.
|
||||
* @param color The dot color.
|
||||
*/
|
||||
void drawDot(const Vec2 &pos, float radius, const Color4F &color);
|
||||
|
||||
/** Draws a rectangle with 4 points.
|
||||
*
|
||||
* @param p1 The rectangle vertex point.
|
||||
* @param p2 The rectangle vertex point.
|
||||
* @param p3 The rectangle vertex point.
|
||||
* @param p4 The rectangle vertex point.
|
||||
* @param color The rectangle color.
|
||||
*/
|
||||
void drawRect(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Vec2& p4, const Color4F &color);
|
||||
|
||||
/** Draws a solid rectangle given the origin and destination point measured in points.
|
||||
* The origin and the destination can not have the same x and y coordinate.
|
||||
*
|
||||
* @param origin The rectangle origin.
|
||||
* @param destination The rectangle destination.
|
||||
* @param color The rectangle color.
|
||||
*/
|
||||
void drawSolidRect(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
||||
|
||||
/** Draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
void drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, const Color4F &color);
|
||||
|
||||
/** Draws a solid circle given the center, radius and number of segments.
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param scaleX The scale value in x.
|
||||
* @param scaleY The scale value in y.
|
||||
* @param color The solid circle color.
|
||||
*/
|
||||
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY, const Color4F &color);
|
||||
|
||||
/** Draws a solid circle given the center, radius and number of segments.
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param color The solid circle color.
|
||||
*/
|
||||
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, const Color4F& color);
|
||||
|
||||
/** draw a segment with a radius and color */
|
||||
/** draw a segment with a radius and color.
|
||||
*
|
||||
* @param from The segment origin.
|
||||
* @param to The segment destination.
|
||||
* @param radius The segment radius.
|
||||
* @param color The segment color.
|
||||
*/
|
||||
void drawSegment(const Vec2 &from, const Vec2 &to, float radius, const Color4F &color);
|
||||
|
||||
/** draw a polygon with a fill color and line color
|
||||
|
@ -99,23 +242,41 @@ public:
|
|||
* In js: var drawPolygon(var Arrayofpoints, var fillColor, var width, var borderColor)
|
||||
* In lua:local drawPolygon(local pointTable,local tableCount,local fillColor,local width,local borderColor)
|
||||
* @endcode
|
||||
* @param verts A pointer to point coordinates.
|
||||
* @param count The number of verts measured in points.
|
||||
* @param fillColor The color will fill in polygon.
|
||||
* @param borderWidth The border of line width.
|
||||
* @param borderColor The border of line color.
|
||||
*/
|
||||
void drawPolygon(const Vec2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor);
|
||||
|
||||
/** draw a triangle with color */
|
||||
/** draw a triangle with color.
|
||||
*
|
||||
* @param p1 The triangle vertex point.
|
||||
* @param p2 The triangle vertex point.
|
||||
* @param p3 The triangle vertex point.
|
||||
* @param color The triangle color.
|
||||
*/
|
||||
void drawTriangle(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Color4F &color);
|
||||
|
||||
/** draw a quadratic bezier curve with color and number of segments, use drawQuadBezier instead*/
|
||||
/** draw a quadratic bezier curve with color and number of segments, use drawQuadBezier instead.
|
||||
*
|
||||
* @param from The origin of the bezier path.
|
||||
* @param control The control of the bezier path.
|
||||
* @param to The destination of the bezier path.
|
||||
* @param segments The The number of segments.
|
||||
* @param color The quadratic bezier color.
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
/** Set the color mixed mode.
|
||||
* @code
|
||||
* When this function bound into js or lua,the parameter will be changed
|
||||
* In js: var setBlendFunc(var src, var dst)
|
||||
|
@ -174,7 +335,7 @@ protected:
|
|||
private:
|
||||
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
|
||||
};
|
||||
|
||||
/** @} */
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCDRAWNODES_CCDRAW_NODE_H__
|
||||
|
|
|
@ -70,7 +70,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup global
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@ -78,91 +78,181 @@ class PointArray;
|
|||
|
||||
namespace DrawPrimitives
|
||||
{
|
||||
/** Initializes the drawing primitives */
|
||||
/** Initializes the drawing primitives. */
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL init();
|
||||
|
||||
/** Frees allocated resources by the drawing primitives */
|
||||
/** Frees allocated resources by the drawing primitives. */
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL free();
|
||||
|
||||
/** draws a point given x and y coordinate measured in points */
|
||||
/** Draws a point given x and y coordinate measured in points
|
||||
*
|
||||
* @param point A Vec2 with a point given x and y coordinate.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawPoint(const Vec2& point);
|
||||
|
||||
/** draws an array of points.
|
||||
@since v0.7.2
|
||||
/** Draws an array of points.
|
||||
*
|
||||
* @param point A point coordinates.
|
||||
* @param numberOfPoints The number of points.
|
||||
* @since v0.7.2
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawPoints(const Vec2 *points, unsigned int numberOfPoints);
|
||||
|
||||
/** draws a line given the origin and destination point measured in points */
|
||||
/** Draws a line given the origin and destination point measured in points
|
||||
*
|
||||
* @param origin A Vec2 Type point used to the line origin.
|
||||
* @param destination A Vec2 Type point used to the line destination.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawLine(const Vec2& origin, const Vec2& destination);
|
||||
|
||||
/** draws a rectangle given the origin and destination point measured in points. */
|
||||
/** Draws a rectangle given the origin and destination point measured in points.
|
||||
* The origin and the destination can not have the same x and y coordinate.
|
||||
*
|
||||
* @param origin The rectangle origin.
|
||||
* @param destination The rectangle destination.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawRect(Vec2 origin, Vec2 destination);
|
||||
|
||||
/** draws a solid rectangle given the origin and destination point measured in points.
|
||||
@since 1.1
|
||||
/** Draws a solid rectangle given the origin and destination point measured in points.
|
||||
* The origin and the destination can not have the same x and y coordinate.
|
||||
*
|
||||
* @param origin The rectangle origin.
|
||||
* @param destination The rectangle destination.
|
||||
* @param color The rectangle color.
|
||||
* @since 1.1
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawSolidRect(Vec2 origin, Vec2 destination, Color4F color);
|
||||
|
||||
/** draws a polygon given a pointer to point coordinates and the number of vertices measured in points.
|
||||
The polygon can be closed or open
|
||||
*/
|
||||
/** Draws a polygon given a pointer to point coordinates and the number of vertices measured in points.
|
||||
* The polygon can be closed or open.
|
||||
*
|
||||
* @param vertices A pointer to point coordinates.
|
||||
* @param numOfVertices The number of vertices measured in points.
|
||||
* @param closePolygon The polygon can be closed or open.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawPoly(const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon);
|
||||
|
||||
/** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
|
||||
/** Draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, Color4F color);
|
||||
|
||||
/** draws a circle given the center, radius and number of segments. */
|
||||
/** Draws a circle given the center, radius and number of segments.
|
||||
*
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param drawLineToCenter Whether or not draw the line from the origin to center.
|
||||
* @param scaleX The scale value in x.
|
||||
* @param scaleY The scale value in y.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawCircle(const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);
|
||||
|
||||
/** Draws a circle given the center, radius and number of segments.
|
||||
*
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param drawLineToCenter Whether or not draw the line from the origin to center.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawCircle(const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);
|
||||
|
||||
/** draws a solid circle given the center, radius and number of segments. */
|
||||
/** Draws a solid circle given the center, radius and number of segments.
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
* @param scaleX The scale value in x.
|
||||
* @param scaleY The scale value in y.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);
|
||||
|
||||
/** Draws a solid circle given the center, radius and number of segments.
|
||||
* @param center The circle center point.
|
||||
* @param radius The circle rotate of radius.
|
||||
* @param angle The circle angel.
|
||||
* @param segments The number of segments.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments);
|
||||
|
||||
/** draws a quad bezier path
|
||||
@warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
@since v0.8
|
||||
/** Draws a quad bezier path.
|
||||
*
|
||||
* @param origin The origin of the bezier path.
|
||||
* @param control The control of the bezier path.
|
||||
* @param destination The destination of the bezier path.
|
||||
* @param segments The The number of segments.
|
||||
* @warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
* @since v0.8
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destination, unsigned int segments);
|
||||
|
||||
/** draws a cubic bezier path
|
||||
@warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
@since v0.8
|
||||
/** Draws a cubic bezier path.
|
||||
*
|
||||
* @param origin The origin of the bezier path.
|
||||
* @param control1 The first control of the bezier path.
|
||||
* @param control2 The second control of the bezier path.
|
||||
* @param destination The destination of the bezier path.
|
||||
* @param segments The The number of segments.
|
||||
* @warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
* @since v0.8
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments);
|
||||
|
||||
/** draws a Catmull Rom path.
|
||||
@warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
@since v2.0
|
||||
/** Draws a Catmull Rom path.
|
||||
*
|
||||
* @param arrayOfControlPoints A point array of control point.
|
||||
* @param segments The The number of segments.
|
||||
* @warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
* @since v2.0
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawCatmullRom(PointArray *arrayOfControlPoints, unsigned int segments);
|
||||
|
||||
/** draws a Cardinal Spline path.
|
||||
@warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
@since v2.0
|
||||
/** Draws a Cardinal Spline path.
|
||||
*
|
||||
* @param config A array point.
|
||||
* @param tension The tension of the spline.
|
||||
* @param segments The The number of segments.
|
||||
* @warning This function could be pretty slow. Use it only for debugging purposes.
|
||||
* @since v2.0
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL drawCardinalSpline(PointArray *config, float tension, unsigned int segments);
|
||||
|
||||
/** set the drawing color with 4 unsigned bytes
|
||||
@since v2.0
|
||||
/** Set the drawing color with 4 unsigned bytes.
|
||||
*
|
||||
* @param r The red color with a unsigned bytes.
|
||||
* @param g The green color with a unsigned bytes.
|
||||
* @param b The blue color with a unsigned bytes.
|
||||
* @param a Alpha with a unsigned bytes.
|
||||
* @since v2.0
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL setDrawColor4B(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
|
||||
|
||||
/** set the drawing color with 4 floats
|
||||
@since v2.0
|
||||
/** Set the drawing color with 4 floats.
|
||||
*
|
||||
* @param r The red color with an floats.
|
||||
* @param g The green color with an floats.
|
||||
* @param b The blue color with an floats.
|
||||
* @param a Alpha with an floats.
|
||||
* @since v2.0
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL setDrawColor4F(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
|
||||
|
||||
/** set the point size in points. Default 1.
|
||||
@since v2.0
|
||||
/** Set the point size in points. Default 1.
|
||||
*
|
||||
* @param pointSize The point size with an float.
|
||||
* @since v2.0
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE void CC_DLL setPointSize(GLfloat pointSize);
|
||||
|
||||
};
|
||||
|
||||
// end of global group
|
||||
/// @}
|
||||
/** @} */
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -46,40 +46,45 @@ struct _ccCArray;
|
|||
namespace experimental{
|
||||
|
||||
/**
|
||||
* @addtogroup tilemap_parallax_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief FastTMXLayer represents the TMX layer.
|
||||
|
||||
It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas.
|
||||
If you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created.
|
||||
The benefits of using Sprite objects as tiles are:
|
||||
- tiles (Sprite) can be rotated/scaled/moved with a nice API
|
||||
* It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas.
|
||||
* If you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created.
|
||||
* The benefits of using Sprite objects as tiles are:
|
||||
* - tiles (Sprite) can be rotated/scaled/moved with a nice API.
|
||||
|
||||
If the layer contains a property named "cc_vertexz" with an integer (in can be positive or negative),
|
||||
then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.
|
||||
* If the layer contains a property named "cc_vertexz" with an integer (in can be positive or negative),
|
||||
* then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.
|
||||
|
||||
On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value.
|
||||
Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:
|
||||
* On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value.
|
||||
* Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:
|
||||
|
||||
glAlphaFunc( GL_GREATER, value )
|
||||
* glAlphaFunc( GL_GREATER, value ).
|
||||
|
||||
"value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer.
|
||||
The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different
|
||||
value, like 0.5.
|
||||
|
||||
For further information, please see the programming guide:
|
||||
|
||||
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
|
||||
|
||||
@since v3.2
|
||||
*/
|
||||
* "value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer.
|
||||
* The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different
|
||||
* value, like 0.5.
|
||||
|
||||
* For further information, please see the programming guide:
|
||||
* http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
|
||||
|
||||
* @since v3.2
|
||||
*/
|
||||
|
||||
class CC_DLL TMXLayer : public Node
|
||||
{
|
||||
public:
|
||||
/** creates a FastTMXLayer with an tileset info, a layer info and a map info */
|
||||
/** Creates a FastTMXLayer with an tileset info, a layer info and a map info.
|
||||
*
|
||||
* @param tilesetInfo An tileset info.
|
||||
* @param layerInfo A layer info.
|
||||
* @param mapInfo A map info.
|
||||
* @return Reruen an autorelease object.
|
||||
*/
|
||||
static TMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
|
||||
/**
|
||||
* @js ctor
|
||||
|
@ -91,83 +96,170 @@ public:
|
|||
*/
|
||||
virtual ~TMXLayer();
|
||||
|
||||
/** returns the tile gid at a given tile coordinate. It also returns the tile flags.
|
||||
/** Returns the tile gid at a given tile coordinate. It also returns the tile flags.
|
||||
*
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
* @param flags A TMXTileFlags.
|
||||
* @return The tile gid at a given tile coordinate. It also returns the tile flags.
|
||||
*/
|
||||
int getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr);
|
||||
|
||||
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
If a tile is already placed at that position, then it will be removed.
|
||||
*/
|
||||
/** Sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
* The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
* If a tile is already placed at that position, then it will be removed.
|
||||
* @param gid The gid value.
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
*/
|
||||
void setTileGID(int gid, const Vec2& tileCoordinate);
|
||||
|
||||
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
If a tile is already placed at that position, then it will be removed.
|
||||
|
||||
Use withFlags if the tile flags need to be changed as well
|
||||
/** Sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
* The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
* If a tile is already placed at that position, then it will be removed.
|
||||
* Use withFlags if the tile flags need to be changed as well.
|
||||
*
|
||||
* @param gid A integer value,it will be sets the tile gid.
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
* @param flags A TMXTileFlags.
|
||||
*/
|
||||
|
||||
void setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags flags);
|
||||
|
||||
/** removes a tile at given tile coordinate */
|
||||
/** Removes a tile at given tile coordinate.
|
||||
*
|
||||
* @param tileCoordinate The tile Coordinate.
|
||||
*/
|
||||
void removeTileAt(const Vec2& tileCoordinate);
|
||||
|
||||
/** returns the position in points of a given tile coordinate */
|
||||
/** Returns the position in points of a given tile coordinate.
|
||||
*
|
||||
* @param tileCoordinate The tile Coordinate.
|
||||
* @return The position in points of a given tile coordinate.
|
||||
*/
|
||||
Vec2 getPositionAt(const Vec2& tileCoordinate);
|
||||
|
||||
/** return the value for the specific property name */
|
||||
/** Return the value for the specific property name.
|
||||
*
|
||||
* @param propertyName The value for the specific property name.
|
||||
* @return The value for the specific property name.
|
||||
*/
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
|
||||
/** Creates the tiles */
|
||||
/** Creates the tiles. */
|
||||
void setupTiles();
|
||||
|
||||
|
||||
/** Get the tile layer name.
|
||||
*
|
||||
* @return The tile layer name.
|
||||
*/
|
||||
inline const std::string& getLayerName(){ return _layerName; }
|
||||
|
||||
/** Set the tile layer name.
|
||||
*
|
||||
* @param layerName The new layer name.
|
||||
*/
|
||||
inline void setLayerName(const std::string& layerName){ _layerName = layerName; }
|
||||
|
||||
/** size of the layer in tiles */
|
||||
/** Size of the layer in tiles.
|
||||
*
|
||||
* @return Size of the layer in tiles.
|
||||
*/
|
||||
inline const Size& getLayerSize() const { return _layerSize; };
|
||||
|
||||
/** Set the size of the layer in tiles.
|
||||
*
|
||||
* @param size The new size of the layer in tiles.
|
||||
*/
|
||||
inline void setLayerSize(const Size& size) { _layerSize = size; };
|
||||
|
||||
/** size of the map's tile (could be different from the tile's size) */
|
||||
/** Size of the map's tile (could be different from the tile's size).
|
||||
*
|
||||
* @return Size of the map's tile (could be different from the tile's size).
|
||||
*/
|
||||
inline const Size& getMapTileSize() const { return _mapTileSize; };
|
||||
|
||||
/** Set the size of the map's tile.
|
||||
*
|
||||
* @param size The new size of the map's tile.
|
||||
*/
|
||||
inline void setMapTileSize(const Size& size) { _mapTileSize = size; };
|
||||
|
||||
/** pointer to the map of tiles
|
||||
/** Pointer to the map of tiles.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
* @return The pointer to the map of tiles.
|
||||
*/
|
||||
const uint32_t* getTiles() const { return _tiles; };
|
||||
|
||||
/** Set the pointer to the map of tiles.
|
||||
*
|
||||
* @param tiles The pointer to the map of tiles.
|
||||
*/
|
||||
void setTiles(uint32_t* tiles) { _tiles = tiles; _quadsDirty = true;};
|
||||
|
||||
/** Tileset information for the layer */
|
||||
/** Tileset information for the layer.
|
||||
*
|
||||
* @return Tileset information for the layer.
|
||||
*/
|
||||
inline TMXTilesetInfo* getTileSet() const { return _tileSet; };
|
||||
|
||||
/** Set the tileset information for the layer.
|
||||
*
|
||||
* @param info The new tileset information for the layer.
|
||||
*/
|
||||
inline void setTileSet(TMXTilesetInfo* info) {
|
||||
CC_SAFE_RETAIN(info);
|
||||
CC_SAFE_RELEASE(_tileSet);
|
||||
_tileSet = info;
|
||||
};
|
||||
|
||||
/** Layer orientation, which is the same as the map orientation */
|
||||
/** Layer orientation, which is the same as the map orientation.
|
||||
*
|
||||
* @return Layer orientation, which is the same as the map orientation.
|
||||
*/
|
||||
inline int getLayerOrientation() const { return _layerOrientation; };
|
||||
|
||||
/** Set Layer orientation, which is the same as the map orientation.
|
||||
*
|
||||
* @param orientation Layer orientation, which is the same as the map orientation.
|
||||
*/
|
||||
inline void setLayerOrientation(int orientation) { _layerOrientation = orientation; };
|
||||
|
||||
/** properties from the layer. They can be added using Tiled */
|
||||
/** Properties from the layer. They can be added using Tiled.
|
||||
*
|
||||
* @return Properties from the layer. They can be added using Tiled.
|
||||
*/
|
||||
inline const ValueMap& getProperties() const { return _properties; };
|
||||
|
||||
/** Properties from the layer. They can be added using Tiled.
|
||||
*
|
||||
* @return Properties from the layer. They can be added using Tiled.
|
||||
*/
|
||||
inline ValueMap& getProperties() { return _properties; };
|
||||
|
||||
/** Set the properties to the layer.
|
||||
*
|
||||
* @param properties The properties to the layer.
|
||||
*/
|
||||
inline void setProperties(const ValueMap& properties)
|
||||
{
|
||||
_properties = properties;
|
||||
};
|
||||
|
||||
/** returns the tile (Sprite) at a given a tile coordinate.
|
||||
The returned Sprite will be already added to the TMXLayer. Don't add it again.
|
||||
The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.
|
||||
You can remove either by calling:
|
||||
- layer->removeChild(sprite, cleanup);
|
||||
/** Returns the tile (Sprite) at a given a tile coordinate.
|
||||
* The returned Sprite will be already added to the TMXLayer. Don't add it again.
|
||||
* The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.
|
||||
* You can remove either by calling:
|
||||
* - layer->removeChild(sprite, cleanup);
|
||||
*
|
||||
* @return Returns the tile (Sprite) at a given a tile coordinate.
|
||||
*/
|
||||
Sprite* getTileAt(const Vec2& tileCoordinate);
|
||||
|
||||
|
||||
/** Set an sprite to the tile,with the tile coordinate and gid.
|
||||
*
|
||||
* @param sprite A Sprite.
|
||||
* @param pos The tile coordinate.
|
||||
* @param gid The tile gid.
|
||||
*/
|
||||
void setupTileSprite(Sprite* sprite, Vec2 pos, int gid);
|
||||
|
||||
//
|
||||
|
|
|
@ -39,100 +39,164 @@ class TMXMapInfo;
|
|||
namespace experimental {
|
||||
|
||||
class TMXLayer;
|
||||
|
||||
/**
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief FastTMXTiledMap knows how to parse and render a TMX map.
|
||||
|
||||
It adds support for the TMX tiled map format used by http://www.mapeditor.org
|
||||
It supports isometric, hexagonal and orthogonal tiles.
|
||||
It also supports object groups, objects, and properties.
|
||||
* It adds support for the TMX tiled map format used by http://www.mapeditor.org.
|
||||
* It supports isometric, hexagonal and orthogonal tiles.
|
||||
* It also supports object groups, objects, and properties.
|
||||
|
||||
Features:
|
||||
- Each tile will be treated as an Sprite
|
||||
- The sprites are created on demand. They will be created only when you call "layer->tileAt(position)"
|
||||
- Each tile can be rotated / moved / scaled / tinted / "opaqued", since each tile is a Sprite
|
||||
- Tiles can be added/removed in runtime
|
||||
- The z-order of the tiles can be modified in runtime
|
||||
- Each tile has an anchorPoint of (0,0)
|
||||
- The anchorPoint of the TMXTileMap is (0,0)
|
||||
- The TMX layers will be added as a child
|
||||
- The TMX layers will be aliased by default
|
||||
- The tileset image will be loaded using the TextureCache
|
||||
- Each tile will have a unique tag
|
||||
- Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z
|
||||
- Each object group will be treated as an MutableArray
|
||||
- Object class which will contain all the properties in a dictionary
|
||||
- Properties can be assigned to the Map, Layer, Object Group, and Object
|
||||
* Features:
|
||||
* - Each tile will be treated as an Sprite.
|
||||
* - The sprites are created on demand. They will be created only when you call "layer->tileAt(position)".
|
||||
* - Each tile can be rotated / moved / scaled / tinted / "opaqued", since each tile is a Sprite.
|
||||
* - Tiles can be added/removed in runtime.
|
||||
* - The z-order of the tiles can be modified in runtime.
|
||||
* - Each tile has an anchorPoint of (0,0).
|
||||
* - The anchorPoint of the TMXTileMap is (0,0).
|
||||
* - The TMX layers will be added as a child.
|
||||
* - The TMX layers will be aliased by default.
|
||||
* - The tileset image will be loaded using the TextureCache.
|
||||
* - Each tile will have a unique tag.
|
||||
* - Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z.
|
||||
* - Each object group will be treated as an MutableArray.
|
||||
* - Object class which will contain all the properties in a dictionary.
|
||||
* - Properties can be assigned to the Map, Layer, Object Group, and Object.
|
||||
|
||||
Limitations:
|
||||
- It only supports one tileset per layer.
|
||||
- Embedded images are not supported
|
||||
- It only supports the XML format (the JSON format is not supported)
|
||||
* Limitations:
|
||||
* - It only supports one tileset per layer.
|
||||
* - Embedded images are not supported.
|
||||
* - It only supports the XML format (the JSON format is not supported).
|
||||
|
||||
Technical description:
|
||||
Each layer is created using an FastTMXLayer (subclass of SpriteBatchNode). If you have 5 layers, then 5 FastTMXLayer will be created,
|
||||
unless the layer visibility is off. In that case, the layer won't be created at all.
|
||||
You can obtain the layers (FastTMXLayer objects) at runtime by:
|
||||
- map->getChildByTag(tag_number); // 0=1st layer, 1=2nd layer, 2=3rd layer, etc...
|
||||
- map->getLayer(name_of_the_layer);
|
||||
* Technical description:
|
||||
* Each layer is created using an FastTMXLayer (subclass of SpriteBatchNode). If you have 5 layers, then 5 FastTMXLayer will be created,
|
||||
* unless the layer visibility is off. In that case, the layer won't be created at all.
|
||||
* You can obtain the layers (FastTMXLayer objects) at runtime by:
|
||||
* - map->getChildByTag(tag_number); // 0=1st layer, 1=2nd layer, 2=3rd layer, etc...
|
||||
* - map->getLayer(name_of_the_layer);
|
||||
|
||||
Each object group is created using a TMXObjectGroup which is a subclass of MutableArray.
|
||||
You can obtain the object groups at runtime by:
|
||||
- map->getObjectGroup(name_of_the_object_group);
|
||||
* Each object group is created using a TMXObjectGroup which is a subclass of MutableArray.
|
||||
* You can obtain the object groups at runtime by:
|
||||
* - map->getObjectGroup(name_of_the_object_group);
|
||||
|
||||
Each object is a TMXObject.
|
||||
* Each object is a TMXObject.
|
||||
|
||||
Each property is stored as a key-value pair in an MutableDictionary.
|
||||
You can obtain the properties at runtime by:
|
||||
* Each property is stored as a key-value pair in an MutableDictionary.
|
||||
* You can obtain the properties at runtime by:
|
||||
|
||||
map->getProperty(name_of_the_property);
|
||||
layer->getProperty(name_of_the_property);
|
||||
objectGroup->getProperty(name_of_the_property);
|
||||
object->getProperty(name_of_the_property);
|
||||
* map->getProperty(name_of_the_property);
|
||||
* layer->getProperty(name_of_the_property);
|
||||
* objectGroup->getProperty(name_of_the_property);
|
||||
* object->getProperty(name_of_the_property);
|
||||
|
||||
@since v3.2
|
||||
*/
|
||||
* @since v3.2
|
||||
*/
|
||||
class CC_DLL TMXTiledMap : public Node
|
||||
{
|
||||
public:
|
||||
/** creates a TMX Tiled Map with a TMX file.*/
|
||||
/** Creates a TMX Tiled Map with a TMX file.
|
||||
*
|
||||
* @return An autorelease object.
|
||||
*/
|
||||
static TMXTiledMap* create(const std::string& tmxFile);
|
||||
|
||||
/** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */
|
||||
/** Initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources.
|
||||
*
|
||||
* @param tmxString A TMX formatted XML string.
|
||||
* @param resourcePath A path to TMX resources.
|
||||
* @return An autorelease object.
|
||||
*/
|
||||
static TMXTiledMap* createWithXML(const std::string& tmxString, const std::string& resourcePath);
|
||||
|
||||
/** return the FastTMXLayer for the specific layer */
|
||||
/** Return the FastTMXLayer for the specific layer.
|
||||
*
|
||||
* @return Return the FastTMXLayer for the specific layer.
|
||||
*/
|
||||
TMXLayer* getLayer(const std::string& layerName) const;
|
||||
|
||||
/** return the TMXObjectGroup for the specific group */
|
||||
/** Return the TMXObjectGroup for the specific group.
|
||||
*
|
||||
* @return Return the TMXObjectGroup for the specific group.
|
||||
*/
|
||||
TMXObjectGroup* getObjectGroup(const std::string& groupName) const;
|
||||
|
||||
/** return the value for the specific property name */
|
||||
/** Return the value for the specific property name.
|
||||
*
|
||||
* @return Return the value for the specific property name.
|
||||
*/
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
|
||||
/** return properties dictionary for tile GID */
|
||||
/** Return properties dictionary for tile GID.
|
||||
*
|
||||
* @return Return properties dictionary for tile GID.
|
||||
*/
|
||||
Value getPropertiesForGID(int GID) const;
|
||||
|
||||
/** the map's size property measured in tiles */
|
||||
/** The map's size property measured in tiles.
|
||||
*
|
||||
* @return The map's size property measured in tiles.
|
||||
*/
|
||||
inline const Size& getMapSize() const { return _mapSize; };
|
||||
|
||||
/** Set the map's size property measured in tiles.
|
||||
*
|
||||
* @param mapSize The map's size property measured in tiles.
|
||||
*/
|
||||
inline void setMapSize(const Size& mapSize) { _mapSize = mapSize; };
|
||||
|
||||
/** the tiles's size property measured in pixels */
|
||||
/** The tiles's size property measured in pixels.
|
||||
*
|
||||
* @return The tiles's size property measured in pixels.
|
||||
*/
|
||||
inline const Size& getTileSize() const { return _tileSize; };
|
||||
|
||||
/** Set the tiles's size property measured in pixels.
|
||||
*
|
||||
* @param tileSize The tiles's size property measured in pixels.
|
||||
*/
|
||||
inline void setTileSize(const Size& tileSize) { _tileSize = tileSize; };
|
||||
|
||||
/** map orientation */
|
||||
/** Get map orientation.
|
||||
*
|
||||
* @return The map orientation.
|
||||
*/
|
||||
inline int getMapOrientation() const { return _mapOrientation; };
|
||||
|
||||
/** Set map orientation.
|
||||
*
|
||||
* @param mapOrientation The map orientation.
|
||||
*/
|
||||
inline void setMapOrientation(int mapOrientation) { _mapOrientation = mapOrientation; };
|
||||
|
||||
/** object groups */
|
||||
/** Get object groups.
|
||||
*
|
||||
* @return Object groups.
|
||||
*/
|
||||
inline const Vector<TMXObjectGroup*>& getObjectGroups() const { return _objectGroups; };
|
||||
inline Vector<TMXObjectGroup*>& getObjectGroups() { return _objectGroups; };
|
||||
|
||||
/** Set object groups.
|
||||
*
|
||||
* @param groups An object groups.
|
||||
*/
|
||||
inline void setObjectGroups(const Vector<TMXObjectGroup*>& groups) {
|
||||
_objectGroups = groups;
|
||||
};
|
||||
|
||||
/** properties */
|
||||
/** Get properties.
|
||||
*
|
||||
* @return Properties.
|
||||
*/
|
||||
inline const ValueMap& getProperties() const { return _properties; };
|
||||
|
||||
/** Set properties.
|
||||
*
|
||||
* @param properties An ValueMap Properties.
|
||||
*/
|
||||
inline void setProperties(const ValueMap& properties) {
|
||||
_properties = properties;
|
||||
};
|
||||
|
@ -180,7 +244,7 @@ private:
|
|||
};
|
||||
|
||||
// end of tilemap_parallax_nodes group
|
||||
/// @}
|
||||
/** @} */
|
||||
|
||||
} //end of namespace experimental
|
||||
|
||||
|
|
|
@ -64,7 +64,10 @@ class CC_DLL BaseLight : public Node
|
|||
{
|
||||
public:
|
||||
|
||||
//get light type
|
||||
/**
|
||||
* Get the light type,light type MUST be one of LightType::DIRECTIONAL ,
|
||||
* LightType::POINT, LightType::SPOT, LightType::AMBIENT.
|
||||
*/
|
||||
virtual LightType getLightType() const = 0;
|
||||
|
||||
/** intensity getter and setter */
|
||||
|
|
|
@ -39,29 +39,64 @@ class Texture2D;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/** MotionStreak.
|
||||
Creates a trailing path.
|
||||
/** @class MotionStreak.
|
||||
* @brief Creates a trailing path.
|
||||
*/
|
||||
class CC_DLL MotionStreak : public Node, public TextureProtocol
|
||||
{
|
||||
public:
|
||||
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */
|
||||
/** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename.
|
||||
*
|
||||
* @param fade The fade time, in seconds.
|
||||
* @param minSeg The minimum segments.
|
||||
* @param stroke The width of stroke.
|
||||
* @param color The color of stroke.
|
||||
* @param path The texture file name of stoke.
|
||||
* @return An autoreleased MotionStreak object.
|
||||
*/
|
||||
static MotionStreak* create(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path);
|
||||
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */
|
||||
/** Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture.
|
||||
*
|
||||
* @param fade The fade time, in seconds.
|
||||
* @param minSeg The minimum segments.
|
||||
* @param stroke The width of stroke.
|
||||
* @param color The color of stroke.
|
||||
* @param texture The texture name of stoke.
|
||||
* @return An autoreleased MotionStreak object.
|
||||
*/
|
||||
static MotionStreak* create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture);
|
||||
|
||||
/** color used for the tint */
|
||||
/** Color used for the tint.
|
||||
*
|
||||
* @param colors The color used for the tint.
|
||||
*/
|
||||
void tintWithColor(const Color3B& colors);
|
||||
|
||||
/** Remove all living segments of the ribbon */
|
||||
/** Remove all living segments of the ribbon.
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/** When fast mode is enabled, new points are added faster but with lower precision */
|
||||
/** When fast mode is enabled, new points are added faster but with lower precision.
|
||||
*
|
||||
* @return True if fast mode is enabled.
|
||||
*/
|
||||
inline bool isFastMode() const { return _fastMode; }
|
||||
/** Sets fast mode or not.
|
||||
*
|
||||
* @param bFastMode True if enabled fast mode.
|
||||
*/
|
||||
inline void setFastMode(bool bFastMode) { _fastMode = bFastMode; }
|
||||
|
||||
/** Is the starting position initialized or not.
|
||||
*
|
||||
* @return True if the starting position is initialized.
|
||||
*/
|
||||
inline bool isStartingPositionInitialized() const { return _startingPositionInitialized; }
|
||||
inline void setStartingPositionInitialized(bool bStartingPositionInitialized)
|
||||
/** Sets the starting position initialized or not.
|
||||
*
|
||||
* @param bStartingPositionInitialized True if initialized the starting position.
|
||||
*/
|
||||
inline void setStartingPositionInitialized(bool bStartingPositionInitialized)
|
||||
{
|
||||
_startingPositionInitialized = bStartingPositionInitialized;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
NS_CC_BEGIN
|
||||
|
||||
class GridBase;
|
||||
/**
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Base class for Grid Node.
|
||||
|
@ -89,6 +93,7 @@ protected:
|
|||
private:
|
||||
CC_DISALLOW_COPY_AND_ASSIGN(NodeGrid);
|
||||
};
|
||||
/** @} */
|
||||
NS_CC_END
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,8 @@ struct _ccArray;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/** @brief ParallaxNode: A node that simulates a parallax scroller
|
||||
/** @class ParallaxNode
|
||||
* @brief ParallaxNode: A node that simulates a parallax scroller
|
||||
|
||||
The children will be moved faster / slower than the parent according the the parallax ratio.
|
||||
|
||||
|
@ -47,17 +48,33 @@ The children will be moved faster / slower than the parent according the the par
|
|||
class CC_DLL ParallaxNode : public Node
|
||||
{
|
||||
public:
|
||||
// Create a Parallax node
|
||||
/** Create a Parallax node.
|
||||
*
|
||||
* @return An autoreleased ParallaxNode object.
|
||||
*/
|
||||
static ParallaxNode * create();
|
||||
|
||||
// prevents compiler warning: "Included function hides overloaded virtual functions"
|
||||
using Node::addChild;
|
||||
|
||||
/** Adds a child to the container with a local z-order, parallax ratio and position offset.
|
||||
*
|
||||
* @param child A child node.
|
||||
* @param z Z order for drawing priority.
|
||||
* @param parallaxRatio A given parallax ratio.
|
||||
* @param positionOffset A given position offset.
|
||||
*/
|
||||
void addChild(Node * child, int z, const Vec2& parallaxRatio, const Vec2& positionOffset);
|
||||
|
||||
/** Sets an array of layers for the Parallax node */
|
||||
/** Sets an array of layers for the Parallax node.
|
||||
*
|
||||
* @param parallaxArray An array of layers for the Parallax node.
|
||||
*/
|
||||
void setParallaxArray( struct _ccArray *parallaxArray) { _parallaxArray = parallaxArray; }
|
||||
/** Returns the array of layers of the Parallax node */
|
||||
/** Returns the array of layers of the Parallax node.
|
||||
*
|
||||
* @return An array of layers for the Parallax node.
|
||||
*/
|
||||
struct _ccArray* getParallaxArray() { return _parallaxArray; }
|
||||
const struct _ccArray* getParallaxArray() const { return _parallaxArray; }
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ class ParticleSystem;
|
|||
|
||||
#define kParticleDefaultCapacity 500
|
||||
|
||||
/** ParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call
|
||||
/** @class ParticleBatchNode
|
||||
* @brief ParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call
|
||||
* (often known as "batch draw").
|
||||
*
|
||||
* A ParticleBatchNode can reference one and only one texture (one image file, one texture atlas).
|
||||
|
@ -69,25 +70,53 @@ class ParticleSystem;
|
|||
class CC_DLL ParticleBatchNode : public Node, public TextureProtocol
|
||||
{
|
||||
public:
|
||||
/** initializes the particle system with Texture2D, a capacity of particles, which particle system to use */
|
||||
/** Create the particle system with Texture2D, a capacity of particles, which particle system to use.
|
||||
*
|
||||
* @param tex A given texture.
|
||||
* @param capacity A capacity of particles.
|
||||
* @return An autoreleased ParticleBatchNode object.
|
||||
*/
|
||||
static ParticleBatchNode* createWithTexture(Texture2D *tex, int capacity = kParticleDefaultCapacity);
|
||||
|
||||
/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles */
|
||||
/** Create the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles.
|
||||
*
|
||||
* @param fileImage A given file name.
|
||||
* @param capacity A capacity of particles.
|
||||
* @return An autoreleased ParticleBatchNode object.
|
||||
*/
|
||||
static ParticleBatchNode* create(const std::string& fileImage, int capacity = kParticleDefaultCapacity);
|
||||
|
||||
/** Inserts a child into the ParticleBatchNode */
|
||||
/** Inserts a child into the ParticleBatchNode.
|
||||
*
|
||||
* @param system A given particle system.
|
||||
* @param index The insert index.
|
||||
*/
|
||||
void insertChild(ParticleSystem* system, int index);
|
||||
|
||||
/** Remove a child of the ParticleBatchNode.
|
||||
*
|
||||
* @param index The index of the child.
|
||||
* @param doCleanup True if all actions and callbacks on this node should be removed, false otherwise.
|
||||
*/
|
||||
void removeChildAtIndex(int index, bool doCleanup);
|
||||
void removeAllChildrenWithCleanup(bool doCleanup) override;
|
||||
|
||||
/** disables a particle by inserting a 0'd quad into the texture atlas */
|
||||
/** Disables a particle by inserting a 0'd quad into the texture atlas.
|
||||
*
|
||||
* @param particleIndex The index of the particle.
|
||||
*/
|
||||
void disableParticle(int particleIndex);
|
||||
|
||||
/** Gets the texture atlas used for drawing the quads */
|
||||
/** Gets the texture atlas used for drawing the quads.
|
||||
*
|
||||
* @return The texture atlas used for drawing the quads.
|
||||
*/
|
||||
inline TextureAtlas* getTextureAtlas() const { return _textureAtlas; };
|
||||
|
||||
/** Sets the texture atlas used for drawing the quads */
|
||||
/** Sets the texture atlas used for drawing the quads.
|
||||
*
|
||||
* @param atlas The texture atlas used for drawing the quads.
|
||||
*/
|
||||
inline void setTextureAtlas(TextureAtlas* atlas) { _textureAtlas = atlas; };
|
||||
|
||||
// Overrides
|
||||
|
|
|
@ -36,11 +36,22 @@ NS_CC_BEGIN
|
|||
* @{
|
||||
*/
|
||||
|
||||
//! @brief A fire particle system
|
||||
/** @class ParticleFire
|
||||
* @brief A fire particle system.
|
||||
*/
|
||||
class CC_DLL ParticleFire : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a fire particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleFire object.
|
||||
*/
|
||||
static ParticleFire* create();
|
||||
/** Create a fire particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleFire object.
|
||||
*/
|
||||
static ParticleFire* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -61,11 +72,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire);
|
||||
};
|
||||
|
||||
//! @brief A fireworks particle system
|
||||
/** @class ParticleFireworks
|
||||
* @brief A fireworks particle system.
|
||||
*/
|
||||
class CC_DLL ParticleFireworks : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a fireworks particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleFireworks object.
|
||||
*/
|
||||
static ParticleFireworks* create();
|
||||
/** Create a fireworks particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleFireworks object.
|
||||
*/
|
||||
static ParticleFireworks* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -87,11 +109,22 @@ private:
|
|||
|
||||
};
|
||||
|
||||
//! @brief A sun particle system
|
||||
/** @class ParticleSun
|
||||
* @brief A sun particle system.
|
||||
*/
|
||||
class CC_DLL ParticleSun : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a sun particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleSun object.
|
||||
*/
|
||||
static ParticleSun* create();
|
||||
/** Create a sun particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleSun object.
|
||||
*/
|
||||
static ParticleSun* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -113,11 +146,22 @@ private:
|
|||
|
||||
};
|
||||
|
||||
//! @brief A galaxy particle system
|
||||
/** @class ParticleGalaxy
|
||||
* @brief A galaxy particle system.
|
||||
*/
|
||||
class CC_DLL ParticleGalaxy : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a galaxy particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleGalaxy object.
|
||||
*/
|
||||
static ParticleGalaxy* create();
|
||||
/** Create a galaxy particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleGalaxy object.
|
||||
*/
|
||||
static ParticleGalaxy* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -139,11 +183,22 @@ private:
|
|||
|
||||
};
|
||||
|
||||
//! @brief A flower particle system
|
||||
/** @class ParticleFlower
|
||||
* @brief A flower particle system.
|
||||
*/
|
||||
class CC_DLL ParticleFlower : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a flower particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleFlower object.
|
||||
*/
|
||||
static ParticleFlower* create();
|
||||
/** Create a flower particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleFlower object.
|
||||
*/
|
||||
static ParticleFlower* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -164,11 +219,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower);
|
||||
};
|
||||
|
||||
//! @brief A meteor particle system
|
||||
/** @class ParticleMeteor
|
||||
* @brief A meteor particle system.
|
||||
*/
|
||||
class CC_DLL ParticleMeteor : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a meteor particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleMeteor object.
|
||||
*/
|
||||
static ParticleMeteor * create();
|
||||
/** Create a meteor particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleMeteor object.
|
||||
*/
|
||||
static ParticleMeteor* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -189,11 +255,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor);
|
||||
};
|
||||
|
||||
//! @brief An spiral particle system
|
||||
/** @class ParticleSpiral
|
||||
* @brief An spiral particle system.
|
||||
*/
|
||||
class CC_DLL ParticleSpiral : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a spiral particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleSpiral object.
|
||||
*/
|
||||
static ParticleSpiral* create();
|
||||
/** Create a spiral particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleSpiral object.
|
||||
*/
|
||||
static ParticleSpiral* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -215,11 +292,22 @@ private:
|
|||
|
||||
};
|
||||
|
||||
//! @brief An explosion particle system
|
||||
/** @class ParticleExplosion
|
||||
* @brief An explosion particle system.
|
||||
*/
|
||||
class CC_DLL ParticleExplosion : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a explosion particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleExplosion object.
|
||||
*/
|
||||
static ParticleExplosion* create();
|
||||
/** Create a explosion particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleExplosion object.
|
||||
*/
|
||||
static ParticleExplosion* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -240,11 +328,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion);
|
||||
};
|
||||
|
||||
//! @brief An smoke particle system
|
||||
/** @class ParticleSmoke
|
||||
* @brief An smoke particle system.
|
||||
*/
|
||||
class CC_DLL ParticleSmoke : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a smoke particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleSmoke object.
|
||||
*/
|
||||
static ParticleSmoke* create();
|
||||
/** Create a smoke particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleSmoke object.
|
||||
*/
|
||||
static ParticleSmoke* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -265,11 +364,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke);
|
||||
};
|
||||
|
||||
//! @brief An snow particle system
|
||||
/** @class ParticleSnow
|
||||
* @brief An snow particle system.
|
||||
*/
|
||||
class CC_DLL ParticleSnow : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a snow particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleSnow object.
|
||||
*/
|
||||
static ParticleSnow* create();
|
||||
/** Create a snow particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleSnow object.
|
||||
*/
|
||||
static ParticleSnow* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -290,11 +400,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow);
|
||||
};
|
||||
|
||||
//! @brief A rain particle system
|
||||
/** @class ParticleRain
|
||||
* @brief A rain particle system.
|
||||
*/
|
||||
class CC_DLL ParticleRain : public ParticleSystemQuad
|
||||
{
|
||||
public:
|
||||
/** Create a rain particle system.
|
||||
*
|
||||
* @return An autoreleased ParticleRain object.
|
||||
*/
|
||||
static ParticleRain* create();
|
||||
/** Create a rain particle system withe a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleRain object.
|
||||
*/
|
||||
static ParticleRain* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
|
|
@ -40,8 +40,8 @@ NS_CC_BEGIN
|
|||
|
||||
class ParticleBatchNode;
|
||||
|
||||
/**
|
||||
Structure that contains the values of each particle
|
||||
/** @struct sParticle
|
||||
Structure that contains the values of each particle.
|
||||
*/
|
||||
typedef struct sParticle {
|
||||
Vec2 pos;
|
||||
|
@ -60,14 +60,18 @@ typedef struct sParticle {
|
|||
|
||||
unsigned int atlasIndex;
|
||||
|
||||
//! Mode A: gravity, direction, radial accel, tangential accel
|
||||
/** @struct modeA
|
||||
Mode A: gravity, direction, radial accel, tangential accel.
|
||||
*/
|
||||
struct {
|
||||
Vec2 dir;
|
||||
float radialAccel;
|
||||
float tangentialAccel;
|
||||
} modeA;
|
||||
|
||||
//! Mode B: radius mode
|
||||
/** @struct modeB
|
||||
Mode B: radius mode.
|
||||
*/
|
||||
struct {
|
||||
float angle;
|
||||
float degreesPerSecond;
|
||||
|
@ -81,7 +85,8 @@ typedef struct sParticle {
|
|||
|
||||
class Texture2D;
|
||||
|
||||
/** @brief Particle System base class.
|
||||
/** @class ParticleSystem
|
||||
* @brief Particle System base class.
|
||||
Attributes of a Particle System:
|
||||
- emission rate of the particles
|
||||
- Gravity Mode (Mode A):
|
||||
|
@ -106,11 +111,11 @@ Attributes of a Particle System:
|
|||
- blending function
|
||||
- texture
|
||||
|
||||
cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
|
||||
Cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
|
||||
'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,
|
||||
cocos2d uses a another approach, but the results are almost identical.
|
||||
|
||||
cocos2d supports all the variables used by Particle Designer plus a bit more:
|
||||
Cocos2d supports all the variables used by Particle Designer plus a bit more:
|
||||
- spinning particles (supported when using ParticleSystemQuad)
|
||||
- tangential acceleration (Gravity mode)
|
||||
- radial acceleration (Gravity mode)
|
||||
|
@ -134,101 +139,247 @@ emitter.startSpin = 0;
|
|||
class CC_DLL ParticleSystem : public Node, public TextureProtocol
|
||||
{
|
||||
public:
|
||||
/** Mode
|
||||
*/
|
||||
enum class Mode
|
||||
{
|
||||
GRAVITY,
|
||||
RADIUS,
|
||||
};
|
||||
|
||||
/** @typedef PositionType
|
||||
possible types of particle positions
|
||||
/** PositionType
|
||||
Possible types of particle positions.
|
||||
*/
|
||||
enum class PositionType
|
||||
{
|
||||
/** Living particles are attached to the world and are unaffected by emitter repositioning. */
|
||||
FREE,
|
||||
FREE, /** Living particles are attached to the world and are unaffected by emitter repositioning. */
|
||||
|
||||
/** Living particles are attached to the world but will follow the emitter repositioning.
|
||||
Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.
|
||||
*/
|
||||
RELATIVE,
|
||||
RELATIVE, /** Living particles are attached to the world but will follow the emitter repositioning.
|
||||
Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.*/
|
||||
|
||||
/** Living particles are attached to the emitter and are translated along with it. */
|
||||
GROUPED,
|
||||
GROUPED, /** Living particles are attached to the emitter and are translated along with it. */
|
||||
|
||||
};
|
||||
|
||||
//* @enum
|
||||
enum {
|
||||
/** The Particle emitter lives forever */
|
||||
/** The Particle emitter lives forever. */
|
||||
DURATION_INFINITY = -1,
|
||||
|
||||
/** The starting size of the particle is equal to the ending size */
|
||||
/** The starting size of the particle is equal to the ending size. */
|
||||
START_SIZE_EQUAL_TO_END_SIZE = -1,
|
||||
|
||||
/** The starting radius of the particle is equal to the ending radius */
|
||||
/** The starting radius of the particle is equal to the ending radius. */
|
||||
START_RADIUS_EQUAL_TO_END_RADIUS = -1,
|
||||
};
|
||||
|
||||
/** creates an initializes a ParticleSystem from a plist file.
|
||||
/** Creates an initializes a ParticleSystem from a plist file.
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
http://particledesigner.71squared.com/
|
||||
@since v2.0
|
||||
*/
|
||||
@since v2.0
|
||||
*
|
||||
* @param Particle plist file name.
|
||||
* @return An autoreleased ParticleSystem object.
|
||||
*/
|
||||
static ParticleSystem * create(const std::string& plistFile);
|
||||
|
||||
//! create a system with a fixed number of particles
|
||||
/** Create a system with a fixed number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleSystemQuad object.
|
||||
*/
|
||||
static ParticleSystem* createWithTotalParticles(int numberOfParticles);
|
||||
|
||||
//! Add a particle to the emitter
|
||||
/** Add a particle to the emitter.
|
||||
*
|
||||
* @return True if add success.
|
||||
*/
|
||||
bool addParticle();
|
||||
//! Initializes a particle
|
||||
/** Initializes a particle.
|
||||
*
|
||||
* @param particle A given particle pointer.
|
||||
*/
|
||||
void initParticle(tParticle* particle);
|
||||
//! stop emitting particles. Running particles will continue to run until they die
|
||||
/** Stop emitting particles. Running particles will continue to run until they die.
|
||||
*/
|
||||
void stopSystem();
|
||||
//! Kill all living particles.
|
||||
/** Kill all living particles.
|
||||
*/
|
||||
void resetSystem();
|
||||
//! whether or not the system is full
|
||||
/** Whether or not the system is full.
|
||||
*
|
||||
* @return True if the system is full.
|
||||
*/
|
||||
bool isFull();
|
||||
|
||||
//! should be overridden by subclasses
|
||||
/** Update the verts position data of particle,
|
||||
should be overridden by subclasses.
|
||||
*
|
||||
* @param particle A certain particle.
|
||||
* @param newPosition A new position.
|
||||
*/
|
||||
virtual void updateQuadWithParticle(tParticle* particle, const Vec2& newPosition);
|
||||
//! should be overridden by subclasses
|
||||
/** Update the VBO verts buffer which does not use batch node,
|
||||
should be overridden by subclasses. */
|
||||
virtual void postStep();
|
||||
|
||||
/** Call the update mathod with no time..
|
||||
*/
|
||||
virtual void updateWithNoTime(void);
|
||||
|
||||
/** Whether or not the particle system removed self on finish.
|
||||
*
|
||||
* @return True if the particle system removed self on finish.
|
||||
*/
|
||||
virtual bool isAutoRemoveOnFinish() const;
|
||||
|
||||
/** Set the particle system auto removed it self on finish.
|
||||
*
|
||||
* @param var True if the particle system removed self on finish.
|
||||
*/
|
||||
virtual void setAutoRemoveOnFinish(bool var);
|
||||
|
||||
// mode A
|
||||
/** Gets the garvity.
|
||||
*
|
||||
* @return The gravity.
|
||||
*/
|
||||
virtual const Vec2& getGravity();
|
||||
/** Sets the gravity.
|
||||
*
|
||||
* @param g The gravity.
|
||||
*/
|
||||
virtual void setGravity(const Vec2& g);
|
||||
/** Gets the speed.
|
||||
*
|
||||
* @return The speed.
|
||||
*/
|
||||
virtual float getSpeed() const;
|
||||
/** Sets the speed.
|
||||
*
|
||||
* @param speed The speed.
|
||||
*/
|
||||
virtual void setSpeed(float speed);
|
||||
/** Gets the speed variance.
|
||||
*
|
||||
* @return The speed variance.
|
||||
*/
|
||||
virtual float getSpeedVar() const;
|
||||
/** Sets the speed variance.
|
||||
*
|
||||
* @param speed The speed variance.
|
||||
*/
|
||||
virtual void setSpeedVar(float speed);
|
||||
/** Gets the tangential acceleration.
|
||||
*
|
||||
* @return The tangential acceleration.
|
||||
*/
|
||||
virtual float getTangentialAccel() const;
|
||||
/** Sets the tangential acceleration.
|
||||
*
|
||||
* @param t The tangential acceleration.
|
||||
*/
|
||||
virtual void setTangentialAccel(float t);
|
||||
/** Gets the tangential acceleration variance.
|
||||
*
|
||||
* @return The tangential acceleration variance.
|
||||
*/
|
||||
virtual float getTangentialAccelVar() const;
|
||||
/** Sets the tangential acceleration variance.
|
||||
*
|
||||
* @param t The tangential acceleration variance.
|
||||
*/
|
||||
virtual void setTangentialAccelVar(float t);
|
||||
/** Gets the radial acceleration.
|
||||
*
|
||||
* @return The radial acceleration.
|
||||
*/
|
||||
virtual float getRadialAccel() const;
|
||||
/** Sets the radial acceleration.
|
||||
*
|
||||
* @param t The radial acceleration.
|
||||
*/
|
||||
virtual void setRadialAccel(float t);
|
||||
/** Gets the radial acceleration variance.
|
||||
*
|
||||
* @return The radial acceleration variance.
|
||||
*/
|
||||
virtual float getRadialAccelVar() const;
|
||||
/** Sets the radial acceleration variance.
|
||||
*
|
||||
* @param t The radial acceleration variance.
|
||||
*/
|
||||
virtual void setRadialAccelVar(float t);
|
||||
/** Whether or not the rotation of each particle to its direction.
|
||||
*
|
||||
* @return True if the rotation is the direction.
|
||||
*/
|
||||
virtual bool getRotationIsDir() const;
|
||||
/** Sets the rotation of each particle to its direction.
|
||||
*
|
||||
* @param t True if the rotation is the direction.
|
||||
*/
|
||||
virtual void setRotationIsDir(bool t);
|
||||
// mode B
|
||||
/** Gets the start radius.
|
||||
*
|
||||
* @return The start radius.
|
||||
*/
|
||||
virtual float getStartRadius() const;
|
||||
/** Sets the start radius.
|
||||
*
|
||||
* @param startRadius The start radius.
|
||||
*/
|
||||
virtual void setStartRadius(float startRadius);
|
||||
/** Gets the start radius variance.
|
||||
*
|
||||
* @return The start radius variance.
|
||||
*/
|
||||
virtual float getStartRadiusVar() const;
|
||||
/** Sets the start radius variance.
|
||||
*
|
||||
* @param startRadiusVar The start radius variance.
|
||||
*/
|
||||
virtual void setStartRadiusVar(float startRadiusVar);
|
||||
/** Gets the end radius.
|
||||
*
|
||||
* @return The end radius.
|
||||
*/
|
||||
virtual float getEndRadius() const;
|
||||
/** Sets the end radius.
|
||||
*
|
||||
* @param endRadius The end radius.
|
||||
*/
|
||||
virtual void setEndRadius(float endRadius);
|
||||
/** Gets the end radius variance.
|
||||
*
|
||||
* @return The end radius variance.
|
||||
*/
|
||||
virtual float getEndRadiusVar() const;
|
||||
/** Sets the end radius variance.
|
||||
*
|
||||
* @param endRadiusVar The end radius variance.
|
||||
*/
|
||||
virtual void setEndRadiusVar(float endRadiusVar);
|
||||
/** Gets the number of degrees to rotate a particle around the source pos per second.
|
||||
*
|
||||
* @return The number of degrees to rotate a particle around the source pos per second.
|
||||
*/
|
||||
virtual float getRotatePerSecond() const;
|
||||
/** Sets the number of degrees to rotate a particle around the source pos per second.
|
||||
*
|
||||
* @param degrees The number of degrees to rotate a particle around the source pos per second.
|
||||
*/
|
||||
virtual void setRotatePerSecond(float degrees);
|
||||
/** Gets the rotate per second variance.
|
||||
*
|
||||
* @return The rotate per second variance.
|
||||
*/
|
||||
virtual float getRotatePerSecondVar() const;
|
||||
/** Sets the rotate per second variance.
|
||||
*
|
||||
* @param degrees The rotate per second variance.
|
||||
*/
|
||||
virtual void setRotatePerSecondVar(float degrees);
|
||||
|
||||
virtual void setScale(float s) override;
|
||||
|
@ -236,109 +387,292 @@ public:
|
|||
virtual void setScaleX(float newScaleX) override;
|
||||
virtual void setScaleY(float newScaleY) override;
|
||||
|
||||
/** Whether or not the particle system is active.
|
||||
*
|
||||
* @return True if the particle system is active.
|
||||
*/
|
||||
virtual bool isActive() const;
|
||||
/** Whether or not the particle system is blend additive.
|
||||
*
|
||||
* @return True if the particle system is blend additive.
|
||||
*/
|
||||
virtual bool isBlendAdditive() const;
|
||||
/** Sets the particle system blend additive.
|
||||
*
|
||||
* @param value True if the particle system is blend additive.
|
||||
*/
|
||||
virtual void setBlendAdditive(bool value);
|
||||
|
||||
/** Gets the batch node.
|
||||
*
|
||||
* @return The batch node.
|
||||
*/
|
||||
virtual ParticleBatchNode* getBatchNode() const;
|
||||
/** Sets the batch node.
|
||||
*
|
||||
* @param batchNode The batch node.
|
||||
*/
|
||||
virtual void setBatchNode(ParticleBatchNode* batchNode);
|
||||
|
||||
// index of system in batch node array
|
||||
/** Gets the index of system in batch node array.
|
||||
*
|
||||
* @return The index of system in batch node array.
|
||||
*/
|
||||
inline int getAtlasIndex() const { return _atlasIndex; };
|
||||
/** Sets the index of system in batch node array.
|
||||
*
|
||||
* @param index The index of system in batch node array.
|
||||
*/
|
||||
inline void setAtlasIndex(int index) { _atlasIndex = index; };
|
||||
|
||||
/** Quantity of particles that are being simulated at the moment */
|
||||
/** Gets the Quantity of particles that are being simulated at the moment.
|
||||
*
|
||||
* @return The Quantity of particles that are being simulated at the moment.
|
||||
*/
|
||||
inline unsigned int getParticleCount() const { return _particleCount; };
|
||||
|
||||
/** How many seconds the emitter will run. -1 means 'forever' */
|
||||
/** Gets how many seconds the emitter will run. -1 means 'forever'.
|
||||
*
|
||||
* @return The seconds that the emitter will run. -1 means 'forever'.
|
||||
*/
|
||||
inline float getDuration() const { return _duration; };
|
||||
/** Sets how many seconds the emitter will run. -1 means 'forever'.
|
||||
*
|
||||
* @param duration The seconds that the emitter will run. -1 means 'forever'.
|
||||
*/
|
||||
inline void setDuration(float duration) { _duration = duration; };
|
||||
|
||||
/** sourcePosition of the emitter */
|
||||
/** Gets the source position of the emitter.
|
||||
*
|
||||
* @return The source position of the emitter.
|
||||
*/
|
||||
inline const Vec2& getSourcePosition() const { return _sourcePosition; };
|
||||
/** Sets the source position of the emitter.
|
||||
*
|
||||
* @param The source position of the emitter.
|
||||
*/
|
||||
inline void setSourcePosition(const Vec2& pos) { _sourcePosition = pos; };
|
||||
|
||||
/** Position variance of the emitter */
|
||||
/** Gets the position variance of the emitter.
|
||||
*
|
||||
* @return The position variance of the emitter.
|
||||
*/
|
||||
inline const Vec2& getPosVar() const { return _posVar; };
|
||||
/** Sets the position variance of the emitter.
|
||||
*
|
||||
* @param pos The position variance of the emitter.
|
||||
*/
|
||||
inline void setPosVar(const Vec2& pos) { _posVar = pos; };
|
||||
|
||||
/** life, and life variation of each particle */
|
||||
/** Gets the life of each particle.
|
||||
*
|
||||
* @return The life of each particle.
|
||||
*/
|
||||
inline float getLife() const { return _life; };
|
||||
/** Sets the life of each particle.
|
||||
*
|
||||
* @param life The life of each particle.
|
||||
*/
|
||||
inline void setLife(float life) { _life = life; };
|
||||
|
||||
/** life variance of each particle */
|
||||
/** Gets the life variance of each particle.
|
||||
*
|
||||
* @return The life variance of each particle.
|
||||
*/
|
||||
inline float getLifeVar() const { return _lifeVar; };
|
||||
/** Sets the life variance of each particle.
|
||||
*
|
||||
* @param lifeVar The life variance of each particle.
|
||||
*/
|
||||
inline void setLifeVar(float lifeVar) { _lifeVar = lifeVar; };
|
||||
|
||||
/** angle and angle variation of each particle */
|
||||
/** Gets the angle of each particle.
|
||||
*
|
||||
* @return The angle of each particle.
|
||||
*/
|
||||
inline float getAngle() const { return _angle; };
|
||||
/** Sets the angle of each particle.
|
||||
*
|
||||
* @param angle The angle of each particle.
|
||||
*/
|
||||
inline void setAngle(float angle) { _angle = angle; };
|
||||
|
||||
/** angle variance of each particle */
|
||||
/** Gets the angle variance of each particle.
|
||||
*
|
||||
* @return The angle variance of each particle.
|
||||
*/
|
||||
inline float getAngleVar() const { return _angleVar; };
|
||||
/** Sets the angle variance of each particle.
|
||||
*
|
||||
* @param angleVar The angle variance of each particle.
|
||||
*/
|
||||
inline void setAngleVar(float angleVar) { _angleVar = angleVar; };
|
||||
|
||||
/** Switch between different kind of emitter modes:
|
||||
- kParticleModeGravity: uses gravity, speed, radial and tangential acceleration
|
||||
- kParticleModeRadius: uses radius movement + rotation
|
||||
- kParticleModeGravity: uses gravity, speed, radial and tangential acceleration.
|
||||
- kParticleModeRadius: uses radius movement + rotation.
|
||||
*
|
||||
* @return The mode of the emitter.
|
||||
*/
|
||||
inline Mode getEmitterMode() const { return _emitterMode; };
|
||||
/** Sets the mode of the emitter.
|
||||
*
|
||||
* @param mode The mode of the emitter.
|
||||
*/
|
||||
inline void setEmitterMode(Mode mode) { _emitterMode = mode; };
|
||||
|
||||
/** start size in pixels of each particle */
|
||||
/** Gets the start size in pixels of each particle.
|
||||
*
|
||||
* @return The start size in pixels of each particle.
|
||||
*/
|
||||
inline float getStartSize() const { return _startSize; };
|
||||
/** Sets the start size in pixels of each particle.
|
||||
*
|
||||
* @param startSize The start size in pixels of each particle.
|
||||
*/
|
||||
inline void setStartSize(float startSize) { _startSize = startSize; };
|
||||
|
||||
/** size variance in pixels of each particle */
|
||||
/** Gets the start size variance in pixels of each particle.
|
||||
*
|
||||
* @return The start size variance in pixels of each particle.
|
||||
*/
|
||||
inline float getStartSizeVar() const { return _startSizeVar; };
|
||||
/** Sets the start size variance in pixels of each particle.
|
||||
*
|
||||
* @param sizeVar The start size variance in pixels of each particle.
|
||||
*/
|
||||
inline void setStartSizeVar(float sizeVar) { _startSizeVar = sizeVar; };
|
||||
|
||||
/** end size in pixels of each particle */
|
||||
/** Gets the end size in pixels of each particle.
|
||||
*
|
||||
* @return The end size in pixels of each particle.
|
||||
*/
|
||||
inline float getEndSize() const { return _endSize; };
|
||||
/** Sets the end size in pixels of each particle.
|
||||
*
|
||||
* @param endSize The end size in pixels of each particle.
|
||||
*/
|
||||
inline void setEndSize(float endSize) { _endSize = endSize; };
|
||||
|
||||
/** end size variance in pixels of each particle */
|
||||
/** Gets the end size variance in pixels of each particle.
|
||||
*
|
||||
* @return The end size variance in pixels of each particle.
|
||||
*/
|
||||
inline float getEndSizeVar() const { return _endSizeVar; };
|
||||
/** Sets the end size variance in pixels of each particle.
|
||||
*
|
||||
* @param sizeVar The end size variance in pixels of each particle.
|
||||
*/
|
||||
inline void setEndSizeVar(float sizeVar) { _endSizeVar = sizeVar; };
|
||||
|
||||
/** start color of each particle */
|
||||
/** Gets the start color of each particle.
|
||||
*
|
||||
* @return The start color of each particle.
|
||||
*/
|
||||
inline const Color4F& getStartColor() const { return _startColor; };
|
||||
/** Sets the start color of each particle.
|
||||
*
|
||||
* @param color The start color of each particle.
|
||||
*/
|
||||
inline void setStartColor(const Color4F& color) { _startColor = color; };
|
||||
|
||||
/** start color variance of each particle */
|
||||
/** Gets the start color variance of each particle.
|
||||
*
|
||||
* @return The start color variance of each particle.
|
||||
*/
|
||||
inline const Color4F& getStartColorVar() const { return _startColorVar; };
|
||||
/** Sets the start color variance of each particle.
|
||||
*
|
||||
* @param color The start color variance of each particle.
|
||||
*/
|
||||
inline void setStartColorVar(const Color4F& color) { _startColorVar = color; };
|
||||
|
||||
/** end color and end color variation of each particle */
|
||||
/** Gets the end color and end color variation of each particle.
|
||||
*
|
||||
* @return The end color and end color variation of each particle.
|
||||
*/
|
||||
inline const Color4F& getEndColor() const { return _endColor; };
|
||||
/** Sets the end color and end color variation of each particle.
|
||||
*
|
||||
* @param color The end color and end color variation of each particle.
|
||||
*/
|
||||
inline void setEndColor(const Color4F& color) { _endColor = color; };
|
||||
|
||||
/** end color variance of each particle */
|
||||
/** Gets the end color variance of each particle.
|
||||
*
|
||||
* @return The end color variance of each particle.
|
||||
*/
|
||||
inline const Color4F& getEndColorVar() const { return _endColorVar; };
|
||||
/** Sets the end color variance of each particle.
|
||||
*
|
||||
* @param color The end color variance of each particle.
|
||||
*/
|
||||
inline void setEndColorVar(const Color4F& color) { _endColorVar = color; };
|
||||
|
||||
//* initial angle of each particle
|
||||
/** Gets the start spin of each particle.
|
||||
*
|
||||
* @return The start spin of each particle.
|
||||
*/
|
||||
inline float getStartSpin() const { return _startSpin; };
|
||||
/** Sets the start spin of each particle.
|
||||
*
|
||||
* @param spin The start spin of each particle.
|
||||
*/
|
||||
inline void setStartSpin(float spin) { _startSpin = spin; };
|
||||
|
||||
//* initial angle of each particle
|
||||
/** Gets the start spin variance of each particle.
|
||||
*
|
||||
* @return The start spin variance of each particle.
|
||||
*/
|
||||
inline float getStartSpinVar() const { return _startSpinVar; };
|
||||
/** Sets the start spin variance of each particle.
|
||||
*
|
||||
* @param pinVar The start spin variance of each particle.
|
||||
*/
|
||||
inline void setStartSpinVar(float pinVar) { _startSpinVar = pinVar; };
|
||||
|
||||
//* initial angle of each particle
|
||||
/** Gets the end spin of each particle.
|
||||
*
|
||||
* @return The end spin of each particle.
|
||||
*/
|
||||
inline float getEndSpin() const { return _endSpin; };
|
||||
/** Sets the end spin of each particle.
|
||||
*
|
||||
* @param endSpin The end spin of each particle.
|
||||
*/
|
||||
inline void setEndSpin(float endSpin) { _endSpin = endSpin; };
|
||||
|
||||
//* initial angle of each particle
|
||||
/** Gets the end spin variance of each particle.
|
||||
*
|
||||
* @return The end spin variance of each particle.
|
||||
*/
|
||||
inline float getEndSpinVar() const { return _endSpinVar; };
|
||||
/** Sets the end spin variance of each particle.
|
||||
*
|
||||
* @param endSpinVar The end spin variance of each particle.
|
||||
*/
|
||||
inline void setEndSpinVar(float endSpinVar) { _endSpinVar = endSpinVar; };
|
||||
|
||||
/** emission rate of the particles */
|
||||
/** Gets the emission rate of the particles.
|
||||
*
|
||||
* @return The emission rate of the particles.
|
||||
*/
|
||||
inline float getEmissionRate() const { return _emissionRate; };
|
||||
/** Sets the emission rate of the particles.
|
||||
*
|
||||
* @param rate The emission rate of the particles.
|
||||
*/
|
||||
inline void setEmissionRate(float rate) { _emissionRate = rate; };
|
||||
|
||||
/** maximum particles of the system */
|
||||
/** Gets the maximum particles of the system.
|
||||
*
|
||||
* @return The maximum particles of the system.
|
||||
*/
|
||||
virtual int getTotalParticles() const;
|
||||
/** Sets the maximum particles of the system.
|
||||
*
|
||||
* @param totalParticles The maximum particles of the system.
|
||||
*/
|
||||
virtual void setTotalParticles(int totalParticles);
|
||||
|
||||
/** does the alpha value modify color */
|
||||
|
@ -346,10 +680,17 @@ public:
|
|||
inline bool isOpacityModifyRGB() const override { return _opacityModifyRGB; };
|
||||
CC_DEPRECATED_ATTRIBUTE inline bool getOpacityModifyRGB() const { return isOpacityModifyRGB(); }
|
||||
|
||||
/** particles movement type: Free or Grouped
|
||||
/** Gets the particles movement type: Free or Grouped.
|
||||
@since v0.8
|
||||
*
|
||||
* @return The particles movement type.
|
||||
*/
|
||||
inline PositionType getPositionType() const { return _positionType; };
|
||||
/** Sets the particles movement type: Free or Grouped.
|
||||
@since v0.8
|
||||
*
|
||||
* @param type The particles movement type.
|
||||
*/
|
||||
inline void setPositionType(PositionType type) { _positionType = type; };
|
||||
|
||||
// Overrides
|
||||
|
|
|
@ -41,35 +41,52 @@ class EventCustom;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/** @brief ParticleSystemQuad is a subclass of ParticleSystem
|
||||
/** @class ParticleSystemQuad
|
||||
* @brief ParticleSystemQuad is a subclass of ParticleSystem.
|
||||
|
||||
It includes all the features of ParticleSystem.
|
||||
|
||||
Special features and Limitations:
|
||||
- Particle size can be any float number.
|
||||
- The system can be scaled
|
||||
- The particles can be rotated
|
||||
- It supports subrects
|
||||
- It supports batched rendering since 1.1
|
||||
- The system can be scaled.
|
||||
- The particles can be rotated.
|
||||
- It supports subrects.
|
||||
- It supports batched rendering since 1.1.
|
||||
@since v0.8
|
||||
*/
|
||||
class CC_DLL ParticleSystemQuad : public ParticleSystem
|
||||
{
|
||||
public:
|
||||
|
||||
/** creates a Particle Emitter */
|
||||
/** Creates a Particle Emitter.
|
||||
*
|
||||
* @return An autoreleased ParticleSystemQuad object.
|
||||
*/
|
||||
static ParticleSystemQuad * create();
|
||||
/** creates a Particle Emitter with a number of particles */
|
||||
/** Creates a Particle Emitter with a number of particles.
|
||||
*
|
||||
* @param numberOfParticles A given number of particles.
|
||||
* @return An autoreleased ParticleSystemQuad object.
|
||||
*/
|
||||
static ParticleSystemQuad * createWithTotalParticles(int numberOfParticles);
|
||||
/** creates an initializes a ParticleSystemQuad from a plist file.
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
/** Creates an initializes a ParticleSystemQuad from a plist file.
|
||||
This plist files can be created manually or with Particle Designer.
|
||||
*
|
||||
* @param filename Particle plist file name.
|
||||
* @return An autoreleased ParticleSystemQuad object.
|
||||
*/
|
||||
static ParticleSystemQuad * create(const std::string& filename);
|
||||
/** creates a Particle Emitter with a dictionary */
|
||||
/** Creates a Particle Emitter with a dictionary.
|
||||
*
|
||||
* @param dictionary Particle dictionary.
|
||||
* @return An autoreleased ParticleSystemQuad object.
|
||||
*/
|
||||
static ParticleSystemQuad * create(ValueMap &dictionary);
|
||||
|
||||
/** Sets a new SpriteFrame as particle.
|
||||
WARNING: this method is experimental. Use setTextureWithRect instead.
|
||||
*
|
||||
* @param spriteFrame A given sprite frame as particle texture.
|
||||
@since v0.99.4
|
||||
*/
|
||||
void setDisplayFrame(SpriteFrame *spriteFrame);
|
||||
|
@ -78,12 +95,17 @@ public:
|
|||
@since v0.99.4
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*
|
||||
* @param texture A given texture.
|
||||
8 @param rect A given rect, in points.
|
||||
*/
|
||||
void setTextureWithRect(Texture2D *texture, const Rect& rect);
|
||||
|
||||
/** listen the event that renderer was recreated on Android/WP8
|
||||
/** Listen the event that renderer was recreated on Android/WP8.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*
|
||||
* @param event the event that renderer was recreated on Android/WP8.
|
||||
*/
|
||||
void listenRendererRecreated(EventCustom* event);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ NS_CC_BEGIN
|
|||
class Sprite;
|
||||
|
||||
/**
|
||||
* @addtogroup misc_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -37,118 +37,227 @@ NS_CC_BEGIN
|
|||
class EventCustom;
|
||||
|
||||
/**
|
||||
* @addtogroup textures
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
@brief RenderTexture is a generic rendering target. To render things into it,
|
||||
simply construct a render target, call begin on it, call visit on any cocos
|
||||
scenes or objects to render them, and call end. For convenience, render texture
|
||||
adds a sprite as it's display child with the results, so you can simply add
|
||||
the render texture to your scene and treat it like any other CocosNode.
|
||||
There are also functions for saving the render texture to disk in PNG or JPG format.
|
||||
|
||||
@since v0.8.1
|
||||
*/
|
||||
* @brief RenderTexture is a generic rendering target. To render things into it,
|
||||
* simply construct a render target, call begin on it, call visit on any cocos
|
||||
* scenes or objects to render them, and call end. For convenience, render texture
|
||||
* adds a sprite as it's display child with the results, so you can simply add
|
||||
* the render texture to your scene and treat it like any other CocosNode.
|
||||
* There are also functions for saving the render texture to disk in PNG or JPG format.
|
||||
* @since v0.8.1
|
||||
*/
|
||||
class CC_DLL RenderTexture : public Node
|
||||
{
|
||||
public:
|
||||
/** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/
|
||||
/** Initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format.
|
||||
*
|
||||
* @param w The RenderTexture object width.
|
||||
* @param h The RenderTexture object height.
|
||||
* @param format In Points and a pixel format( only RGB and RGBA formats are valid ).
|
||||
* @param depthStencilFormat The depthStencil format.
|
||||
*/
|
||||
static RenderTexture * create(int w ,int h, Texture2D::PixelFormat format, GLuint depthStencilFormat);
|
||||
|
||||
/** creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */
|
||||
/** Creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid.
|
||||
*
|
||||
* @param w The RenderTexture object width.
|
||||
* @param h The RenderTexture object height.
|
||||
* @param format In Points and a pixel format( only RGB and RGBA formats are valid ).
|
||||
*/
|
||||
static RenderTexture * create(int w, int h, Texture2D::PixelFormat format);
|
||||
|
||||
/** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */
|
||||
/** Creates a RenderTexture object with width and height in Points, pixel format is RGBA8888.
|
||||
*
|
||||
* @param w The RenderTexture object width.
|
||||
* @param h The RenderTexture object height.
|
||||
*/
|
||||
static RenderTexture * create(int w, int h);
|
||||
|
||||
/** starts grabbing */
|
||||
/** Starts grabbing. */
|
||||
virtual void begin();
|
||||
|
||||
/** starts rendering to the texture while clearing the texture first.
|
||||
This is more efficient then calling -clear first and then -begin */
|
||||
/** Starts rendering to the texture while clearing the texture first.
|
||||
* This is more efficient then calling -clear first and then -begin.
|
||||
*
|
||||
* @param r Red.
|
||||
* @param g Green.
|
||||
* @param b Blue.
|
||||
* @param a Alpha.
|
||||
*/
|
||||
virtual void beginWithClear(float r, float g, float b, float a);
|
||||
|
||||
/** starts rendering to the texture while clearing the texture first.
|
||||
This is more efficient then calling -clear first and then -begin */
|
||||
/** Starts rendering to the texture while clearing the texture first.
|
||||
* This is more efficient then calling -clear first and then -begin.
|
||||
*
|
||||
* @param r Red.
|
||||
* @param g Green.
|
||||
* @param b Blue.
|
||||
* @param a Alpha.
|
||||
*/
|
||||
virtual void beginWithClear(float r, float g, float b, float a, float depthValue);
|
||||
|
||||
/** starts rendering to the texture while clearing the texture first.
|
||||
This is more efficient then calling -clear first and then -begin */
|
||||
/** Starts rendering to the texture while clearing the texture first.
|
||||
* This is more efficient then calling -clear first and then -begin.
|
||||
*
|
||||
* @param r Red.
|
||||
* @param g Green.
|
||||
* @param b Blue.
|
||||
* @param a Alpha.
|
||||
* @param depthValue A specified depth value.
|
||||
* @param stencilValue A specified stencil value.
|
||||
*/
|
||||
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. */
|
||||
inline void endToLua(){ end();};
|
||||
|
||||
/** ends grabbing*/
|
||||
/** Ends grabbing. */
|
||||
virtual void end();
|
||||
|
||||
/** clears the texture with a color */
|
||||
/** Clears the texture with a color.
|
||||
*
|
||||
* @param r Red.
|
||||
* @param g Green.
|
||||
* @param b Blue.
|
||||
* @param a Alpha.
|
||||
*/
|
||||
void clear(float r, float g, float b, float a);
|
||||
|
||||
/** clears the texture with a specified depth value */
|
||||
/** Clears the texture with a specified depth value.
|
||||
*
|
||||
* @param A specified depth value.
|
||||
*/
|
||||
virtual void clearDepth(float depthValue);
|
||||
|
||||
/** clears the texture with a specified stencil value */
|
||||
virtual void clearStencil(int stencilValue);
|
||||
/* creates a new Image from with the texture's data.
|
||||
Caller is responsible for releasing it by calling delete.
|
||||
/** Clears the texture with a specified stencil value.
|
||||
*
|
||||
* @param A specified stencil value.
|
||||
*/
|
||||
virtual void clearStencil(int stencilValue);
|
||||
|
||||
/* Creates a new Image from with the texture's data.
|
||||
* Caller is responsible for releasing it by calling delete.
|
||||
*
|
||||
* @param flipImage Whether or not to flip image.
|
||||
* @return An image.
|
||||
*/
|
||||
Image* newImage(bool flipImage = true);
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE Image* newCCImage(bool flipImage = true) { return newImage(flipImage); };
|
||||
|
||||
/** saves the texture into a file using JPEG format. The file will be saved in the Documents folder.
|
||||
Returns true if the operation is successful.
|
||||
/** Saves the texture into a file using JPEG format. The file will be saved in the Documents folder.
|
||||
* Returns true if the operation is successful.
|
||||
*
|
||||
* @param filename The file name.
|
||||
* @param isRGBA The file is RGBA or not.
|
||||
* @param callback When the file is save finished,it will callback this function.
|
||||
* @return Returns true if the operation is successful.
|
||||
*/
|
||||
bool saveToFile(const std::string& filename, bool isRGBA = true, std::function<void (RenderTexture*, const std::string&)> callback = nullptr);
|
||||
|
||||
/** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder.
|
||||
Returns true if the operation is successful.
|
||||
Notes: since v3.x, saveToFile will generate a custum command, which will be called in the following render->render().
|
||||
So if this function is called in a event handler, the actual save file will be called in the next frame. If we switch to a different scene, the game will crash.
|
||||
To solve this, add Director::getInstance()->getRenderer()->render(); after this function.
|
||||
* Notes: since v3.x, saveToFile will generate a custum command, which will be called in the following render->render().
|
||||
* So if this function is called in a event handler, the actual save file will be called in the next frame. If we switch to a different scene, the game will crash.
|
||||
* To solve this, add Director::getInstance()->getRenderer()->render(); after this function.
|
||||
*
|
||||
* @param filename The file name.
|
||||
* @param format The image format.
|
||||
* @param isRGBA The file is RGBA or not.
|
||||
* @param callback When the file is save finished,it will callback this function.
|
||||
* @return Returns true if the operation is successful.
|
||||
*/
|
||||
bool saveToFile(const std::string& filename, Image::Format format, bool isRGBA = true, std::function<void (RenderTexture*, const std::string&)> callback = nullptr);
|
||||
|
||||
/** Listen "come to background" message, and save render texture.
|
||||
It only has effect on Android.
|
||||
* It only has effect on Android.
|
||||
*
|
||||
* @param event Event Custom.
|
||||
*/
|
||||
void listenToBackground(EventCustom *event);
|
||||
|
||||
/** Listen "come to foreground" message and restore the frame buffer object
|
||||
It only has effect on Android.
|
||||
/** Listen "come to foreground" message and restore the frame buffer object.
|
||||
* It only has effect on Android.
|
||||
*
|
||||
* @param event Event Custom.
|
||||
*/
|
||||
void listenToForeground(EventCustom *event);
|
||||
|
||||
/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw" is true. */
|
||||
/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw" is true.
|
||||
*
|
||||
* @return Clear flags.
|
||||
*/
|
||||
inline unsigned int getClearFlags() const { return _clearFlags; };
|
||||
|
||||
/** Set flags.
|
||||
*
|
||||
* @param clearFlags Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT.
|
||||
*/
|
||||
inline void setClearFlags(unsigned int clearFlags) { _clearFlags = clearFlags; };
|
||||
|
||||
/** Clear color value. Valid only when "autoDraw" is true. */
|
||||
/** Clear color value. Valid only when "autoDraw" is true.
|
||||
*
|
||||
* @return Color value.
|
||||
*/
|
||||
inline const Color4F& getClearColor() const { return _clearColor; };
|
||||
|
||||
/** Set color value.
|
||||
*
|
||||
* @param clearColor Color value.
|
||||
*/
|
||||
inline void setClearColor(const Color4F &clearColor) { _clearColor = clearColor; };
|
||||
|
||||
/** Value for clearDepth. Valid only when "autoDraw" is true. */
|
||||
/** Value for clearDepth. Valid only when "autoDraw" is true.
|
||||
*
|
||||
* @return Value for clearDepth.
|
||||
*/
|
||||
inline float getClearDepth() const { return _clearDepth; };
|
||||
|
||||
/** Set Value for clearDepth.
|
||||
*
|
||||
* @param clearDepth Value for clearDepth.
|
||||
*/
|
||||
inline void setClearDepth(float clearDepth) { _clearDepth = clearDepth; };
|
||||
|
||||
/** Value for clear Stencil. Valid only when "autoDraw" is true */
|
||||
/** Value for clear Stencil. Valid only when "autoDraw" is true.
|
||||
*
|
||||
* @return Value for clear Stencil.
|
||||
*/
|
||||
inline int getClearStencil() const { return _clearStencil; };
|
||||
|
||||
/** Set Value for clear Stencil.
|
||||
*
|
||||
* @param clearStencil Value for clear Stencil.
|
||||
*/
|
||||
inline void setClearStencil(int clearStencil) { _clearStencil = clearStencil; };
|
||||
|
||||
/** When enabled, it will render its children into the texture automatically. Disabled by default for compatiblity reasons.
|
||||
Will be enabled in the future.
|
||||
* Will be enabled in the future.
|
||||
*
|
||||
* @return Return the autoDraw value.
|
||||
*/
|
||||
inline bool isAutoDraw() const { return _autoDraw; };
|
||||
|
||||
/** Set a valve to control whether or not render its children into the texture automatically.
|
||||
*
|
||||
* @param isAutoDraw Whether or not render its children into the texture automatically.
|
||||
*/
|
||||
inline void setAutoDraw(bool isAutoDraw) { _autoDraw = isAutoDraw; };
|
||||
|
||||
/** Gets the Sprite being used. */
|
||||
/** Gets the Sprite being used.
|
||||
*
|
||||
* @return A Sprite.
|
||||
*/
|
||||
inline Sprite* getSprite() const { return _sprite; };
|
||||
|
||||
/** Sets the Sprite being used. */
|
||||
/** Sets the Sprite being used.
|
||||
*
|
||||
* @param A Sprite.
|
||||
*/
|
||||
inline void setSprite(Sprite* sprite) {
|
||||
CC_SAFE_RETAIN(sprite);
|
||||
CC_SAFE_RELEASE(_sprite);
|
||||
|
@ -159,24 +268,41 @@ public:
|
|||
virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
|
||||
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
||||
|
||||
//flag: use stack matrix computed from scene hierarchy or generate new modelView and projection matrix
|
||||
/** 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.
|
||||
*/
|
||||
void setKeepMatrix(bool keepMatrix);
|
||||
/**Used for grab part of screen to a texture.
|
||||
//rtBegin: the position of renderTexture on the fullRect
|
||||
//fullRect: the total size of screen
|
||||
//fullViewport: the total viewportSize
|
||||
*/
|
||||
* @param rtBegin The position of renderTexture on the fullRect.
|
||||
* @param fullRect The total size of screen.
|
||||
* @param fullViewport The total viewportSize.
|
||||
*/
|
||||
void setVirtualViewport(const Vec2& rtBegin, const Rect& fullRect, const Rect& fullViewport);
|
||||
|
||||
public:
|
||||
// FIXME: should be procted.
|
||||
// but due to a bug in PowerVR + Android,
|
||||
// the constructor is public again
|
||||
/** FIXME: should be procted.
|
||||
* but due to a bug in PowerVR + Android,
|
||||
* the constructor is public again.
|
||||
*/
|
||||
RenderTexture();
|
||||
virtual ~RenderTexture();
|
||||
/** initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */
|
||||
/** Initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid.
|
||||
*
|
||||
* @param w The RenderTexture object width.
|
||||
* @param h The RenderTexture object height.
|
||||
* @param format In Points and a pixel format( only RGB and RGBA formats are valid ).
|
||||
* @return If successed,it will return true.
|
||||
*/
|
||||
bool initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat format);
|
||||
/** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/
|
||||
/** Initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format.
|
||||
*
|
||||
* @param w The RenderTexture object width.
|
||||
* @param h The RenderTexture object height.
|
||||
* @param format In Points and a pixel format( only RGB and RGBA formats are valid ).
|
||||
* @param depthStencilFormat The depthStencil format.
|
||||
* @return If successed,it will return true.
|
||||
*/
|
||||
bool initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat format, GLuint depthStencilFormat);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -39,7 +39,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup sprite_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@ -47,41 +47,55 @@ NS_CC_BEGIN
|
|||
class Sprite;
|
||||
|
||||
/** SpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call
|
||||
* (often known as "batch draw").
|
||||
*
|
||||
* A SpriteBatchNode can reference one and only one texture (one image file, one texture atlas).
|
||||
* Only the Sprites that are contained in that texture can be added to the SpriteBatchNode.
|
||||
* All Sprites added to a SpriteBatchNode are drawn in one OpenGL ES draw call.
|
||||
* If the Sprites are not added to a SpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.
|
||||
*
|
||||
*
|
||||
* Limitations:
|
||||
* - The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is Sprite or any subclass of Sprite. eg: particles, labels and layer can't be added to a SpriteBatchNode.
|
||||
* - Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a property of the texture, and all the sprites share the same texture.
|
||||
*
|
||||
* @since v0.7.1
|
||||
*/
|
||||
* (often known as "batch draw").
|
||||
*
|
||||
* A SpriteBatchNode can reference one and only one texture (one image file, one texture atlas).
|
||||
* Only the Sprites that are contained in that texture can be added to the SpriteBatchNode.
|
||||
* All Sprites added to a SpriteBatchNode are drawn in one OpenGL ES draw call.
|
||||
* If the Sprites are not added to a SpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.
|
||||
*
|
||||
*
|
||||
* Limitations:
|
||||
* - The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is Sprite or any subclass of Sprite. eg: particles, labels and layer can't be added to a SpriteBatchNode.
|
||||
* - Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a property of the texture, and all the sprites share the same texture.
|
||||
*
|
||||
* @since v0.7.1
|
||||
*/
|
||||
class CC_DLL SpriteBatchNode : public Node, public TextureProtocol
|
||||
{
|
||||
static const int DEFAULT_CAPACITY = 29;
|
||||
|
||||
public:
|
||||
/** creates a SpriteBatchNode with a texture2d and capacity of children.
|
||||
The capacity will be increased in 33% in runtime if it runs out of space.
|
||||
/** Creates a SpriteBatchNode with a texture2d and capacity of children.
|
||||
* The capacity will be increased in 33% in runtime if it runs out of space.
|
||||
*
|
||||
* @param tex A texture2d.
|
||||
* @param capacity The capacity of children.
|
||||
* @return Return an autorelease object.
|
||||
*/
|
||||
static SpriteBatchNode* createWithTexture(Texture2D* tex, ssize_t capacity = DEFAULT_CAPACITY);
|
||||
|
||||
/** creates a SpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children.
|
||||
The capacity will be increased in 33% in runtime if it runs out of space.
|
||||
The file will be loaded using the TextureMgr.
|
||||
/** Creates a SpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children.
|
||||
* The capacity will be increased in 33% in runtime if it runs out of space.
|
||||
* The file will be loaded using the TextureMgr.
|
||||
*
|
||||
* @param fileImage A file image (.png, .jpeg, .pvr, etc).
|
||||
* @param capacity The capacity of children.
|
||||
* @return Return an autorelease object.
|
||||
*/
|
||||
static SpriteBatchNode* create(const std::string& fileImage, ssize_t capacity = DEFAULT_CAPACITY);
|
||||
|
||||
|
||||
/** returns the TextureAtlas object */
|
||||
/** Returns the TextureAtlas object.
|
||||
*
|
||||
* @return The TextureAtlas object.
|
||||
*/
|
||||
inline TextureAtlas* getTextureAtlas() { return _textureAtlas; }
|
||||
|
||||
/** sets the TextureAtlas object */
|
||||
/** Sets the TextureAtlas object.
|
||||
*
|
||||
* @param textureAtlas The TextureAtlas object.
|
||||
*/
|
||||
inline void setTextureAtlas(TextureAtlas* textureAtlas)
|
||||
{
|
||||
if (textureAtlas != _textureAtlas)
|
||||
|
@ -92,25 +106,66 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
/** returns an array with the descendants (children, gran children, etc.).
|
||||
This is specific to BatchNode. In order to use the children, use getChildren() instead */
|
||||
/** Returns an array with the descendants (children, gran children, etc.).
|
||||
* This is specific to BatchNode. In order to use the children, use getChildren() instead.
|
||||
*
|
||||
* @return An array with the descendants (children, gran children, etc.).
|
||||
*/
|
||||
inline const std::vector<Sprite*>& getDescendants() const { return _descendants; }
|
||||
|
||||
/** Increase the Atlas Capacity. */
|
||||
void increaseAtlasCapacity();
|
||||
|
||||
/** removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.
|
||||
@warning Removing a child from a SpriteBatchNode is very slow
|
||||
*/
|
||||
/** Removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.
|
||||
*
|
||||
* @param index A certain index.
|
||||
* @param doCleanup Whether or not to cleanup the running actions.
|
||||
* @warning Removing a child from a SpriteBatchNode is very slow.
|
||||
*/
|
||||
void removeChildAtIndex(ssize_t index, bool doCleanup);
|
||||
|
||||
|
||||
/** Append the child.
|
||||
*
|
||||
* @param sprite A Sprite.
|
||||
*/
|
||||
void appendChild(Sprite* sprite);
|
||||
|
||||
/** Remove a sprite from Atlas.
|
||||
*
|
||||
* @param sprite A Sprite.
|
||||
*/
|
||||
void removeSpriteFromAtlas(Sprite *sprite);
|
||||
|
||||
|
||||
/** Rebuild index with a sprite all child.
|
||||
*
|
||||
* @param parent The parent sprite.
|
||||
* @param index The child index.
|
||||
* @return Index.
|
||||
*/
|
||||
ssize_t rebuildIndexInOrder(Sprite *parent, ssize_t index);
|
||||
|
||||
/** Get the Max image block index,in all child.
|
||||
*
|
||||
* @param sprite The parent sprite.
|
||||
* @return Index.
|
||||
*/
|
||||
ssize_t highestAtlasIndexInChild(Sprite *sprite);
|
||||
|
||||
/** Get the Min image block index,in all child.
|
||||
*
|
||||
* @param sprite The parent sprite.
|
||||
* @return Index.
|
||||
*/
|
||||
ssize_t lowestAtlasIndexInChild(Sprite *sprite);
|
||||
|
||||
/** Get the nearest index from the sprite in z.
|
||||
*
|
||||
* @param sprite The parent sprite.
|
||||
* @param z Z order for drawing priority.
|
||||
* @return Index.
|
||||
*/
|
||||
ssize_t atlasIndexForChild(Sprite *sprite, int z);
|
||||
/* Sprites use this to start sortChildren, don't call this manually */
|
||||
/* Sprites use this to start sortChildren, don't call this manually. */
|
||||
void reorderBatch(bool reorder);
|
||||
|
||||
//
|
||||
|
@ -121,9 +176,9 @@ public:
|
|||
virtual void setTexture(Texture2D *texture) override;
|
||||
/**
|
||||
*@code
|
||||
*When this function bound into js or lua,the parameter will be changed
|
||||
*In js: var setBlendFunc(var src, var dst)
|
||||
*@endcode
|
||||
* When this function bound into js or lua,the parameter will be changed.
|
||||
* In js: var setBlendFunc(var src, var dst).
|
||||
* @endcode
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void setBlendFunc(const BlendFunc &blendFunc) override;
|
||||
|
@ -147,13 +202,13 @@ public:
|
|||
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.
|
||||
This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated.
|
||||
For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)
|
||||
* This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated.
|
||||
* For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont).
|
||||
*/
|
||||
void insertQuadFromSprite(Sprite *sprite, ssize_t index);
|
||||
/* This is the opposite of "addQuadFromSprite.
|
||||
It add the sprite to the children and descendants array, but it doesn't update add it to the texture atlas
|
||||
*/
|
||||
* It add the sprite to the children and descendants array, but it doesn't update add it to the texture atlas
|
||||
*/
|
||||
SpriteBatchNode * addSpriteWithoutQuad(Sprite *child, int z, int aTag);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -202,7 +257,7 @@ protected:
|
|||
};
|
||||
|
||||
// end of sprite_nodes group
|
||||
/// @}
|
||||
/** @} */
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -38,43 +38,40 @@ class TMXTilesetInfo;
|
|||
struct _ccCArray;
|
||||
|
||||
/**
|
||||
* @addtogroup tilemap_parallax_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief TMXLayer represents the TMX layer.
|
||||
|
||||
It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas.
|
||||
If you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created.
|
||||
The benefits of using Sprite objects as tiles are:
|
||||
- tiles (Sprite) can be rotated/scaled/moved with a nice API
|
||||
|
||||
If the layer contains a property named "cc_vertexz" with an integer (in can be positive or negative),
|
||||
then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.
|
||||
|
||||
On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value.
|
||||
Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:
|
||||
|
||||
glAlphaFunc( GL_GREATER, value )
|
||||
|
||||
"value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer.
|
||||
The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different
|
||||
value, like 0.5.
|
||||
|
||||
For further information, please see the programming guide:
|
||||
|
||||
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
|
||||
|
||||
@since v0.8.1
|
||||
Tiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in TMXXMLParser.h.
|
||||
|
||||
@since 1.1
|
||||
*/
|
||||
* It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas.
|
||||
* If you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created.
|
||||
* The benefits of using Sprite objects as tiles are:
|
||||
* - tiles (Sprite) can be rotated/scaled/moved with a nice API.
|
||||
* If the layer contains a property named "cc_vertexz" with an integer (in can be positive or negative),
|
||||
* then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.
|
||||
* On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value.
|
||||
* Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:
|
||||
* glAlphaFunc( GL_GREATER, value ).
|
||||
* "value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer.
|
||||
* The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different
|
||||
* value, like 0.5.
|
||||
* For further information, please see the programming guide:
|
||||
* http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
|
||||
* @since v0.8.1
|
||||
* Tiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in TMXXMLParser.h.
|
||||
* @since 1.1
|
||||
*/
|
||||
|
||||
class CC_DLL TMXLayer : public SpriteBatchNode
|
||||
{
|
||||
public:
|
||||
/** creates a TMXLayer with an tileset info, a layer info and a map info */
|
||||
/** Creates a TMXLayer with an tileset info, a layer info and a map info.
|
||||
*
|
||||
* @param tilesetInfo An tileset info.
|
||||
* @param layerInfo A layer info.
|
||||
* @param mapInfo A map info.
|
||||
* @return An autorelease object.
|
||||
*/
|
||||
static TMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
|
||||
/**
|
||||
* @js ctor
|
||||
|
@ -86,95 +83,185 @@ public:
|
|||
*/
|
||||
virtual ~TMXLayer();
|
||||
|
||||
/** initializes a TMXLayer with a tileset info, a layer info and a map info */
|
||||
/** Initializes a TMXLayer with a tileset info, a layer info and a map info.
|
||||
*
|
||||
* @param tilesetInfo An tileset info.
|
||||
* @param layerInfo A layer info.
|
||||
* @param mapInfo A map info.
|
||||
* @return If initializes success,it will return true.
|
||||
*/
|
||||
bool initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
|
||||
|
||||
/** dealloc the map that contains the tile position from memory.
|
||||
Unless you want to know at runtime the tiles positions, you can safely call this method.
|
||||
If you are going to call layer->tileGIDAt() then, don't release the map
|
||||
*/
|
||||
/** Dealloc the map that contains the tile position from memory.
|
||||
* Unless you want to know at runtime the tiles positions, you can safely call this method.
|
||||
* If you are going to call layer->tileGIDAt() then, don't release the map.
|
||||
*/
|
||||
void releaseMap();
|
||||
|
||||
/** returns the tile (Sprite) at a given a tile coordinate.
|
||||
The returned Sprite will be already added to the TMXLayer. Don't add it again.
|
||||
The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.
|
||||
You can remove either by calling:
|
||||
- layer->removeChild(sprite, cleanup);
|
||||
- or layer->removeTileAt(Vec2(x,y));
|
||||
*/
|
||||
/** Returns the tile (Sprite) at a given a tile coordinate.
|
||||
* The returned Sprite will be already added to the TMXLayer. Don't add it again.
|
||||
* The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.
|
||||
* You can remove either by calling:
|
||||
* - layer->removeChild(sprite, cleanup);
|
||||
* - or layer->removeTileAt(Vec2(x,y));
|
||||
*
|
||||
* @param tileCoordinate A tile coordinate.
|
||||
* @return Returns the tile (Sprite) at a given a tile coordinate.
|
||||
*/
|
||||
Sprite* getTileAt(const Vec2& tileCoordinate);
|
||||
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.
|
||||
This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap])
|
||||
/** Returns the tile gid at a given tile coordinate. It also returns the tile flags.
|
||||
* This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap]).
|
||||
*
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
* @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);
|
||||
CC_DEPRECATED_ATTRIBUTE uint32_t tileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr){
|
||||
return getTileGIDAt(tileCoordinate, flags);
|
||||
};
|
||||
|
||||
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
If a tile is already placed at that position, then it will be removed.
|
||||
*/
|
||||
/** Sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
* The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
* If a tile is already placed at that position, then it will be removed.
|
||||
*
|
||||
* @param gid The tile gid.
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
*/
|
||||
void setTileGID(uint32_t gid, const Vec2& tileCoordinate);
|
||||
|
||||
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
If a tile is already placed at that position, then it will be removed.
|
||||
|
||||
Use withFlags if the tile flags need to be changed as well
|
||||
/** Sets the tile gid (gid = tile global id) at a given tile coordinate.
|
||||
* The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
||||
* If a tile is already placed at that position, then it will be removed.
|
||||
* Use withFlags if the tile flags need to be changed as well.
|
||||
*
|
||||
* @param gid The tile gid.
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
* @param flags The tile flags.
|
||||
*/
|
||||
|
||||
void setTileGID(uint32_t gid, const Vec2& tileCoordinate, TMXTileFlags flags);
|
||||
|
||||
/** removes a tile at given tile coordinate */
|
||||
/** Removes a tile at given tile coordinate.
|
||||
*
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
*/
|
||||
void removeTileAt(const Vec2& tileCoordinate);
|
||||
|
||||
/** returns the position in points of a given tile coordinate */
|
||||
/** Returns the position in points of a given tile coordinate.
|
||||
*
|
||||
* @param tileCoordinate The tile coordinate.
|
||||
* @return The position in points of a given tile coordinate.
|
||||
*/
|
||||
Vec2 getPositionAt(const Vec2& tileCoordinate);
|
||||
CC_DEPRECATED_ATTRIBUTE Vec2 positionAt(const Vec2& tileCoordinate) { return getPositionAt(tileCoordinate); };
|
||||
|
||||
/** return the value for the specific property name */
|
||||
/** Return the value for the specific property name.
|
||||
*
|
||||
* @param propertyName The specific property name.
|
||||
* @return Return the value for the specific property name.
|
||||
*/
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
CC_DEPRECATED_ATTRIBUTE Value propertyNamed(const std::string& propertyName) const { return getProperty(propertyName); };
|
||||
|
||||
/** Creates the tiles */
|
||||
/** Creates the tiles. */
|
||||
void setupTiles();
|
||||
|
||||
|
||||
/** Get the layer name.
|
||||
*
|
||||
* @return The layer name.
|
||||
*/
|
||||
inline const std::string& getLayerName(){ return _layerName; }
|
||||
|
||||
/** Set the layer name.
|
||||
*
|
||||
* @param layerName The layer name.
|
||||
*/
|
||||
inline void setLayerName(const std::string& layerName){ _layerName = layerName; }
|
||||
|
||||
/** size of the layer in tiles */
|
||||
/** Size of the layer in tiles.
|
||||
*
|
||||
* @return Size of the layer in tiles.
|
||||
*/
|
||||
inline const Size& getLayerSize() const { return _layerSize; };
|
||||
|
||||
/** Set size of the layer in tiles.
|
||||
*
|
||||
* @param size Size of the layer in tiles.
|
||||
*/
|
||||
inline void setLayerSize(const Size& size) { _layerSize = size; };
|
||||
|
||||
/** size of the map's tile (could be different from the tile's size) */
|
||||
/** Size of the map's tile (could be different from the tile's size).
|
||||
*
|
||||
* @return The size of the map's tile.
|
||||
*/
|
||||
inline const Size& getMapTileSize() const { return _mapTileSize; };
|
||||
|
||||
/** Set the size of the map's tile.
|
||||
*
|
||||
* @param size The size of the map's tile.
|
||||
*/
|
||||
inline void setMapTileSize(const Size& size) { _mapTileSize = size; };
|
||||
|
||||
/** pointer to the map of tiles
|
||||
/** Pointer to the map of tiles.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
* @return Pointer to the map of tiles.
|
||||
*/
|
||||
uint32_t* getTiles() const { return _tiles; };
|
||||
|
||||
/** Set a pointer to the map of tiles.
|
||||
*
|
||||
* @param tiles A pointer to the map of tiles.
|
||||
*/
|
||||
void setTiles(uint32_t* tiles) { _tiles = tiles; };
|
||||
|
||||
/** Tileset information for the layer */
|
||||
/** Tileset information for the layer.
|
||||
*
|
||||
* @return Tileset information for the layer.
|
||||
*/
|
||||
inline TMXTilesetInfo* getTileSet() const { return _tileSet; };
|
||||
|
||||
/** Set tileset information for the layer.
|
||||
*
|
||||
* @param The tileset information for the layer.
|
||||
*/
|
||||
inline void setTileSet(TMXTilesetInfo* info) {
|
||||
CC_SAFE_RETAIN(info);
|
||||
CC_SAFE_RELEASE(_tileSet);
|
||||
_tileSet = info;
|
||||
};
|
||||
|
||||
/** Layer orientation, which is the same as the map orientation */
|
||||
/** Layer orientation, which is the same as the map orientation.
|
||||
*
|
||||
* @return Layer orientation, which is the same as the map orientation.
|
||||
*/
|
||||
inline int getLayerOrientation() const { return _layerOrientation; };
|
||||
|
||||
/** Set layer orientation, which is the same as the map orientation.
|
||||
*
|
||||
* @param orientation Layer orientation,which is the same as the map orientation.
|
||||
*/
|
||||
inline void setLayerOrientation(int orientation) { _layerOrientation = orientation; };
|
||||
|
||||
/** properties from the layer. They can be added using Tiled */
|
||||
/** Properties from the layer. They can be added using Tiled.
|
||||
*
|
||||
* @return Properties from the layer. They can be added using Tiled.
|
||||
*/
|
||||
inline const ValueMap& getProperties() const { return _properties; };
|
||||
|
||||
/** Properties from the layer. They can be added using Tiled.
|
||||
*
|
||||
* @return Properties from the layer. They can be added using Tiled.
|
||||
*/
|
||||
inline ValueMap& getProperties() { return _properties; };
|
||||
|
||||
/** Set an Properties from to layer.
|
||||
*
|
||||
* @param properties It is used to set the layer Properties.
|
||||
*/
|
||||
inline void setProperties(const ValueMap& properties) {
|
||||
_properties = properties;
|
||||
};
|
||||
|
@ -244,7 +331,7 @@ protected:
|
|||
};
|
||||
|
||||
// end of tilemap_parallax_nodes group
|
||||
/// @}
|
||||
/** @} */
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -35,13 +35,13 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup tilemap_parallax_nodes
|
||||
* @addtogroup _2d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief TMXObjectGroup represents the TMX object group.
|
||||
@since v0.99.0
|
||||
*/
|
||||
* @since v0.99.0
|
||||
*/
|
||||
class CC_DLL TMXObjectGroup : public Ref
|
||||
{
|
||||
public:
|
||||
|
@ -54,42 +54,75 @@ public:
|
|||
* @lua NA
|
||||
*/
|
||||
virtual ~TMXObjectGroup();
|
||||
|
||||
|
||||
/** Get the group name.
|
||||
*
|
||||
* @return The group name.
|
||||
*/
|
||||
inline const std::string& getGroupName() const { return _groupName; }
|
||||
|
||||
/** Set the group name.
|
||||
*
|
||||
* @param groupname A string,it is used to set the group name.
|
||||
*/
|
||||
inline void setGroupName(const std::string& groupName){ _groupName = groupName; }
|
||||
|
||||
/** return the value for the specific property name */
|
||||
/** Return the value for the specific property name.
|
||||
*
|
||||
* @param propertyName The specific property name.
|
||||
* @return Return the value for the specific property name.
|
||||
*/
|
||||
Value getProperty(const std::string& propertyName) const;
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE Value propertyNamed(const std::string& propertyName) const { return getProperty(propertyName); };
|
||||
|
||||
/** return the dictionary for the specific object name.
|
||||
It will return the 1st object found on the array for the given name.
|
||||
*/
|
||||
/** Return the dictionary for the specific object name.
|
||||
* It will return the 1st object found on the array for the given name.
|
||||
*
|
||||
* @return Return the dictionary for the specific object name.
|
||||
*/
|
||||
ValueMap getObject(const std::string& objectName) const;
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE ValueMap objectNamed(const std::string& objectName) const { return getObject(objectName); };
|
||||
|
||||
/** Gets the offset position of child objects */
|
||||
/** Gets the offset position of child objects.
|
||||
*
|
||||
* @return The offset position of child objects.
|
||||
*/
|
||||
inline const Vec2& getPositionOffset() const { return _positionOffset; };
|
||||
|
||||
/** Sets the offset position of child objects */
|
||||
/** Sets the offset position of child objects.
|
||||
*
|
||||
* @param offset The offset position of child objects.
|
||||
*/
|
||||
inline void setPositionOffset(const Vec2& offset) { _positionOffset = offset; };
|
||||
|
||||
/** Gets the list of properties stored in a dictionary */
|
||||
/** Gets the list of properties stored in a dictionary.
|
||||
*
|
||||
* @return The list of properties stored in a dictionary.
|
||||
*/
|
||||
inline const ValueMap& getProperties() const { return _properties; };
|
||||
inline ValueMap& getProperties() { return _properties; };
|
||||
|
||||
/** Sets the list of properties */
|
||||
/** Sets the list of properties.
|
||||
*
|
||||
* @param properties The list of properties.
|
||||
*/
|
||||
inline void setProperties(const ValueMap& properties) {
|
||||
_properties = properties;
|
||||
};
|
||||
|
||||
/** Gets the array of the objects */
|
||||
/** Gets the array of the objects.
|
||||
*
|
||||
* @return The array of the objects.
|
||||
*/
|
||||
inline const ValueVector& getObjects() const { return _objects; };
|
||||
inline ValueVector& getObjects() { return _objects; };
|
||||
|
||||
/** Sets the array of the objects */
|
||||
/** Sets the array of the objects.
|
||||
*
|
||||
* @param objects The array of the objects.
|
||||
*/
|
||||
inline void setObjects(const ValueVector& objects) {
|
||||
_objects = objects;
|
||||
};
|
||||
|
@ -106,7 +139,7 @@ protected:
|
|||
};
|
||||
|
||||
// end of tilemap_parallax_nodes group
|
||||
/// @}
|
||||
/** @} */
|
||||
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -45,26 +45,33 @@ class ActionInterval;
|
|||
class Node;
|
||||
class NodeGrid;
|
||||
|
||||
/** @brief TransitionEaseScene can ease the actions of the scene protocol.
|
||||
/** @class TransitionEaseScene
|
||||
* @brief TransitionEaseScene can ease the actions of the scene protocol.
|
||||
@since v0.8.2
|
||||
*/
|
||||
class CC_DLL TransitionEaseScene// : public Ref
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
*/
|
||||
virtual ~TransitionEaseScene() {}
|
||||
|
||||
/** returns the Ease action that will be performed on a linear action.
|
||||
/** Returns the Ease action that will be performed on a linear action.
|
||||
@since v0.8.2
|
||||
*/
|
||||
*
|
||||
* @param action A given interval action.
|
||||
* @return The Ease action that will be performed on a linear action.
|
||||
*/
|
||||
virtual ActionInterval * easeActionWithAction(ActionInterval * action) = 0;
|
||||
};
|
||||
|
||||
/** @brief Base class for Transition scenes
|
||||
/** @class TransitionScene
|
||||
* @brief Base class for Transition scenes.
|
||||
*/
|
||||
class CC_DLL TransitionScene : public Scene
|
||||
{
|
||||
public:
|
||||
/** Orientation Type used by some transitions
|
||||
/** Orientation Type used by some transitions.
|
||||
*/
|
||||
enum class Orientation
|
||||
{
|
||||
|
@ -78,13 +85,20 @@ public:
|
|||
DOWN_OVER = 1,
|
||||
};
|
||||
|
||||
/** creates a base transition with duration and incoming scene */
|
||||
/** Creates a base transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionScene object.
|
||||
*/
|
||||
static TransitionScene * create(float t, Scene *scene);
|
||||
|
||||
/** called after the transition finishes */
|
||||
/** Called after the transition finishes.
|
||||
*/
|
||||
void finish(void);
|
||||
|
||||
/** used by some transitions to hide the outer scene */
|
||||
/** Used by some transitions to hide the outer scene.
|
||||
*/
|
||||
void hideOutShowIn(void);
|
||||
|
||||
//
|
||||
|
@ -116,13 +130,20 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene);
|
||||
};
|
||||
|
||||
/** @brief A Transition that supports orientation like.
|
||||
* Possible orientation: LeftOver, RightOver, UpOver, DownOver
|
||||
*/
|
||||
/** @class TransitionSceneOriented
|
||||
* @brief A Transition that supports orientation like.
|
||||
* Possible orientation: LeftOver, RightOver, UpOver, DownOver
|
||||
*/
|
||||
class CC_DLL TransitionSceneOriented : public TransitionScene
|
||||
{
|
||||
public:
|
||||
/** creates a base transition with duration and incoming scene */
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @param orientation A given orientation: LeftOver, RightOver, UpOver, DownOver.
|
||||
* @return A autoreleased TransitionSceneOriented object.
|
||||
*/
|
||||
static TransitionSceneOriented * create(float t,Scene* scene, Orientation orientation);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -139,12 +160,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented);
|
||||
};
|
||||
|
||||
/** @brief TransitionRotoZoom:
|
||||
/** @class TransitionRotoZoom
|
||||
* @brief TransitionRotoZoom:
|
||||
Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming
|
||||
*/
|
||||
class CC_DLL TransitionRotoZoom : public TransitionScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionRotoZoom object.
|
||||
*/
|
||||
static TransitionRotoZoom* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -161,12 +189,19 @@ private:
|
|||
|
||||
};
|
||||
|
||||
/** @brief TransitionJumpZoom:
|
||||
/** @class TransitionJumpZoom
|
||||
* @brief TransitionJumpZoom:
|
||||
Zoom out and jump the outgoing scene, and then jump and zoom in the incoming
|
||||
*/
|
||||
class CC_DLL TransitionJumpZoom : public TransitionScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionJumpZoom object.
|
||||
*/
|
||||
static TransitionJumpZoom* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -182,15 +217,25 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom);
|
||||
};
|
||||
|
||||
/** @brief TransitionMoveInL:
|
||||
/** @class TransitionMoveInL
|
||||
* @brief TransitionMoveInL:
|
||||
Move in from to the left the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionMoveInL object.
|
||||
*/
|
||||
static TransitionMoveInL* create(float t, Scene* scene);
|
||||
|
||||
/** returns the action that will be performed */
|
||||
/** Returns the action that will be performed.
|
||||
*
|
||||
* @return The action that will be performed.
|
||||
*/
|
||||
virtual ActionInterval* action(void);
|
||||
|
||||
virtual ActionInterval* easeActionWithAction(ActionInterval * action) override;
|
||||
|
@ -212,12 +257,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL);
|
||||
};
|
||||
|
||||
/** @brief TransitionMoveInR:
|
||||
/** @class TransitionMoveInR
|
||||
* @brief TransitionMoveInR:
|
||||
Move in from to the right the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionMoveInR : public TransitionMoveInL
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionMoveInR object.
|
||||
*/
|
||||
static TransitionMoveInR* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -231,12 +283,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR);
|
||||
};
|
||||
|
||||
/** @brief TransitionMoveInT:
|
||||
/** @class TransitionMoveInT
|
||||
* @brief TransitionMoveInT:
|
||||
Move in from to the top the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionMoveInT : public TransitionMoveInL
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionMoveInT object.
|
||||
*/
|
||||
static TransitionMoveInT* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -250,12 +309,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT);
|
||||
};
|
||||
|
||||
/** @brief TransitionMoveInB:
|
||||
/** @class TransitionMoveInB
|
||||
* @brief TransitionMoveInB:
|
||||
Move in from to the bottom the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionMoveInB : public TransitionMoveInL
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionMoveInB object.
|
||||
*/
|
||||
static TransitionMoveInB* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -269,17 +335,27 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB);
|
||||
};
|
||||
|
||||
/** @brief TransitionSlideInL:
|
||||
/** @class TransitionSlideInL
|
||||
* @brief TransitionSlideInL:
|
||||
Slide in the incoming scene from the left border.
|
||||
*/
|
||||
class CC_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionSlideInL object.
|
||||
*/
|
||||
static TransitionSlideInL* create(float t, Scene* scene);
|
||||
|
||||
virtual ActionInterval* easeActionWithAction(ActionInterval * action) override;
|
||||
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
/** Returns the action that will be performed by the incoming and outgoing scene.
|
||||
*
|
||||
* @return The action that will be performed by the incoming and outgoing scene.
|
||||
*/
|
||||
virtual ActionInterval* action(void);
|
||||
|
||||
//
|
||||
|
@ -301,15 +377,22 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL);
|
||||
};
|
||||
|
||||
/** @brief TransitionSlideInR:
|
||||
/** @class TransitionSlideInR
|
||||
*@brief TransitionSlideInR:
|
||||
Slide in the incoming scene from the right border.
|
||||
*/
|
||||
class CC_DLL TransitionSlideInR : public TransitionSlideInL
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionSlideInR object.
|
||||
*/
|
||||
static TransitionSlideInR* create(float t, Scene* scene);
|
||||
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
/** Returns the action that will be performed by the incoming and outgoing scene. */
|
||||
virtual ActionInterval* action(void) override;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -326,12 +409,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR);
|
||||
};
|
||||
|
||||
/** @brief TransitionSlideInB:
|
||||
/** @class TransitionSlideInB
|
||||
* @brief TransitionSlideInB:
|
||||
Slide in the incoming scene from the bottom border.
|
||||
*/
|
||||
class CC_DLL TransitionSlideInB : public TransitionSlideInL
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionSlideInB object.
|
||||
*/
|
||||
static TransitionSlideInB* create(float t, Scene* scene);
|
||||
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
|
@ -351,12 +441,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB);
|
||||
};
|
||||
|
||||
/** @brief TransitionSlideInT:
|
||||
/** @class TransitionSlideInT
|
||||
* @brief TransitionSlideInT:
|
||||
Slide in the incoming scene from the top border.
|
||||
*/
|
||||
class CC_DLL TransitionSlideInT : public TransitionSlideInL
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionSlideInT object.
|
||||
*/
|
||||
static TransitionSlideInT* create(float t, Scene* scene);
|
||||
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
|
@ -376,12 +473,18 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT);
|
||||
};
|
||||
|
||||
/**
|
||||
@brief Shrink the outgoing scene while grow the incoming scene
|
||||
/** @class TransitionShrinkGrow
|
||||
* @brief Shrink the outgoing scene while grow the incoming scene
|
||||
*/
|
||||
class CC_DLL TransitionShrinkGrow : public TransitionScene , public TransitionEaseScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionShrinkGrow object.
|
||||
*/
|
||||
static TransitionShrinkGrow* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -402,14 +505,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow);
|
||||
};
|
||||
|
||||
/** @brief TransitionFlipX:
|
||||
/** @class TransitionFlipX
|
||||
* @brief TransitionFlipX:
|
||||
Flips the screen horizontally.
|
||||
The front face is the outgoing scene and the back face is the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionFlipX : public TransitionSceneOriented
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @param o A given orientation.
|
||||
* @return A autoreleased TransitionFlipX object.
|
||||
*/
|
||||
static TransitionFlipX* create(float t, Scene* s, Orientation o);
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @return A autoreleased TransitionFlipX object.
|
||||
*/
|
||||
static TransitionFlipX* create(float t, Scene* s);
|
||||
|
||||
//
|
||||
|
@ -429,14 +546,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX);
|
||||
};
|
||||
|
||||
/** @brief TransitionFlipY:
|
||||
/** @class TransitionFlipY
|
||||
* @brief TransitionFlipY:
|
||||
Flips the screen vertically.
|
||||
The front face is the outgoing scene and the back face is the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionFlipY : public TransitionSceneOriented
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @param o A given orientation.
|
||||
* @return A autoreleased TransitionFlipY object.
|
||||
*/
|
||||
static TransitionFlipY* create(float t, Scene* s, Orientation o);
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @return A autoreleased TransitionFlipY object.
|
||||
*/
|
||||
static TransitionFlipY* create(float t, Scene* s);
|
||||
|
||||
//
|
||||
|
@ -456,14 +587,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY);
|
||||
};
|
||||
|
||||
/** @brief TransitionFlipAngular:
|
||||
/** @class TransitionFlipAngular
|
||||
* @brief TransitionFlipAngular:
|
||||
Flips the screen half horizontally and half vertically.
|
||||
The front face is the outgoing scene and the back face is the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionFlipAngular : public TransitionSceneOriented
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @param o A given orientation.
|
||||
* @return A autoreleased TransitionFlipAngular object.
|
||||
*/
|
||||
static TransitionFlipAngular* create(float t, Scene* s, Orientation o);
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @return A autoreleased TransitionFlipAngular object.
|
||||
*/
|
||||
static TransitionFlipAngular* create(float t, Scene* s);
|
||||
|
||||
//
|
||||
|
@ -483,14 +628,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular);
|
||||
};
|
||||
|
||||
/** @brief TransitionZoomFlipX:
|
||||
/** @class TransitionZoomFlipX
|
||||
* @brief TransitionZoomFlipX:
|
||||
Flips the screen horizontally doing a zoom out/in
|
||||
The front face is the outgoing scene and the back face is the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionZoomFlipX : public TransitionSceneOriented
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @param o A given orientation.
|
||||
* @return A autoreleased TransitionZoomFlipX object.
|
||||
*/
|
||||
static TransitionZoomFlipX* create(float t, Scene* s, Orientation o);
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @return A autoreleased TransitionZoomFlipX object.
|
||||
*/
|
||||
static TransitionZoomFlipX* create(float t, Scene* s);
|
||||
|
||||
//
|
||||
|
@ -510,14 +669,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX);
|
||||
};
|
||||
|
||||
/** @brief TransitionZoomFlipY:
|
||||
/** @class TransitionZoomFlipY
|
||||
* @brief TransitionZoomFlipY:
|
||||
Flips the screen vertically doing a little zooming out/in
|
||||
The front face is the outgoing scene and the back face is the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionZoomFlipY : public TransitionSceneOriented
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @param o A given orientation.
|
||||
* @return A autoreleased TransitionZoomFlipY object.
|
||||
*/
|
||||
static TransitionZoomFlipY* create(float t, Scene* s, Orientation o);
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @return A autoreleased TransitionZoomFlipY object.
|
||||
*/
|
||||
static TransitionZoomFlipY* create(float t, Scene* s);
|
||||
|
||||
//
|
||||
|
@ -537,14 +710,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY);
|
||||
};
|
||||
|
||||
/** @brief TransitionZoomFlipAngular:
|
||||
/** @class TransitionZoomFlipAngular
|
||||
* @brief TransitionZoomFlipAngular:
|
||||
Flips the screen half horizontally and half vertically doing a little zooming out/in.
|
||||
The front face is the outgoing scene and the back face is the incoming scene.
|
||||
*/
|
||||
class CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration, incoming scene and orientation.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @param o A given orientation.
|
||||
* @return A autoreleased TransitionZoomFlipAngular object.
|
||||
*/
|
||||
static TransitionZoomFlipAngular* create(float t, Scene* s, Orientation o);
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param s A given scene.
|
||||
* @return A autoreleased TransitionZoomFlipAngular object.
|
||||
*/
|
||||
static TransitionZoomFlipAngular* create(float t, Scene* s);
|
||||
|
||||
//
|
||||
|
@ -564,16 +751,28 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular);
|
||||
};
|
||||
|
||||
/** @brief TransitionFade:
|
||||
/** @class TransitionFade
|
||||
* @brief TransitionFade:
|
||||
Fade out the outgoing scene and then fade in the incoming scene.'''
|
||||
*/
|
||||
class CC_DLL TransitionFade : public TransitionScene
|
||||
{
|
||||
public:
|
||||
/** creates the transition with a duration and with an RGB color
|
||||
* Example: FadeTransition::create(2, scene, Color3B(255,0,0); // red color
|
||||
*/
|
||||
/** Creates the transition with a duration and with an RGB color
|
||||
* Example: FadeTransition::create(2, scene, Color3B(255,0,0); // red color
|
||||
*
|
||||
* @param duration Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @param color A given transition color.
|
||||
* @return A autoreleased TransitionFade object.
|
||||
*/
|
||||
static TransitionFade* create(float duration, Scene* scene, const Color3B& color);
|
||||
/** Creates the transition with a duration.
|
||||
*
|
||||
* @param duration Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionFade object.
|
||||
*/
|
||||
static TransitionFade* create(float duration, Scene* scene);
|
||||
|
||||
/**
|
||||
|
@ -604,13 +803,19 @@ private:
|
|||
};
|
||||
|
||||
class RenderTexture;
|
||||
/**
|
||||
/** @class TransitionCrossFade
|
||||
@brief TransitionCrossFade:
|
||||
Cross fades two scenes using the RenderTexture object.
|
||||
*/
|
||||
class CC_DLL TransitionCrossFade : public TransitionScene
|
||||
{
|
||||
public :
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionCrossFade object.
|
||||
*/
|
||||
static TransitionCrossFade* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -640,12 +845,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade);
|
||||
};
|
||||
|
||||
/** @brief TransitionTurnOffTiles:
|
||||
/** @class TransitionTurnOffTiles
|
||||
* @brief TransitionTurnOffTiles:
|
||||
Turn off the tiles of the outgoing scene in random order
|
||||
*/
|
||||
class CC_DLL TransitionTurnOffTiles : public TransitionScene ,public TransitionEaseScene
|
||||
{
|
||||
public :
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionTurnOffTiles object.
|
||||
*/
|
||||
static TransitionTurnOffTiles* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -672,14 +884,25 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles);
|
||||
};
|
||||
|
||||
/** @brief TransitionSplitCols:
|
||||
/** @class TransitionSplitCols
|
||||
* @brief TransitionSplitCols:
|
||||
The odd columns goes upwards while the even columns goes downwards.
|
||||
*/
|
||||
class CC_DLL TransitionSplitCols : public TransitionScene , public TransitionEaseScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionSplitCols object.
|
||||
*/
|
||||
static TransitionSplitCols* create(float t, Scene* scene);
|
||||
|
||||
/** Returns the action that will be performed.
|
||||
*
|
||||
* @return The action that will be performed.
|
||||
*/
|
||||
virtual ActionInterval* action();
|
||||
|
||||
//
|
||||
|
@ -705,12 +928,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols);
|
||||
};
|
||||
|
||||
/** @brief TransitionSplitRows:
|
||||
/** @class TransitionSplitRows
|
||||
* @brief TransitionSplitRows:
|
||||
The odd rows goes to the left while the even rows goes to the right.
|
||||
*/
|
||||
class CC_DLL TransitionSplitRows : public TransitionSplitCols
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionSplitRows object.
|
||||
*/
|
||||
static TransitionSplitRows* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -726,14 +956,26 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows);
|
||||
};
|
||||
|
||||
/** @brief TransitionFadeTR:
|
||||
/** @class TransitionFadeTR
|
||||
* @brief TransitionFadeTR:
|
||||
Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
|
||||
*/
|
||||
class CC_DLL TransitionFadeTR : public TransitionScene , public TransitionEaseScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionFadeTR object.
|
||||
*/
|
||||
static TransitionFadeTR* create(float t, Scene* scene);
|
||||
|
||||
/** Returns the action that will be performed with size.
|
||||
*
|
||||
* @param size A given size.
|
||||
* @return The action that will be performed.
|
||||
*/
|
||||
virtual ActionInterval* actionWithSize(const Size& size);
|
||||
|
||||
//
|
||||
|
@ -761,12 +1003,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR);
|
||||
};
|
||||
|
||||
/** @brief TransitionFadeBL:
|
||||
/** @class TransitionFadeBL
|
||||
* @brief TransitionFadeBL:
|
||||
Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
|
||||
*/
|
||||
class CC_DLL TransitionFadeBL : public TransitionFadeTR
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionFadeBL object.
|
||||
*/
|
||||
static TransitionFadeBL* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -782,12 +1031,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL);
|
||||
};
|
||||
|
||||
/** @brief TransitionFadeUp:
|
||||
/** @class TransitionFadeUp
|
||||
* @brief TransitionFadeUp:
|
||||
* Fade the tiles of the outgoing scene from the bottom to the top.
|
||||
*/
|
||||
class CC_DLL TransitionFadeUp : public TransitionFadeTR
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionFadeUp object.
|
||||
*/
|
||||
static TransitionFadeUp* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -803,12 +1059,19 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp);
|
||||
};
|
||||
|
||||
/** @brief TransitionFadeDown:
|
||||
/** @class TransitionFadeDown
|
||||
* @brief TransitionFadeDown:
|
||||
* Fade the tiles of the outgoing scene from the top to the bottom.
|
||||
*/
|
||||
class CC_DLL TransitionFadeDown : public TransitionFadeTR
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return A autoreleased TransitionFadeDown object.
|
||||
*/
|
||||
static TransitionFadeDown* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
|
|
@ -39,8 +39,8 @@ class NodeGrid;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
@brief A transition which peels back the bottom right hand corner of a scene
|
||||
/** @class TransitionPageTurn
|
||||
* @brief A transition which peels back the bottom right hand corner of a scene
|
||||
to transition to the scene beneath it simulating a page turn.
|
||||
|
||||
This uses a 3DAction so it's strongly recommended that depth buffering
|
||||
|
@ -57,6 +57,11 @@ public:
|
|||
* Creates a base transition with duration and incoming scene.
|
||||
* If back is true then the effect is reversed to appear as if the incoming
|
||||
* scene is being turned from left over the outgoing scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @param backwards If back is true then the effect is reversed to appear as if the incoming scene is being turned from left over the outgoing scene.
|
||||
* @return An autoreleased TransitionPageTurn object.
|
||||
*/
|
||||
static TransitionPageTurn* create(float t,Scene* scene,bool backwards);
|
||||
|
||||
|
@ -66,12 +71,22 @@ public:
|
|||
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
||||
|
||||
/**
|
||||
* Creates a base transition with duration and incoming scene.
|
||||
* If back is true then the effect is reversed to appear as if the incoming
|
||||
* scene is being turned from left over the outgoing scene.
|
||||
*/
|
||||
* Creates a base transition with duration and incoming scene.
|
||||
* If back is true then the effect is reversed to appear as if the incoming
|
||||
* scene is being turned from left over the outgoing scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @param backwards If back is true then the effect is reversed to appear as if the incoming scene is being turned from left over the outgoing scene.
|
||||
* @return True if initialize success.
|
||||
*/
|
||||
bool initWithDuration(float t,Scene* scene,bool backwards);
|
||||
|
||||
/** Returns the action that will be performed with size.
|
||||
*
|
||||
* @param size A given size.
|
||||
* @return The action that will be performed.
|
||||
*/
|
||||
ActionInterval* actionWithSize(const Size& vector);
|
||||
|
||||
//
|
||||
|
|
|
@ -39,9 +39,18 @@ class RenderTexture;
|
|||
* @addtogroup transition
|
||||
* @{
|
||||
*/
|
||||
/** @class TransitionProgress
|
||||
* @brief A base class of progress transition.
|
||||
*/
|
||||
class CC_DLL TransitionProgress : public TransitionScene
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgress object.
|
||||
*/
|
||||
static TransitionProgress* create(float t, Scene* scene);
|
||||
|
||||
//
|
||||
|
@ -68,12 +77,19 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
/** TransitionRadialCCW transition.
|
||||
/** @class TransitionProgressRadialCCW
|
||||
* @brief TransitionRadialCCW transition.
|
||||
A counter clock-wise radial transition to the next scene
|
||||
*/
|
||||
class CC_DLL TransitionProgressRadialCCW : public TransitionProgress
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgressRadialCCW object.
|
||||
*/
|
||||
static TransitionProgressRadialCCW* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -92,12 +108,19 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
/** TransitionRadialCW transition.
|
||||
A counter clock-wise radial transition to the next scene
|
||||
/** @class TransitionProgressRadialCW
|
||||
* @brief TransitionRadialCW transition.
|
||||
A counter clock-wise radial transition to the next scene.
|
||||
*/
|
||||
class CC_DLL TransitionProgressRadialCW : public TransitionProgress
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgressRadialCW object.
|
||||
*/
|
||||
static TransitionProgressRadialCW* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -115,12 +138,19 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
/** TransitionProgressHorizontal transition.
|
||||
/** @class TransitionProgressHorizontal
|
||||
* @brief TransitionProgressHorizontal transition.
|
||||
A clock-wise radial transition to the next scene
|
||||
*/
|
||||
class CC_DLL TransitionProgressHorizontal : public TransitionProgress
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgressHorizontal object.
|
||||
*/
|
||||
static TransitionProgressHorizontal* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -137,9 +167,18 @@ protected:
|
|||
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
||||
};
|
||||
|
||||
/** @class TransitionProgressVertical
|
||||
* @brief TransitionProgressVertical transition.
|
||||
*/
|
||||
class CC_DLL TransitionProgressVertical : public TransitionProgress
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgressVertical object.
|
||||
*/
|
||||
static TransitionProgressVertical* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -156,9 +195,18 @@ protected:
|
|||
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
||||
};
|
||||
|
||||
/** @class TransitionProgressInOut
|
||||
* @brief TransitionProgressInOut transition.
|
||||
*/
|
||||
class CC_DLL TransitionProgressInOut : public TransitionProgress
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgressInOut object.
|
||||
*/
|
||||
static TransitionProgressInOut* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -177,9 +225,18 @@ protected:
|
|||
virtual void setupTransition() override;
|
||||
};
|
||||
|
||||
/** @class TransitionProgressOutIn
|
||||
* @brief TransitionProgressOutIn transition.
|
||||
*/
|
||||
class CC_DLL TransitionProgressOutIn : public TransitionProgress
|
||||
{
|
||||
public:
|
||||
/** Creates a transition with duration and incoming scene.
|
||||
*
|
||||
* @param t Duration time, in seconds.
|
||||
* @param scene A given scene.
|
||||
* @return An autoreleased TransitionProgressOutIn object.
|
||||
*/
|
||||
static TransitionProgressOutIn* create(float t, Scene* scene);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* Axis Aligned Bounding Box (AABB), usually caculate some rough but fast collision detection.
|
||||
*/
|
||||
class CC_DLL AABB
|
||||
{
|
||||
|
||||
|
@ -90,10 +93,13 @@ public:
|
|||
void set(const Vec3& min, const Vec3& max);
|
||||
|
||||
/**
|
||||
* reset min and max value.
|
||||
* Reset min and max value.If you invoke this method, isEmpty() shall return true.
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* check the AABB object is empty(reset).
|
||||
*/
|
||||
bool isEmpty() const;
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,6 +48,7 @@ public:
|
|||
*/
|
||||
static AttachNode* create(Bone3D* attachBone);
|
||||
|
||||
//override
|
||||
virtual Mat4 getWorldToNodeTransform() const override;
|
||||
virtual Mat4 getNodeToWorldTransform() const override;
|
||||
virtual const Mat4& getNodeToParentTransform() const override;
|
||||
|
|
|
@ -102,6 +102,9 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* calculate a model matrix which keep orignal translate & scaling but always face to the camera
|
||||
*/
|
||||
bool calculateBillbaordTransform();
|
||||
|
||||
Mat4 _camWorldMat;
|
||||
|
|
|
@ -42,7 +42,9 @@ class Data;
|
|||
class CC_DLL Bundle3D
|
||||
{
|
||||
public:
|
||||
// create a new bundle, destroy it when finish using it
|
||||
/**
|
||||
* create a new bundle, destroy it when finish using it
|
||||
*/
|
||||
static Bundle3D* createBundle();
|
||||
|
||||
static void destroyBundle(Bundle3D* bundle);
|
||||
|
|
|
@ -129,6 +129,10 @@ struct MeshData
|
|||
int attribCount;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Get per vertex size
|
||||
* @return return the sum of each vertex's all attribute size.
|
||||
*/
|
||||
int getPerVertexSize() const
|
||||
{
|
||||
int vertexsize = 0;
|
||||
|
@ -138,6 +142,10 @@ public:
|
|||
}
|
||||
return vertexsize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the data
|
||||
*/
|
||||
void resetData()
|
||||
{
|
||||
vertex.clear();
|
||||
|
|
|
@ -109,6 +109,11 @@ public:
|
|||
* first read length, then read string text
|
||||
*/
|
||||
std::string readString();
|
||||
|
||||
/**
|
||||
* Read the matrix.
|
||||
* @note the matrix type must be the 4*4 float matrix
|
||||
*/
|
||||
bool readMatrix(float* m);
|
||||
|
||||
private:
|
||||
|
|
|
@ -34,6 +34,11 @@
|
|||
NS_CC_BEGIN
|
||||
|
||||
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
|
||||
*/
|
||||
class CC_DLL Frustum
|
||||
{
|
||||
friend class Camera;
|
||||
|
|
|
@ -196,7 +196,7 @@ void Mesh::setSkin(MeshSkin* skin)
|
|||
CC_SAFE_RETAIN(skin);
|
||||
CC_SAFE_RELEASE(_skin);
|
||||
_skin = skin;
|
||||
calcuateAABB();
|
||||
calculateAABB();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ void Mesh::setMeshIndexData(MeshIndexData* subMesh)
|
|||
CC_SAFE_RETAIN(subMesh);
|
||||
CC_SAFE_RELEASE(_meshIndexData);
|
||||
_meshIndexData = subMesh;
|
||||
calcuateAABB();
|
||||
calculateAABB();
|
||||
bindMeshCommand();
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ void Mesh::setGLProgramState(GLProgramState* glProgramState)
|
|||
}
|
||||
}
|
||||
|
||||
void Mesh::calcuateAABB()
|
||||
void Mesh::calculateAABB()
|
||||
{
|
||||
if (_meshIndexData)
|
||||
{
|
||||
|
|
|
@ -110,11 +110,20 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
|
||||
Mesh();
|
||||
virtual ~Mesh();
|
||||
|
||||
|
||||
/**
|
||||
* Get the default GL program.
|
||||
*/
|
||||
GLProgram* getDefaultGLProgram(bool textured);
|
||||
|
||||
/**
|
||||
* Set the default GL program.
|
||||
*/
|
||||
void setGLProgramState(GLProgramState* glProgramState);
|
||||
|
||||
/**
|
||||
* Get the MeshCommand.
|
||||
*/
|
||||
MeshCommand& getMeshCommand() { return _meshCommand; }
|
||||
|
||||
/**skin setter*/
|
||||
|
@ -124,8 +133,15 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
/**name setter*/
|
||||
void setName(const std::string& name) { _name = name; }
|
||||
|
||||
void calcuateAABB();
|
||||
/**
|
||||
* calculate the AABB of the mesh
|
||||
* @note the AABB is in the local space, not the world space
|
||||
*/
|
||||
void calculateAABB();
|
||||
|
||||
/**
|
||||
* Bind to the MeshCommand
|
||||
*/
|
||||
void bindMeshCommand();
|
||||
protected:
|
||||
Texture2D* _texture; //texture that submesh is using
|
||||
|
|
|
@ -43,6 +43,10 @@ NS_CC_BEGIN
|
|||
|
||||
class MeshVertexData;
|
||||
|
||||
/**
|
||||
* the MeshIndexData class.
|
||||
* @brief the MeshIndexData contain all of the indices data which mesh need.
|
||||
*/
|
||||
class MeshIndexData : public Ref
|
||||
{
|
||||
public:
|
||||
|
@ -84,6 +88,10 @@ protected:
|
|||
friend class Sprite3D;
|
||||
};
|
||||
|
||||
/**
|
||||
* the MeshVertexData class.
|
||||
* @brief the MeshIndexData contain all of the vertices data which mesh need.
|
||||
*/
|
||||
class MeshVertexData : public Ref
|
||||
{
|
||||
friend class Sprite3D;
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
class CC_DLL OBB
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -16,9 +16,16 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* .obj file Loader
|
||||
**/
|
||||
class ObjLoader
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* model's material struct
|
||||
**/
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
|
@ -41,11 +48,17 @@ public:
|
|||
std::map<std::string, std::string> unknown_parameter;
|
||||
} material_t;
|
||||
|
||||
/**
|
||||
* model's indices struct
|
||||
**/
|
||||
typedef struct
|
||||
{
|
||||
std::vector<unsigned short> indices;
|
||||
} mesh_t;
|
||||
|
||||
/**
|
||||
* model's shape struct
|
||||
**/
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
|
@ -53,6 +66,9 @@ public:
|
|||
mesh_t mesh;
|
||||
} shape_t;
|
||||
|
||||
/**
|
||||
* model's shapes struct
|
||||
**/
|
||||
typedef struct
|
||||
{
|
||||
std::vector<float> positions;
|
||||
|
@ -70,11 +86,13 @@ public:
|
|||
}
|
||||
}shapes_t;
|
||||
|
||||
/// Loads .obj from a file.
|
||||
/// 'shapes' will be filled with parsed shape data
|
||||
/// The function returns error string.
|
||||
/// Returns empty string when loading .obj success.
|
||||
/// 'mtl_basepath' is optional, and used for base path for .mtl file.
|
||||
/**
|
||||
* Loads .obj from a file.
|
||||
* @param shapes will be filled with parsed shape data
|
||||
* @param filename the .obj file path .
|
||||
* @param mtl_basepath It's optional, and used for base path for .mtl file
|
||||
* @return The function returns error string, return empty string when loading .obj success.
|
||||
*/
|
||||
static std::string LoadObj(
|
||||
shapes_t& shapes, // [output]
|
||||
const char* filename,
|
||||
|
|
|
@ -37,6 +37,9 @@ enum class PointSide
|
|||
BEHIND_PLANE,
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines plane
|
||||
**/
|
||||
class CC_DLL Plane
|
||||
{
|
||||
public:
|
||||
|
@ -96,8 +99,8 @@ public:
|
|||
PointSide getSide(const Vec3& point) const;
|
||||
|
||||
protected:
|
||||
Vec3 _normal;
|
||||
float _dist;
|
||||
Vec3 _normal; // the normal line of the plane
|
||||
float _dist; // original displacement of the normal
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB
|
||||
**/
|
||||
class CC_DLL Ray
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -118,7 +118,10 @@ public:
|
|||
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* the BoneBlendState struct
|
||||
* @brief store the transformation and weight for bone blending
|
||||
*/
|
||||
struct BoneBlendState
|
||||
{
|
||||
Vec3 localTranslate;
|
||||
|
|
|
@ -233,6 +233,10 @@ protected:
|
|||
};
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
/**
|
||||
* Sprite3DCache
|
||||
* @brief the cache data of Sprite3D, use to speed up Sprite3D::create
|
||||
*/
|
||||
class CC_DLL Sprite3DCache
|
||||
{
|
||||
public:
|
||||
|
@ -256,13 +260,17 @@ public:
|
|||
/**get & destroy*/
|
||||
static Sprite3DCache* getInstance();
|
||||
static void destroyInstance();
|
||||
|
||||
|
||||
/**get the SpriteData struct*/
|
||||
Sprite3DData* getSpriteData(const std::string& key) const;
|
||||
|
||||
/**add the SpriteData into Sprite3D by given the specified key*/
|
||||
bool addSprite3DData(const std::string& key, Sprite3DData* spritedata);
|
||||
|
||||
/**remove the SpriteData from Sprite3D by given the specified key*/
|
||||
void removeSprite3DData(const std::string& key);
|
||||
|
||||
/**remove all the SpriteData from Sprite3D*/
|
||||
void removeAllSprite3DData();
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
|
|
@ -36,37 +36,68 @@ NS_CC_BEGIN
|
|||
* @{
|
||||
*/
|
||||
|
||||
/** @class Touch
|
||||
* @brief Encapsulates the Touch information, such as touch point, id and so on,
|
||||
and provides the methods that commonly used.
|
||||
*/
|
||||
class CC_DLL Touch : public Ref
|
||||
{
|
||||
public:
|
||||
/** how the touches are dispathced */
|
||||
/** Dispatch mode, how the touches are dispathced. */
|
||||
enum class DispatchMode {
|
||||
/** All at once */
|
||||
ALL_AT_ONCE,
|
||||
/** one by one */
|
||||
ONE_BY_ONE,
|
||||
ALL_AT_ONCE, /** All at once. */
|
||||
ONE_BY_ONE, /** One by one. */
|
||||
};
|
||||
|
||||
/** Constructor.
|
||||
*/
|
||||
Touch()
|
||||
: _id(0),
|
||||
_startPointCaptured(false)
|
||||
{}
|
||||
|
||||
/** returns the current touch location in OpenGL coordinates */
|
||||
/** Returns the current touch location in OpenGL coordinates.
|
||||
*
|
||||
* @return The current touch location in OpenGL coordinates.
|
||||
*/
|
||||
Vec2 getLocation() const;
|
||||
/** returns the previous touch location in OpenGL coordinates */
|
||||
/** Returns the previous touch location in OpenGL coordinates.
|
||||
*
|
||||
* @return The previous touch location in OpenGL coordinates.
|
||||
*/
|
||||
Vec2 getPreviousLocation() const;
|
||||
/** returns the start touch location in OpenGL coordinates */
|
||||
/** Returns the start touch location in OpenGL coordinates.
|
||||
*
|
||||
* @return The start touch location in OpenGL coordinates.
|
||||
*/
|
||||
Vec2 getStartLocation() const;
|
||||
/** returns the delta of 2 current touches locations in screen coordinates */
|
||||
/** Returns the delta of 2 current touches locations in screen coordinates.
|
||||
*
|
||||
* @return The delta of 2 current touches locations in screen coordinates.
|
||||
*/
|
||||
Vec2 getDelta() const;
|
||||
/** returns the current touch location in screen coordinates */
|
||||
/** Returns the current touch location in screen coordinates.
|
||||
*
|
||||
* @return The current touch location in screen coordinates.
|
||||
*/
|
||||
Vec2 getLocationInView() const;
|
||||
/** returns the previous touch location in screen coordinates */
|
||||
/** Returns the previous touch location in screen coordinates.
|
||||
*
|
||||
* @return The previous touch location in screen coordinates.
|
||||
*/
|
||||
Vec2 getPreviousLocationInView() const;
|
||||
/** returns the start touch location in screen coordinates */
|
||||
/** Returns the start touch location in screen coordinates.
|
||||
*
|
||||
* @return The start touch location in screen coordinates.
|
||||
*/
|
||||
Vec2 getStartLocationInView() const;
|
||||
|
||||
/** Set the touch infomation. It always used to monitor touch event.
|
||||
*
|
||||
* @param id A given id
|
||||
* @param x A given x coordinate.
|
||||
* @param y A given y coordinate.
|
||||
*/
|
||||
void setTouchInfo(int id, float x, float y)
|
||||
{
|
||||
_id = id;
|
||||
|
@ -80,9 +111,11 @@ public:
|
|||
_prevPoint = _point;
|
||||
}
|
||||
}
|
||||
/**
|
||||
/** Get touch id.
|
||||
* @js getId
|
||||
* @lua getId
|
||||
*
|
||||
* @return The id of touch.
|
||||
*/
|
||||
int getID() const
|
||||
{
|
||||
|
|
|
@ -43,94 +43,169 @@ CC_DLL extern const ValueVector ValueVectorNull;
|
|||
CC_DLL extern const ValueMap ValueMapNull;
|
||||
CC_DLL extern const ValueMapIntKey ValueMapIntKeyNull;
|
||||
|
||||
/**
|
||||
* This class is provide as a wrapper of basic types, such as int and bool.
|
||||
*/
|
||||
class CC_DLL Value
|
||||
{
|
||||
public:
|
||||
/** A predefined Value that has not value. */
|
||||
static const Value Null;
|
||||
|
||||
/** Default constructor. */
|
||||
Value();
|
||||
|
||||
/** Create a Value by an unsigned char value. */
|
||||
explicit Value(unsigned char v);
|
||||
|
||||
/** Create a Value by an integer value. */
|
||||
explicit Value(int v);
|
||||
|
||||
/** Create a Value by a float value. */
|
||||
explicit Value(float v);
|
||||
|
||||
/** Create a Value by a double value. */
|
||||
explicit Value(double v);
|
||||
|
||||
/** Create a Value by a bool value. */
|
||||
explicit Value(bool v);
|
||||
|
||||
/** Create a Value by a char pointer. It will copy the chars internally. */
|
||||
explicit Value(const char* v);
|
||||
|
||||
/** Create a Value by a string. */
|
||||
explicit Value(const std::string& v);
|
||||
|
||||
|
||||
/** Create a Value by a ValueVector object. */
|
||||
explicit Value(const ValueVector& v);
|
||||
/** Create a Value by a ValueVector object. It will use std::move internally. */
|
||||
explicit Value(ValueVector&& v);
|
||||
|
||||
|
||||
/** Create a Value by a ValueMap object. */
|
||||
explicit Value(const ValueMap& v);
|
||||
explicit Value(ValueMap&& v);
|
||||
|
||||
/** Create a Value by a ValueMap object. It will use std::move internally. */
|
||||
explicit Value(ValueMap&& v);
|
||||
|
||||
/** Create a Value by a ValueMapIntKey object. */
|
||||
explicit Value(const ValueMapIntKey& v);
|
||||
/** Create a Value by a ValueMapIntKey object. It will use std::move internally. */
|
||||
explicit Value(ValueMapIntKey&& v);
|
||||
|
||||
/** Create a Value by anthoer Value object. */
|
||||
Value(const Value& other);
|
||||
/** Create a Value by a Value object. It will use std::move internally. */
|
||||
Value(Value&& other);
|
||||
|
||||
/** Destructor. */
|
||||
~Value();
|
||||
|
||||
// assignment operator
|
||||
/** Assignment operator, assign from Value to Value. */
|
||||
Value& operator= (const Value& other);
|
||||
/** Assignment operator, assign from Value to Value. It will use std::move internally. */
|
||||
Value& operator= (Value&& other);
|
||||
|
||||
/** Assignment operator, assign from unsigned char to Value. */
|
||||
Value& operator= (unsigned char v);
|
||||
/** Assignment operator, assign from integer to Value. */
|
||||
Value& operator= (int v);
|
||||
/** Assignment operator, assign from float to Value. */
|
||||
Value& operator= (float v);
|
||||
/** Assignment operator, assign from double to Value. */
|
||||
Value& operator= (double v);
|
||||
/** Assignment operator, assign from bool to Value. */
|
||||
Value& operator= (bool v);
|
||||
/** Assignment operator, assign from char* to Value. */
|
||||
Value& operator= (const char* v);
|
||||
/** Assignment operator, assign from string to Value. */
|
||||
Value& operator= (const std::string& v);
|
||||
|
||||
/** Assignment operator, assign from ValueVector to Value. */
|
||||
Value& operator= (const ValueVector& v);
|
||||
/** Assignment operator, assign from ValueVector to Value. */
|
||||
Value& operator= (ValueVector&& v);
|
||||
|
||||
/** Assignment operator, assign from ValueMap to Value. */
|
||||
Value& operator= (const ValueMap& v);
|
||||
Value& operator= (ValueMap&& v);
|
||||
/** Assignment operator, assign from ValueMap to Value. It will use std::move internally. */
|
||||
Value& operator= (ValueMap&& v);
|
||||
|
||||
/** Assignment operator, assign from ValueMapIntKey to Value. */
|
||||
Value& operator= (const ValueMapIntKey& v);
|
||||
/** Assignment operator, assign from ValueMapIntKey to Value. It will use std::move internally. */
|
||||
Value& operator= (ValueMapIntKey&& v);
|
||||
|
||||
// equal operator
|
||||
/** != operator overloading */
|
||||
bool operator!= (const Value& v);
|
||||
/** != operator overloading */
|
||||
bool operator!= (const Value& v) const;
|
||||
/** == operator overloading */
|
||||
bool operator== (const Value& v);
|
||||
/** == operator overloading */
|
||||
bool operator== (const Value& v) const;
|
||||
|
||||
/** Gets as a byte value. Will convert to unsigned char if possible, or will trigger assert error. */
|
||||
unsigned char asByte() const;
|
||||
/** Gets as an integer value. Will convert to integer if possible, or will trigger assert error. */
|
||||
int asInt() const;
|
||||
/** Gets as a float value. Will convert to float if possible, or will trigger assert error. */
|
||||
float asFloat() const;
|
||||
/** Gets as a double value. Will convert to double if possible, or will trigger assert error. */
|
||||
double asDouble() const;
|
||||
/** Gets as a bool value. Will convert to bool if possible, or will trigger assert error. */
|
||||
bool asBool() const;
|
||||
/** Gets as a string value. Will convert to string if possible, or will trigger assert error. */
|
||||
std::string asString() const;
|
||||
|
||||
/** Gets as a ValueVector reference. Will convert to ValueVector if possible, or will trigger assert error. */
|
||||
ValueVector& asValueVector();
|
||||
/** Gets as a const ValueVector reference. Will convert to ValueVector if possible, or will trigger assert error. */
|
||||
const ValueVector& asValueVector() const;
|
||||
|
||||
/** Gets as a ValueMap reference. Will convert to ValueMap if possible, or will trigger assert error. */
|
||||
ValueMap& asValueMap();
|
||||
/** Gets as a const ValueMap reference. Will convert to ValueMap if possible, or will trigger assert error. */
|
||||
const ValueMap& asValueMap() const;
|
||||
|
||||
/** Gets as a ValueMapIntKey reference. Will convert to ValueMapIntKey if possible, or will trigger assert error. */
|
||||
ValueMapIntKey& asIntKeyMap();
|
||||
/** Gets as a const ValueMapIntKey reference. Will convert to ValueMapIntKey if possible, or will trigger assert error. */
|
||||
const ValueMapIntKey& asIntKeyMap() const;
|
||||
|
||||
/**
|
||||
* Checks if the Value is null.
|
||||
* @return True if the Value is null, false if not.
|
||||
*/
|
||||
inline bool isNull() const { return _type == Type::NONE; }
|
||||
|
||||
/** Value type wrapped by Value. */
|
||||
enum class Type
|
||||
{
|
||||
/// no value is wrapped, an empty Value
|
||||
NONE = 0,
|
||||
/// wrap byte
|
||||
BYTE,
|
||||
/// wrap integer
|
||||
INTEGER,
|
||||
/// wrap float
|
||||
FLOAT,
|
||||
/// wrap double
|
||||
DOUBLE,
|
||||
/// wrap bool
|
||||
BOOLEAN,
|
||||
/// wrap string
|
||||
STRING,
|
||||
/// wrap vector
|
||||
VECTOR,
|
||||
/// wrap ValueMap
|
||||
MAP,
|
||||
/// wrap ValueMapIntKey
|
||||
INT_KEY_MAP
|
||||
};
|
||||
|
||||
inline Type getType() const { return _type; };
|
||||
/** Gets the value type. */
|
||||
inline Type getType() const { return _type; }
|
||||
|
||||
/** Gets the description of the class. */
|
||||
std::string getDescription() const;
|
||||
|
||||
private:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -52,9 +52,7 @@ const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV = "ShaderPo
|
|||
const char* GLProgram::SHADER_NAME_POSITION_COLOR = "ShaderPositionColor";
|
||||
const char* GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE = "ShaderPositionColorTexAsPointsize";
|
||||
const char* GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP = "ShaderPositionColor_noMVP";
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || defined(WP8_SHADER_COMPILER)
|
||||
const char* GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP_GRAYSCALE = "ShaderPositionColor_noMVP_GrayScale";
|
||||
#endif
|
||||
|
||||
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE = "ShaderPositionTexture";
|
||||
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR = "ShaderPositionTexture_uColor";
|
||||
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR = "ShaderPositionTextureA8Color";
|
||||
|
|
|
@ -245,13 +245,6 @@ void GLProgramCache::loadDefaultGLPrograms()
|
|||
p = new GLProgram();
|
||||
loadDefaultGLProgram(p, kShaderType_3DParticleTex);
|
||||
_programs.insert(std::make_pair(GLProgram::SHADER_3D_PARTICLE_TEXTURE, p));
|
||||
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || defined(WP8_SHADER_COMPILER)
|
||||
p = new GLProgram();
|
||||
loadDefaultGLProgram(p, kShaderType_PositionColor_noMVP_GrayScale);
|
||||
_programs.insert(std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP_GRAYSCALE, p));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void GLProgramCache::reloadDefaultGLPrograms()
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
void execute();
|
||||
|
||||
//used for bath
|
||||
//used for batch
|
||||
void preBatchDraw();
|
||||
void batchDraw();
|
||||
void postBatchDraw();
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the light type,light type MUST be one of LightType::DIRECTIONAL ,<br>
|
||||
-- LightType::POINT, LightType::SPOT, LightType::AMBIENT.
|
||||
-- @function [parent=#BaseLight] getLightType
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
|
|
@ -124,13 +124,13 @@
|
|||
-- @return Camera#Camera ret (return value: cc.Camera)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the default camera of the current running scene.
|
||||
-- @function [parent=#Camera] getDefaultCamera
|
||||
-- @param self
|
||||
-- @return Camera#Camera ret (return value: cc.Camera)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the visiting camera , the visiting camera shall be set on Scene::render
|
||||
-- @function [parent=#Camera] getVisitingCamera
|
||||
-- @param self
|
||||
-- @return Camera#Camera ret (return value: cc.Camera)
|
||||
|
|
|
@ -8,20 +8,25 @@
|
|||
-- If stencil has no childre it will not be drawn.<br>
|
||||
-- If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
|
||||
-- then this method should return true every time you wish stencil to be visited.<br>
|
||||
-- By default returns true if has any children attached.<br>
|
||||
-- return If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
|
||||
-- then this method should return true every time you wish stencil to be visited.<br>
|
||||
-- By default returns true if has any children attached.
|
||||
-- @function [parent=#ClippingNode] hasContent
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the ClippingNode whether or not invert.<br>
|
||||
-- param inverted A bool Type,to set the ClippingNode whether or not invert.
|
||||
-- @function [parent=#ClippingNode] setInverted
|
||||
-- @param self
|
||||
-- @param #bool inverted
|
||||
-- @return ClippingNode#ClippingNode self (return value: cc.ClippingNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the Node to use as a stencil to do the clipping.<br>
|
||||
-- param stencil The Node to use as a stencil to do the clipping.
|
||||
-- @function [parent=#ClippingNode] setStencil
|
||||
-- @param self
|
||||
-- @param #cc.Node stencil
|
||||
|
@ -31,7 +36,8 @@
|
|||
-- The alpha threshold.<br>
|
||||
-- The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.<br>
|
||||
-- Should be a float between 0 and 1.<br>
|
||||
-- This default to 1 (so alpha test is disabled).
|
||||
-- This default to 1 (so alpha test is disabled).<br>
|
||||
-- return The alpha threshold value,Should be a float between 0 and 1.
|
||||
-- @function [parent=#ClippingNode] getAlphaThreshold
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
@ -39,13 +45,15 @@
|
|||
--------------------------------
|
||||
-- The Node to use as a stencil to do the clipping.<br>
|
||||
-- The stencil node will be retained.<br>
|
||||
-- This default to nil.
|
||||
-- This default to nil.<br>
|
||||
-- return The stencil node.
|
||||
-- @function [parent=#ClippingNode] getStencil
|
||||
-- @param self
|
||||
-- @return Node#Node ret (return value: cc.Node)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the alpha threshold. <br>
|
||||
-- param alphaThreshold The alpha threshold.
|
||||
-- @function [parent=#ClippingNode] setAlphaThreshold
|
||||
-- @param self
|
||||
-- @param #float alphaThreshold
|
||||
|
@ -54,7 +62,8 @@
|
|||
--------------------------------
|
||||
-- Inverted. If this is set to true,<br>
|
||||
-- the stencil is inverted, so the content is drawn where the stencil is NOT drawn.<br>
|
||||
-- This default to false.
|
||||
-- This default to false.<br>
|
||||
-- return If the clippingNode is Inverted, it will be return true.
|
||||
-- @function [parent=#ClippingNode] isInverted
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Draw an line from origin to destination with color. <br>
|
||||
-- param origin The line origin.<br>
|
||||
-- param destination The line destination.<br>
|
||||
-- param color The line color.
|
||||
-- @function [parent=#DrawNode] drawLine
|
||||
-- @param self
|
||||
-- @param #vec2_table origin
|
||||
|
@ -48,7 +51,10 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- draw a dot at a position, with a given radius and color
|
||||
-- draw a dot at a position, with a given radius and color. <br>
|
||||
-- param pos The dot center.<br>
|
||||
-- param radius The dot radius.<br>
|
||||
-- param color The dot color.
|
||||
-- @function [parent=#DrawNode] drawDot
|
||||
-- @param self
|
||||
-- @param #vec2_table pos
|
||||
|
@ -57,7 +63,11 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- draw a segment with a radius and color
|
||||
-- draw a segment with a radius and color. <br>
|
||||
-- param from The segment origin.<br>
|
||||
-- param to The segment destination.<br>
|
||||
-- param radius The segment radius.<br>
|
||||
-- param color The segment color.
|
||||
-- @function [parent=#DrawNode] drawSegment
|
||||
-- @param self
|
||||
-- @param #vec2_table from
|
||||
|
@ -67,6 +77,7 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- Get the color mixed mode.<br>
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#DrawNode] getBlendFunc
|
||||
|
@ -97,7 +108,12 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Draws a quad bezier path.<br>
|
||||
-- param origin The origin of the bezier path.<br>
|
||||
-- param control The control of the bezier path.<br>
|
||||
-- param destination The destination of the bezier path.<br>
|
||||
-- param segments The The number of segments.<br>
|
||||
-- param color Set the quad bezier color.
|
||||
-- @function [parent=#DrawNode] drawQuadBezier
|
||||
-- @param self
|
||||
-- @param #vec2_table origin
|
||||
|
@ -116,7 +132,11 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- draw a triangle with color
|
||||
-- draw a triangle with color. <br>
|
||||
-- param p1 The triangle vertex point.<br>
|
||||
-- param p2 The triangle vertex point.<br>
|
||||
-- param p3 The triangle vertex point.<br>
|
||||
-- param color The triangle color.
|
||||
-- @function [parent=#DrawNode] drawTriangle
|
||||
-- @param self
|
||||
-- @param #vec2_table p1
|
||||
|
@ -126,6 +146,7 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- Set the color mixed mode.<br>
|
||||
-- code<br>
|
||||
-- When this function bound into js or lua,the parameter will be changed<br>
|
||||
-- In js: var setBlendFunc(var src, var dst)<br>
|
||||
|
@ -143,7 +164,11 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Draws a solid rectangle given the origin and destination point measured in points.<br>
|
||||
-- The origin and the destination can not have the same x and y coordinate.<br>
|
||||
-- param origin The rectangle origin.<br>
|
||||
-- param destination The rectangle destination.<br>
|
||||
-- param color The rectangle color.
|
||||
-- @function [parent=#DrawNode] drawSolidRect
|
||||
-- @param self
|
||||
-- @param #vec2_table origin
|
||||
|
@ -152,7 +177,10 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Draw a point.<br>
|
||||
-- param point A Vec2 used to point.<br>
|
||||
-- param pointSize The point size.<br>
|
||||
-- param color The point color.
|
||||
-- @function [parent=#DrawNode] drawPoint
|
||||
-- @param self
|
||||
-- @param #vec2_table point
|
||||
|
@ -161,7 +189,13 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- draw a cubic bezier curve with color and number of segments
|
||||
-- Draw a cubic bezier curve with color and number of segments<br>
|
||||
-- param origin The origin of the bezier path.<br>
|
||||
-- param control1 The first control of the bezier path.<br>
|
||||
-- param control2 The second control of the bezier path.<br>
|
||||
-- param destination The destination of the bezier path.<br>
|
||||
-- param segments The The number of segments.<br>
|
||||
-- param color Set the cubic bezier color.
|
||||
-- @function [parent=#DrawNode] drawCubicBezier
|
||||
-- @param self
|
||||
-- @param #vec2_table origin
|
||||
|
@ -173,7 +207,8 @@
|
|||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||
|
||||
--------------------------------
|
||||
-- creates and initialize a DrawNode node
|
||||
-- creates and initialize a DrawNode node.<br>
|
||||
-- return Return an autorelease object.
|
||||
-- @function [parent=#DrawNode] create
|
||||
-- @param self
|
||||
-- @return DrawNode#DrawNode ret (return value: cc.DrawNode)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- Remove all living segments of the ribbon
|
||||
-- Remove all living segments of the ribbon.
|
||||
-- @function [parent=#MotionStreak] reset
|
||||
-- @param self
|
||||
-- @return MotionStreak#MotionStreak self (return value: cc.MotionStreak)
|
||||
|
@ -24,7 +24,8 @@
|
|||
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
||||
|
||||
--------------------------------
|
||||
-- color used for the tint
|
||||
-- Color used for the tint.<br>
|
||||
-- param colors The color used for the tint.
|
||||
-- @function [parent=#MotionStreak] tintWithColor
|
||||
-- @param self
|
||||
-- @param #color3b_table colors
|
||||
|
@ -39,7 +40,8 @@
|
|||
-- @return MotionStreak#MotionStreak self (return value: cc.MotionStreak)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the starting position initialized or not.<br>
|
||||
-- param bStartingPositionInitialized True if initialized the starting position.
|
||||
-- @function [parent=#MotionStreak] setStartingPositionInitialized
|
||||
-- @param self
|
||||
-- @param #bool bStartingPositionInitialized
|
||||
|
@ -53,19 +55,22 @@
|
|||
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Is the starting position initialized or not.<br>
|
||||
-- return True if the starting position is initialized.
|
||||
-- @function [parent=#MotionStreak] isStartingPositionInitialized
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- When fast mode is enabled, new points are added faster but with lower precision
|
||||
-- When fast mode is enabled, new points are added faster but with lower precision. <br>
|
||||
-- return True if fast mode is enabled.
|
||||
-- @function [parent=#MotionStreak] isFastMode
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets fast mode or not.<br>
|
||||
-- param bFastMode True if enabled fast mode.
|
||||
-- @function [parent=#MotionStreak] setFastMode
|
||||
-- @param self
|
||||
-- @param #bool bFastMode
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Adds a child to the container with a local z-order, parallax ratio and position offset.<br>
|
||||
-- param child A child node.<br>
|
||||
-- param z Z order for drawing priority.<br>
|
||||
-- param parallaxRatio A given parallax ratio.<br>
|
||||
-- param positionOffset A given position offset.
|
||||
-- @function [parent=#ParallaxNode] addChild
|
||||
-- @param self
|
||||
-- @param #cc.Node child
|
||||
|
@ -22,7 +26,8 @@
|
|||
-- @return ParallaxNode#ParallaxNode self (return value: cc.ParallaxNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a Parallax node. <br>
|
||||
-- return An autoreleased ParallaxNode object.
|
||||
-- @function [parent=#ParallaxNode] create
|
||||
-- @param self
|
||||
-- @return ParallaxNode#ParallaxNode ret (return value: cc.ParallaxNode)
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
-- @return ParticleBatchNode#ParticleBatchNode self (return value: cc.ParticleBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- disables a particle by inserting a 0'd quad into the texture atlas
|
||||
-- Disables a particle by inserting a 0'd quad into the texture atlas.<br>
|
||||
-- param particleIndex The index of the particle.
|
||||
-- @function [parent=#ParticleBatchNode] disableParticle
|
||||
-- @param self
|
||||
-- @param #int particleIndex
|
||||
|
@ -25,7 +26,8 @@
|
|||
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
||||
|
||||
--------------------------------
|
||||
-- Sets the texture atlas used for drawing the quads
|
||||
-- Sets the texture atlas used for drawing the quads.<br>
|
||||
-- param atlas The texture atlas used for drawing the quads.
|
||||
-- @function [parent=#ParticleBatchNode] setTextureAtlas
|
||||
-- @param self
|
||||
-- @param #cc.TextureAtlas atlas
|
||||
|
@ -50,7 +52,8 @@
|
|||
-- @return ParticleBatchNode#ParticleBatchNode self (return value: cc.ParticleBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- Gets the texture atlas used for drawing the quads
|
||||
-- Gets the texture atlas used for drawing the quads.<br>
|
||||
-- return The texture atlas used for drawing the quads.
|
||||
-- @function [parent=#ParticleBatchNode] getTextureAtlas
|
||||
-- @param self
|
||||
-- @return TextureAtlas#TextureAtlas ret (return value: cc.TextureAtlas)
|
||||
|
@ -63,7 +66,9 @@
|
|||
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
|
||||
|
||||
--------------------------------
|
||||
-- Inserts a child into the ParticleBatchNode
|
||||
-- Inserts a child into the ParticleBatchNode.<br>
|
||||
-- param system A given particle system.<br>
|
||||
-- param index The insert index.
|
||||
-- @function [parent=#ParticleBatchNode] insertChild
|
||||
-- @param self
|
||||
-- @param #cc.ParticleSystem system
|
||||
|
@ -71,7 +76,9 @@
|
|||
-- @return ParticleBatchNode#ParticleBatchNode self (return value: cc.ParticleBatchNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Remove a child of the ParticleBatchNode.<br>
|
||||
-- param index The index of the child.<br>
|
||||
-- param doCleanup True if all actions and callbacks on this node should be removed, false otherwise.
|
||||
-- @function [parent=#ParticleBatchNode] removeChildAtIndex
|
||||
-- @param self
|
||||
-- @param #int index
|
||||
|
@ -79,7 +86,10 @@
|
|||
-- @return ParticleBatchNode#ParticleBatchNode self (return value: cc.ParticleBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles
|
||||
-- Create the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles.<br>
|
||||
-- param fileImage A given file name.<br>
|
||||
-- param capacity A capacity of particles.<br>
|
||||
-- return An autoreleased ParticleBatchNode object.
|
||||
-- @function [parent=#ParticleBatchNode] create
|
||||
-- @param self
|
||||
-- @param #string fileImage
|
||||
|
@ -87,7 +97,10 @@
|
|||
-- @return ParticleBatchNode#ParticleBatchNode ret (return value: cc.ParticleBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- initializes the particle system with Texture2D, a capacity of particles, which particle system to use
|
||||
-- Create the particle system with Texture2D, a capacity of particles, which particle system to use.<br>
|
||||
-- param tex A given texture.<br>
|
||||
-- param capacity A capacity of particles.<br>
|
||||
-- return An autoreleased ParticleBatchNode object.
|
||||
-- @function [parent=#ParticleBatchNode] createWithTexture
|
||||
-- @param self
|
||||
-- @param #cc.Texture2D tex
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a explosion particle system.<br>
|
||||
-- return An autoreleased ParticleExplosion object.
|
||||
-- @function [parent=#ParticleExplosion] create
|
||||
-- @param self
|
||||
-- @return ParticleExplosion#ParticleExplosion ret (return value: cc.ParticleExplosion)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a explosion particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleExplosion object.
|
||||
-- @function [parent=#ParticleExplosion] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a fire particle system.<br>
|
||||
-- return An autoreleased ParticleFire object.
|
||||
-- @function [parent=#ParticleFire] create
|
||||
-- @param self
|
||||
-- @return ParticleFire#ParticleFire ret (return value: cc.ParticleFire)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a fire particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleFire object.
|
||||
-- @function [parent=#ParticleFire] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a fireworks particle system.<br>
|
||||
-- return An autoreleased ParticleFireworks object.
|
||||
-- @function [parent=#ParticleFireworks] create
|
||||
-- @param self
|
||||
-- @return ParticleFireworks#ParticleFireworks ret (return value: cc.ParticleFireworks)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a fireworks particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleFireworks object.
|
||||
-- @function [parent=#ParticleFireworks] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a flower particle system.<br>
|
||||
-- return An autoreleased ParticleFlower object.
|
||||
-- @function [parent=#ParticleFlower] create
|
||||
-- @param self
|
||||
-- @return ParticleFlower#ParticleFlower ret (return value: cc.ParticleFlower)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a flower particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleFlower object.
|
||||
-- @function [parent=#ParticleFlower] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a galaxy particle system.<br>
|
||||
-- return An autoreleased ParticleGalaxy object.
|
||||
-- @function [parent=#ParticleGalaxy] create
|
||||
-- @param self
|
||||
-- @return ParticleGalaxy#ParticleGalaxy ret (return value: cc.ParticleGalaxy)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a galaxy particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleGalaxy object.
|
||||
-- @function [parent=#ParticleGalaxy] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a meteor particle system.<br>
|
||||
-- return An autoreleased ParticleMeteor object.
|
||||
-- @function [parent=#ParticleMeteor] create
|
||||
-- @param self
|
||||
-- @return ParticleMeteor#ParticleMeteor ret (return value: cc.ParticleMeteor)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a meteor particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleMeteor object.
|
||||
-- @function [parent=#ParticleMeteor] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a rain particle system.<br>
|
||||
-- return An autoreleased ParticleRain object.
|
||||
-- @function [parent=#ParticleRain] create
|
||||
-- @param self
|
||||
-- @return ParticleRain#ParticleRain ret (return value: cc.ParticleRain)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a rain particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleRain object.
|
||||
-- @function [parent=#ParticleRain] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a smoke particle system.<br>
|
||||
-- return An autoreleased ParticleSmoke object.
|
||||
-- @function [parent=#ParticleSmoke] create
|
||||
-- @param self
|
||||
-- @return ParticleSmoke#ParticleSmoke ret (return value: cc.ParticleSmoke)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a smoke particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleSmoke object.
|
||||
-- @function [parent=#ParticleSmoke] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a snow particle system.<br>
|
||||
-- return An autoreleased ParticleSnow object.
|
||||
-- @function [parent=#ParticleSnow] create
|
||||
-- @param self
|
||||
-- @return ParticleSnow#ParticleSnow ret (return value: cc.ParticleSnow)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a snow particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleSnow object.
|
||||
-- @function [parent=#ParticleSnow] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a spiral particle system.<br>
|
||||
-- return An autoreleased ParticleSpiral object.
|
||||
-- @function [parent=#ParticleSpiral] create
|
||||
-- @param self
|
||||
-- @return ParticleSpiral#ParticleSpiral ret (return value: cc.ParticleSpiral)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a spiral particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleSpiral object.
|
||||
-- @function [parent=#ParticleSpiral] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a sun particle system.<br>
|
||||
-- return An autoreleased ParticleSun object.
|
||||
-- @function [parent=#ParticleSun] create
|
||||
-- @param self
|
||||
-- @return ParticleSun#ParticleSun ret (return value: cc.ParticleSun)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Create a sun particle system withe a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleSun object.
|
||||
-- @function [parent=#ParticleSun] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- size variance in pixels of each particle
|
||||
-- Gets the start size variance in pixels of each particle.<br>
|
||||
-- return The start size variance in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] getStartSizeVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
@ -17,149 +18,172 @@
|
|||
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
||||
|
||||
--------------------------------
|
||||
-- whether or not the system is full
|
||||
-- Whether or not the system is full.<br>
|
||||
-- return True if the system is full.
|
||||
-- @function [parent=#ParticleSystem] isFull
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the batch node.<br>
|
||||
-- return The batch node.
|
||||
-- @function [parent=#ParticleSystem] getBatchNode
|
||||
-- @param self
|
||||
-- @return ParticleBatchNode#ParticleBatchNode ret (return value: cc.ParticleBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- start color of each particle
|
||||
-- Gets the start color of each particle.<br>
|
||||
-- return The start color of each particle.
|
||||
-- @function [parent=#ParticleSystem] getStartColor
|
||||
-- @param self
|
||||
-- @return color4f_table#color4f_table ret (return value: color4f_table)
|
||||
|
||||
--------------------------------
|
||||
-- particles movement type: Free or Grouped<br>
|
||||
-- since v0.8
|
||||
-- Gets the particles movement type: Free or Grouped.<br>
|
||||
-- since v0.8<br>
|
||||
-- return The particles movement type.
|
||||
-- @function [parent=#ParticleSystem] getPositionType
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the position variance of the emitter.<br>
|
||||
-- param pos The position variance of the emitter.
|
||||
-- @function [parent=#ParticleSystem] setPosVar
|
||||
-- @param self
|
||||
-- @param #vec2_table pos
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the end spin of each particle.<br>
|
||||
-- return The end spin of each particle.
|
||||
-- @function [parent=#ParticleSystem] getEndSpin
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the rotate per second variance.<br>
|
||||
-- param degrees The rotate per second variance.
|
||||
-- @function [parent=#ParticleSystem] setRotatePerSecondVar
|
||||
-- @param self
|
||||
-- @param #float degrees
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the start spin variance of each particle.<br>
|
||||
-- return The start spin variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] getStartSpinVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the radial acceleration variance.<br>
|
||||
-- return The radial acceleration variance.
|
||||
-- @function [parent=#ParticleSystem] getRadialAccelVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- end size variance in pixels of each particle
|
||||
-- Gets the end size variance in pixels of each particle.<br>
|
||||
-- return The end size variance in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] getEndSizeVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the tangential acceleration.<br>
|
||||
-- param t The tangential acceleration.
|
||||
-- @function [parent=#ParticleSystem] setTangentialAccel
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the radial acceleration.<br>
|
||||
-- return The radial acceleration.
|
||||
-- @function [parent=#ParticleSystem] getRadialAccel
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start radius.<br>
|
||||
-- param startRadius The start radius.
|
||||
-- @function [parent=#ParticleSystem] setStartRadius
|
||||
-- @param self
|
||||
-- @param #float startRadius
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the number of degrees to rotate a particle around the source pos per second.<br>
|
||||
-- param degrees The number of degrees to rotate a particle around the source pos per second.
|
||||
-- @function [parent=#ParticleSystem] setRotatePerSecond
|
||||
-- @param self
|
||||
-- @param #float degrees
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end size in pixels of each particle.<br>
|
||||
-- param endSize The end size in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] setEndSize
|
||||
-- @param self
|
||||
-- @param #float endSize
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the garvity.<br>
|
||||
-- return The gravity.
|
||||
-- @function [parent=#ParticleSystem] getGravity
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the tangential acceleration.<br>
|
||||
-- return The tangential acceleration.
|
||||
-- @function [parent=#ParticleSystem] getTangentialAccel
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end radius.<br>
|
||||
-- param endRadius The end radius.
|
||||
-- @function [parent=#ParticleSystem] setEndRadius
|
||||
-- @param self
|
||||
-- @param #float endRadius
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the speed.<br>
|
||||
-- return The speed.
|
||||
-- @function [parent=#ParticleSystem] getSpeed
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- angle and angle variation of each particle
|
||||
-- Gets the angle of each particle. <br>
|
||||
-- return The angle of each particle.
|
||||
-- @function [parent=#ParticleSystem] getAngle
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end color and end color variation of each particle.<br>
|
||||
-- param color The end color and end color variation of each particle.
|
||||
-- @function [parent=#ParticleSystem] setEndColor
|
||||
-- @param self
|
||||
-- @param #color4f_table color
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start spin of each particle.<br>
|
||||
-- param spin The start spin of each particle.
|
||||
-- @function [parent=#ParticleSystem] setStartSpin
|
||||
-- @param self
|
||||
-- @param #float spin
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets how many seconds the emitter will run. -1 means 'forever'.<br>
|
||||
-- param duration The seconds that the emitter will run. -1 means 'forever'.
|
||||
-- @function [parent=#ParticleSystem] setDuration
|
||||
-- @param self
|
||||
-- @param #float duration
|
||||
|
@ -173,83 +197,95 @@
|
|||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- Position variance of the emitter
|
||||
-- Gets the position variance of the emitter.<br>
|
||||
-- return The position variance of the emitter.
|
||||
-- @function [parent=#ParticleSystem] getPosVar
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Call the update mathod with no time..
|
||||
-- @function [parent=#ParticleSystem] updateWithNoTime
|
||||
-- @param self
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Whether or not the particle system is blend additive.<br>
|
||||
-- return True if the particle system is blend additive.
|
||||
-- @function [parent=#ParticleSystem] isBlendAdditive
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the speed variance.<br>
|
||||
-- return The speed variance.
|
||||
-- @function [parent=#ParticleSystem] getSpeedVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the particles movement type: Free or Grouped.<br>
|
||||
-- since v0.8<br>
|
||||
-- param type The particles movement type.
|
||||
-- @function [parent=#ParticleSystem] setPositionType
|
||||
-- @param self
|
||||
-- @param #int type
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- stop emitting particles. Running particles will continue to run until they die
|
||||
-- Stop emitting particles. Running particles will continue to run until they die.
|
||||
-- @function [parent=#ParticleSystem] stopSystem
|
||||
-- @param self
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- sourcePosition of the emitter
|
||||
-- Gets the source position of the emitter.<br>
|
||||
-- return The source position of the emitter.
|
||||
-- @function [parent=#ParticleSystem] getSourcePosition
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the life variance of each particle.<br>
|
||||
-- param lifeVar The life variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] setLifeVar
|
||||
-- @param self
|
||||
-- @param #float lifeVar
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the maximum particles of the system.<br>
|
||||
-- param totalParticles The maximum particles of the system.
|
||||
-- @function [parent=#ParticleSystem] setTotalParticles
|
||||
-- @param self
|
||||
-- @param #int totalParticles
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end color variance of each particle.<br>
|
||||
-- param color The end color variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] setEndColorVar
|
||||
-- @param self
|
||||
-- @param #color4f_table color
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the index of system in batch node array.<br>
|
||||
-- return The index of system in batch node array.
|
||||
-- @function [parent=#ParticleSystem] getAtlasIndex
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- start size in pixels of each particle
|
||||
-- Gets the start size in pixels of each particle.<br>
|
||||
-- return The start size in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] getStartSize
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start spin variance of each particle.<br>
|
||||
-- param pinVar The start spin variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] setStartSpinVar
|
||||
-- @param self
|
||||
-- @param #float pinVar
|
||||
|
@ -262,289 +298,333 @@
|
|||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the index of system in batch node array.<br>
|
||||
-- param index The index of system in batch node array.
|
||||
-- @function [parent=#ParticleSystem] setAtlasIndex
|
||||
-- @param self
|
||||
-- @param #int index
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the tangential acceleration variance.<br>
|
||||
-- param t The tangential acceleration variance.
|
||||
-- @function [parent=#ParticleSystem] setTangentialAccelVar
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end radius variance.<br>
|
||||
-- param endRadiusVar The end radius variance.
|
||||
-- @function [parent=#ParticleSystem] setEndRadiusVar
|
||||
-- @param self
|
||||
-- @param #float endRadiusVar
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the end radius.<br>
|
||||
-- return The end radius.
|
||||
-- @function [parent=#ParticleSystem] getEndRadius
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Whether or not the particle system is active.<br>
|
||||
-- return True if the particle system is active.
|
||||
-- @function [parent=#ParticleSystem] isActive
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the radial acceleration variance.<br>
|
||||
-- param t The radial acceleration variance.
|
||||
-- @function [parent=#ParticleSystem] setRadialAccelVar
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start size in pixels of each particle.<br>
|
||||
-- param startSize The start size in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] setStartSize
|
||||
-- @param self
|
||||
-- @param #float startSize
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the speed.<br>
|
||||
-- param speed The speed.
|
||||
-- @function [parent=#ParticleSystem] setSpeed
|
||||
-- @param self
|
||||
-- @param #float speed
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the start spin of each particle.<br>
|
||||
-- return The start spin of each particle.
|
||||
-- @function [parent=#ParticleSystem] getStartSpin
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the number of degrees to rotate a particle around the source pos per second.<br>
|
||||
-- return The number of degrees to rotate a particle around the source pos per second.
|
||||
-- @function [parent=#ParticleSystem] getRotatePerSecond
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the mode of the emitter.<br>
|
||||
-- param mode The mode of the emitter.
|
||||
-- @function [parent=#ParticleSystem] setEmitterMode
|
||||
-- @param self
|
||||
-- @param #int mode
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- How many seconds the emitter will run. -1 means 'forever'
|
||||
-- Gets how many seconds the emitter will run. -1 means 'forever'.<br>
|
||||
-- return The seconds that the emitter will run. -1 means 'forever'.
|
||||
-- @function [parent=#ParticleSystem] getDuration
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the source position of the emitter.<br>
|
||||
-- param The source position of the emitter.
|
||||
-- @function [parent=#ParticleSystem] setSourcePosition
|
||||
-- @param self
|
||||
-- @param #vec2_table pos
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the end spin variance of each particle.<br>
|
||||
-- return The end spin variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] getEndSpinVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the particle system blend additive.<br>
|
||||
-- param value True if the particle system is blend additive.
|
||||
-- @function [parent=#ParticleSystem] setBlendAdditive
|
||||
-- @param self
|
||||
-- @param #bool value
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the life of each particle.<br>
|
||||
-- param life The life of each particle.
|
||||
-- @function [parent=#ParticleSystem] setLife
|
||||
-- @param self
|
||||
-- @param #float life
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the angle variance of each particle.<br>
|
||||
-- param angleVar The angle variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] setAngleVar
|
||||
-- @param self
|
||||
-- @param #float angleVar
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the rotation of each particle to its direction.<br>
|
||||
-- param t True if the rotation is the direction.
|
||||
-- @function [parent=#ParticleSystem] setRotationIsDir
|
||||
-- @param self
|
||||
-- @param #bool t
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end size variance in pixels of each particle.<br>
|
||||
-- param sizeVar The end size variance in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] setEndSizeVar
|
||||
-- @param self
|
||||
-- @param #float sizeVar
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the angle of each particle.<br>
|
||||
-- param angle The angle of each particle.
|
||||
-- @function [parent=#ParticleSystem] setAngle
|
||||
-- @param self
|
||||
-- @param #float angle
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the batch node.<br>
|
||||
-- param batchNode The batch node.
|
||||
-- @function [parent=#ParticleSystem] setBatchNode
|
||||
-- @param self
|
||||
-- @param #cc.ParticleBatchNode batchNode
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the tangential acceleration variance.<br>
|
||||
-- return The tangential acceleration variance.
|
||||
-- @function [parent=#ParticleSystem] getTangentialAccelVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- Switch between different kind of emitter modes:<br>
|
||||
-- - kParticleModeGravity: uses gravity, speed, radial and tangential acceleration<br>
|
||||
-- - kParticleModeRadius: uses radius movement + rotation
|
||||
-- - kParticleModeGravity: uses gravity, speed, radial and tangential acceleration.<br>
|
||||
-- - kParticleModeRadius: uses radius movement + rotation.<br>
|
||||
-- return The mode of the emitter.
|
||||
-- @function [parent=#ParticleSystem] getEmitterMode
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end spin variance of each particle.<br>
|
||||
-- param endSpinVar The end spin variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] setEndSpinVar
|
||||
-- @param self
|
||||
-- @param #float endSpinVar
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- angle variance of each particle
|
||||
-- Gets the angle variance of each particle.<br>
|
||||
-- return The angle variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] getAngleVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start color of each particle.<br>
|
||||
-- param color The start color of each particle.
|
||||
-- @function [parent=#ParticleSystem] setStartColor
|
||||
-- @param self
|
||||
-- @param #color4f_table color
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the rotate per second variance.<br>
|
||||
-- return The rotate per second variance.
|
||||
-- @function [parent=#ParticleSystem] getRotatePerSecondVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- end size in pixels of each particle
|
||||
-- Gets the end size in pixels of each particle.<br>
|
||||
-- return The end size in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] getEndSize
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- life, and life variation of each particle
|
||||
-- Gets the life of each particle.<br>
|
||||
-- return The life of each particle.
|
||||
-- @function [parent=#ParticleSystem] getLife
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the speed variance.<br>
|
||||
-- param speed The speed variance.
|
||||
-- @function [parent=#ParticleSystem] setSpeedVar
|
||||
-- @param self
|
||||
-- @param #float speed
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the particle system auto removed it self on finish.<br>
|
||||
-- param var True if the particle system removed self on finish.
|
||||
-- @function [parent=#ParticleSystem] setAutoRemoveOnFinish
|
||||
-- @param self
|
||||
-- @param #bool var
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the gravity.<br>
|
||||
-- param g The gravity.
|
||||
-- @function [parent=#ParticleSystem] setGravity
|
||||
-- @param self
|
||||
-- @param #vec2_table g
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- should be overridden by subclasses
|
||||
-- Update the VBO verts buffer which does not use batch node,<br>
|
||||
-- should be overridden by subclasses.
|
||||
-- @function [parent=#ParticleSystem] postStep
|
||||
-- @param self
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the emission rate of the particles.<br>
|
||||
-- param rate The emission rate of the particles.
|
||||
-- @function [parent=#ParticleSystem] setEmissionRate
|
||||
-- @param self
|
||||
-- @param #float rate
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- end color variance of each particle
|
||||
-- Gets the end color variance of each particle.<br>
|
||||
-- return The end color variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] getEndColorVar
|
||||
-- @param self
|
||||
-- @return color4f_table#color4f_table ret (return value: color4f_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Whether or not the rotation of each particle to its direction.<br>
|
||||
-- return True if the rotation is the direction.
|
||||
-- @function [parent=#ParticleSystem] getRotationIsDir
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- emission rate of the particles
|
||||
-- Gets the emission rate of the particles.<br>
|
||||
-- return The emission rate of the particles.
|
||||
-- @function [parent=#ParticleSystem] getEmissionRate
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- end color and end color variation of each particle
|
||||
-- Gets the end color and end color variation of each particle.<br>
|
||||
-- return The end color and end color variation of each particle.
|
||||
-- @function [parent=#ParticleSystem] getEndColor
|
||||
-- @param self
|
||||
-- @return color4f_table#color4f_table ret (return value: color4f_table)
|
||||
|
||||
--------------------------------
|
||||
-- life variance of each particle
|
||||
-- Gets the life variance of each particle.<br>
|
||||
-- return The life variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] getLifeVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start size variance in pixels of each particle.<br>
|
||||
-- param sizeVar The start size variance in pixels of each particle.
|
||||
-- @function [parent=#ParticleSystem] setStartSizeVar
|
||||
-- @param self
|
||||
-- @param #float sizeVar
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- Add a particle to the emitter
|
||||
-- Add a particle to the emitter.<br>
|
||||
-- return True if add success.
|
||||
-- @function [parent=#ParticleSystem] addParticle
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the start radius.<br>
|
||||
-- return The start radius.
|
||||
-- @function [parent=#ParticleSystem] getStartRadius
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- Quantity of particles that are being simulated at the moment
|
||||
-- Gets the Quantity of particles that are being simulated at the moment.<br>
|
||||
-- return The Quantity of particles that are being simulated at the moment.
|
||||
-- @function [parent=#ParticleSystem] getParticleCount
|
||||
-- @param self
|
||||
-- @return unsigned int#unsigned int ret (return value: unsigned int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the start radius variance.<br>
|
||||
-- return The start radius variance.
|
||||
-- @function [parent=#ParticleSystem] getStartRadiusVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
@ -557,40 +637,46 @@
|
|||
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start color variance of each particle.<br>
|
||||
-- param color The start color variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] setStartColorVar
|
||||
-- @param self
|
||||
-- @param #color4f_table color
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the end spin of each particle.<br>
|
||||
-- param endSpin The end spin of each particle.
|
||||
-- @function [parent=#ParticleSystem] setEndSpin
|
||||
-- @param self
|
||||
-- @param #float endSpin
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the radial acceleration.<br>
|
||||
-- param t The radial acceleration.
|
||||
-- @function [parent=#ParticleSystem] setRadialAccel
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Whether or not the particle system removed self on finish.<br>
|
||||
-- return True if the particle system removed self on finish.
|
||||
-- @function [parent=#ParticleSystem] isAutoRemoveOnFinish
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- maximum particles of the system
|
||||
-- Gets the maximum particles of the system.<br>
|
||||
-- return The maximum particles of the system.
|
||||
-- @function [parent=#ParticleSystem] getTotalParticles
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Sets the start radius variance.<br>
|
||||
-- param startRadiusVar The start radius variance.
|
||||
-- @function [parent=#ParticleSystem] setStartRadiusVar
|
||||
-- @param self
|
||||
-- @param #float startRadiusVar
|
||||
|
@ -608,29 +694,35 @@
|
|||
-- @return ParticleSystem#ParticleSystem self (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Gets the end radius variance.<br>
|
||||
-- return The end radius variance.
|
||||
-- @function [parent=#ParticleSystem] getEndRadiusVar
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- start color variance of each particle
|
||||
-- Gets the start color variance of each particle.<br>
|
||||
-- return The start color variance of each particle.
|
||||
-- @function [parent=#ParticleSystem] getStartColorVar
|
||||
-- @param self
|
||||
-- @return color4f_table#color4f_table ret (return value: color4f_table)
|
||||
|
||||
--------------------------------
|
||||
-- creates an initializes a ParticleSystem from a plist file.<br>
|
||||
-- Creates an initializes a ParticleSystem from a plist file.<br>
|
||||
-- This plist files can be created manually or with Particle Designer:<br>
|
||||
-- http:particledesigner.71squared.com/<br>
|
||||
-- since v2.0
|
||||
-- since v2.0<br>
|
||||
-- param Particle plist file name.<br>
|
||||
-- return An autoreleased ParticleSystem object.
|
||||
-- @function [parent=#ParticleSystem] create
|
||||
-- @param self
|
||||
-- @param #string plistFile
|
||||
-- @return ParticleSystem#ParticleSystem ret (return value: cc.ParticleSystem)
|
||||
|
||||
--------------------------------
|
||||
-- create a system with a fixed number of particles
|
||||
-- Create a system with a fixed number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleSystemQuad object.
|
||||
-- @function [parent=#ParticleSystem] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
--------------------------------
|
||||
-- Sets a new SpriteFrame as particle.<br>
|
||||
-- WARNING: this method is experimental. Use setTextureWithRect instead.<br>
|
||||
-- param spriteFrame A given sprite frame as particle texture.<br>
|
||||
-- since v0.99.4
|
||||
-- @function [parent=#ParticleSystemQuad] setDisplayFrame
|
||||
-- @param self
|
||||
|
@ -17,7 +18,9 @@
|
|||
-- Sets a new texture with a rect. The rect is in Points.<br>
|
||||
-- since v0.99.4<br>
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- lua NA<br>
|
||||
-- param texture A given texture.<br>
|
||||
-- 8 @param rect A given rect, in points.
|
||||
-- @function [parent=#ParticleSystemQuad] setTextureWithRect
|
||||
-- @param self
|
||||
-- @param #cc.Texture2D texture
|
||||
|
@ -25,9 +28,10 @@
|
|||
-- @return ParticleSystemQuad#ParticleSystemQuad self (return value: cc.ParticleSystemQuad)
|
||||
|
||||
--------------------------------
|
||||
-- listen the event that renderer was recreated on Android/WP8<br>
|
||||
-- Listen the event that renderer was recreated on Android/WP8.<br>
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- lua NA<br>
|
||||
-- param event the event that renderer was recreated on Android/WP8.
|
||||
-- @function [parent=#ParticleSystemQuad] listenRendererRecreated
|
||||
-- @param self
|
||||
-- @param #cc.EventCustom event
|
||||
|
@ -43,7 +47,9 @@
|
|||
-- @return ParticleSystemQuad#ParticleSystemQuad ret (return value: cc.ParticleSystemQuad)
|
||||
|
||||
--------------------------------
|
||||
-- creates a Particle Emitter with a number of particles
|
||||
-- Creates a Particle Emitter with a number of particles.<br>
|
||||
-- param numberOfParticles A given number of particles.<br>
|
||||
-- return An autoreleased ParticleSystemQuad object.
|
||||
-- @function [parent=#ParticleSystemQuad] createWithTotalParticles
|
||||
-- @param self
|
||||
-- @param #int numberOfParticles
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- Used for grab part of screen to a texture.rtBegin: the position of renderTexture on the fullRectfullRect: the total size of screenfullViewport: the total viewportSize
|
||||
-- Used for grab part of screen to a texture. <br>
|
||||
-- param rtBegin The position of renderTexture on the fullRect.<br>
|
||||
-- param fullRect The total size of screen.<br>
|
||||
-- param fullViewport The total viewportSize.
|
||||
-- @function [parent=#RenderTexture] setVirtualViewport
|
||||
-- @param self
|
||||
-- @param #vec2_table rtBegin
|
||||
|
@ -14,73 +17,82 @@
|
|||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- clears the texture with a specified stencil value
|
||||
-- Clears the texture with a specified stencil value.<br>
|
||||
-- param A specified stencil value.
|
||||
-- @function [parent=#RenderTexture] clearStencil
|
||||
-- @param self
|
||||
-- @param #int stencilValue
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- Value for clearDepth. Valid only when "autoDraw" is true.
|
||||
-- Value for clearDepth. Valid only when "autoDraw" is true. <br>
|
||||
-- return Value for clearDepth.
|
||||
-- @function [parent=#RenderTexture] getClearDepth
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- Value for clear Stencil. Valid only when "autoDraw" is true
|
||||
-- Value for clear Stencil. Valid only when "autoDraw" is true.<br>
|
||||
-- return Value for clear Stencil.
|
||||
-- @function [parent=#RenderTexture] getClearStencil
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- ends grabbing
|
||||
-- Ends grabbing.
|
||||
-- @function [parent=#RenderTexture] end
|
||||
-- @param self
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set Value for clear Stencil.<br>
|
||||
-- param clearStencil Value for clear Stencil.
|
||||
-- @function [parent=#RenderTexture] setClearStencil
|
||||
-- @param self
|
||||
-- @param #int clearStencil
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- Sets the Sprite being used.
|
||||
-- Sets the Sprite being used. <br>
|
||||
-- param A Sprite.
|
||||
-- @function [parent=#RenderTexture] setSprite
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- Gets the Sprite being used.
|
||||
-- Gets the Sprite being used. <br>
|
||||
-- return A Sprite.
|
||||
-- @function [parent=#RenderTexture] getSprite
|
||||
-- @param self
|
||||
-- @return Sprite#Sprite ret (return value: cc.Sprite)
|
||||
|
||||
--------------------------------
|
||||
-- When enabled, it will render its children into the texture automatically. Disabled by default for compatiblity reasons.<br>
|
||||
-- Will be enabled in the future.
|
||||
-- Will be enabled in the future.<br>
|
||||
-- return Return the autoDraw value.
|
||||
-- @function [parent=#RenderTexture] isAutoDraw
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Flag: Use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.<br>
|
||||
-- param keepMatrix Wether or not use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.
|
||||
-- @function [parent=#RenderTexture] setKeepMatrix
|
||||
-- @param self
|
||||
-- @param #bool keepMatrix
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set flags.<br>
|
||||
-- param clearFlags Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT.
|
||||
-- @function [parent=#RenderTexture] setClearFlags
|
||||
-- @param self
|
||||
-- @param #unsigned int clearFlags
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- starts grabbing
|
||||
-- Starts grabbing.
|
||||
-- @function [parent=#RenderTexture] begin
|
||||
-- @param self
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
@ -97,21 +109,23 @@
|
|||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set a valve to control whether or not render its children into the texture automatically. <br>
|
||||
-- param isAutoDraw Whether or not render its children into the texture automatically.
|
||||
-- @function [parent=#RenderTexture] setAutoDraw
|
||||
-- @param self
|
||||
-- @param #bool isAutoDraw
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set color value. <br>
|
||||
-- param clearColor Color value.
|
||||
-- @function [parent=#RenderTexture] setClearColor
|
||||
-- @param self
|
||||
-- @param #color4f_table clearColor
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- 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.
|
||||
-- @function [parent=#RenderTexture] endToLua
|
||||
-- @param self
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
@ -131,20 +145,26 @@
|
|||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- clears the texture with a specified depth value
|
||||
-- Clears the texture with a specified depth value. <br>
|
||||
-- param A specified depth value.
|
||||
-- @function [parent=#RenderTexture] clearDepth
|
||||
-- @param self
|
||||
-- @param #float depthValue
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- Clear color value. Valid only when "autoDraw" is true.
|
||||
-- Clear color value. Valid only when "autoDraw" is true. <br>
|
||||
-- return Color value.
|
||||
-- @function [parent=#RenderTexture] getClearColor
|
||||
-- @param self
|
||||
-- @return color4f_table#color4f_table ret (return value: color4f_table)
|
||||
|
||||
--------------------------------
|
||||
-- clears the texture with a color
|
||||
-- Clears the texture with a color. <br>
|
||||
-- param r Red.<br>
|
||||
-- param g Green.<br>
|
||||
-- param b Blue.<br>
|
||||
-- param a Alpha.
|
||||
-- @function [parent=#RenderTexture] clear
|
||||
-- @param self
|
||||
-- @param #float r
|
||||
|
@ -154,7 +174,8 @@
|
|||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
-- Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw" is true.
|
||||
-- Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw" is true. <br>
|
||||
-- return Clear flags.
|
||||
-- @function [parent=#RenderTexture] getClearFlags
|
||||
-- @param self
|
||||
-- @return unsigned int#unsigned int ret (return value: unsigned int)
|
||||
|
@ -166,7 +187,8 @@
|
|||
-- @return Image#Image ret (return value: cc.Image)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set Value for clearDepth.<br>
|
||||
-- param clearDepth Value for clearDepth.
|
||||
-- @function [parent=#RenderTexture] setClearDepth
|
||||
-- @param self
|
||||
-- @param #float clearDepth
|
||||
|
@ -214,7 +236,9 @@
|
|||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- FIXME: should be procted.<br>
|
||||
-- but due to a bug in PowerVR + Android,<br>
|
||||
-- the constructor is public again.
|
||||
-- @function [parent=#RenderTexture] RenderTexture
|
||||
-- @param self
|
||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- remove the SpriteData from Sprite3D by given the specified key
|
||||
-- @function [parent=#Sprite3DCache] removeSprite3DData
|
||||
-- @param self
|
||||
-- @param #string key
|
||||
-- @return Sprite3DCache#Sprite3DCache self (return value: cc.Sprite3DCache)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- remove all the SpriteData from Sprite3D
|
||||
-- @function [parent=#Sprite3DCache] removeAllSprite3DData
|
||||
-- @param self
|
||||
-- @return Sprite3DCache#Sprite3DCache self (return value: cc.Sprite3DCache)
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Append the child. <br>
|
||||
-- param sprite A Sprite.
|
||||
-- @function [parent=#SpriteBatchNode] appendChild
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
|
@ -42,14 +43,19 @@
|
|||
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the Min image block index,in all child. <br>
|
||||
-- param sprite The parent sprite.<br>
|
||||
-- return Index.
|
||||
-- @function [parent=#SpriteBatchNode] lowestAtlasIndexInChild
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
-- @return long#long ret (return value: long)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the nearest index from the sprite in z.<br>
|
||||
-- param sprite The parent sprite.<br>
|
||||
-- param z Z order for drawing priority.<br>
|
||||
-- return Index.
|
||||
-- @function [parent=#SpriteBatchNode] atlasIndexForChild
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
|
@ -57,7 +63,8 @@
|
|||
-- @return long#long ret (return value: long)
|
||||
|
||||
--------------------------------
|
||||
-- sets the TextureAtlas object
|
||||
-- Sets the TextureAtlas object. <br>
|
||||
-- param textureAtlas The TextureAtlas object.
|
||||
-- @function [parent=#SpriteBatchNode] setTextureAtlas
|
||||
-- @param self
|
||||
-- @param #cc.TextureAtlas textureAtlas
|
||||
|
@ -70,13 +77,14 @@
|
|||
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Increase the Atlas Capacity.
|
||||
-- @function [parent=#SpriteBatchNode] increaseAtlasCapacity
|
||||
-- @param self
|
||||
-- @return SpriteBatchNode#SpriteBatchNode self (return value: cc.SpriteBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- returns the TextureAtlas object
|
||||
-- Returns the TextureAtlas object. <br>
|
||||
-- return The TextureAtlas object.
|
||||
-- @function [parent=#SpriteBatchNode] getTextureAtlas
|
||||
-- @param self
|
||||
-- @return TextureAtlas#TextureAtlas ret (return value: cc.TextureAtlas)
|
||||
|
@ -84,7 +92,7 @@
|
|||
--------------------------------
|
||||
-- Inserts a quad at a certain index into the texture atlas. The Sprite won't be added into the children array.<br>
|
||||
-- This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated.<br>
|
||||
-- For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)
|
||||
-- For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont).
|
||||
-- @function [parent=#SpriteBatchNode] insertQuadFromSprite
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
|
@ -99,7 +107,10 @@
|
|||
-- @return SpriteBatchNode#SpriteBatchNode self (return value: cc.SpriteBatchNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Rebuild index with a sprite all child. <br>
|
||||
-- param parent The parent sprite.<br>
|
||||
-- param index The child index.<br>
|
||||
-- return Index.
|
||||
-- @function [parent=#SpriteBatchNode] rebuildIndexInOrder
|
||||
-- @param self
|
||||
-- @param #cc.Sprite parent
|
||||
|
@ -107,15 +118,19 @@
|
|||
-- @return long#long ret (return value: long)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the Max image block index,in all child.<br>
|
||||
-- param sprite The parent sprite.<br>
|
||||
-- return Index.
|
||||
-- @function [parent=#SpriteBatchNode] highestAtlasIndexInChild
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
-- @return long#long ret (return value: long)
|
||||
|
||||
--------------------------------
|
||||
-- removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.<br>
|
||||
-- warning Removing a child from a SpriteBatchNode is very slow
|
||||
-- Removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.<br>
|
||||
-- param index A certain index.<br>
|
||||
-- param doCleanup Whether or not to cleanup the running actions.<br>
|
||||
-- warning Removing a child from a SpriteBatchNode is very slow.
|
||||
-- @function [parent=#SpriteBatchNode] removeChildAtIndex
|
||||
-- @param self
|
||||
-- @param #long index
|
||||
|
@ -123,7 +138,8 @@
|
|||
-- @return SpriteBatchNode#SpriteBatchNode self (return value: cc.SpriteBatchNode)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Remove a sprite from Atlas. <br>
|
||||
-- param sprite A Sprite.
|
||||
-- @function [parent=#SpriteBatchNode] removeSpriteFromAtlas
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
|
@ -131,8 +147,8 @@
|
|||
|
||||
--------------------------------
|
||||
-- code<br>
|
||||
-- When this function bound into js or lua,the parameter will be changed<br>
|
||||
-- In js: var setBlendFunc(var src, var dst)<br>
|
||||
-- When this function bound into js or lua,the parameter will be changed.<br>
|
||||
-- In js: var setBlendFunc(var src, var dst).<br>
|
||||
-- endcode<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#SpriteBatchNode] setBlendFunc
|
||||
|
@ -141,9 +157,12 @@
|
|||
-- @return SpriteBatchNode#SpriteBatchNode self (return value: cc.SpriteBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- creates a SpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children.<br>
|
||||
-- Creates a SpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children.<br>
|
||||
-- The capacity will be increased in 33% in runtime if it runs out of space.<br>
|
||||
-- The file will be loaded using the TextureMgr.
|
||||
-- The file will be loaded using the TextureMgr.<br>
|
||||
-- param fileImage A file image (.png, .jpeg, .pvr, etc).<br>
|
||||
-- param capacity The capacity of children.<br>
|
||||
-- return Return an autorelease object.
|
||||
-- @function [parent=#SpriteBatchNode] create
|
||||
-- @param self
|
||||
-- @param #string fileImage
|
||||
|
@ -151,8 +170,11 @@
|
|||
-- @return SpriteBatchNode#SpriteBatchNode ret (return value: cc.SpriteBatchNode)
|
||||
|
||||
--------------------------------
|
||||
-- creates a SpriteBatchNode with a texture2d and capacity of children.<br>
|
||||
-- The capacity will be increased in 33% in runtime if it runs out of space.
|
||||
-- Creates a SpriteBatchNode with a texture2d and capacity of children.<br>
|
||||
-- The capacity will be increased in 33% in runtime if it runs out of space.<br>
|
||||
-- param tex A texture2d.<br>
|
||||
-- param capacity The capacity of children.<br>
|
||||
-- return Return an autorelease object.
|
||||
-- @function [parent=#SpriteBatchNode] createWithTexture
|
||||
-- @param self
|
||||
-- @param #cc.Texture2D tex
|
||||
|
|
|
@ -5,54 +5,63 @@
|
|||
-- @parent_module ccexp
|
||||
|
||||
--------------------------------
|
||||
-- returns the position in points of a given tile coordinate
|
||||
-- Returns the position in points of a given tile coordinate.<br>
|
||||
-- param tileCoordinate The tile Coordinate.<br>
|
||||
-- return The position in points of a given tile coordinate.
|
||||
-- @function [parent=#TMXLayer] getPositionAt
|
||||
-- @param self
|
||||
-- @param #vec2_table tileCoordinate
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set Layer orientation, which is the same as the map orientation. <br>
|
||||
-- param orientation Layer orientation, which is the same as the map orientation.
|
||||
-- @function [parent=#TMXLayer] setLayerOrientation
|
||||
-- @param self
|
||||
-- @param #int orientation
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
-- size of the layer in tiles
|
||||
-- Size of the layer in tiles.<br>
|
||||
-- return Size of the layer in tiles.
|
||||
-- @function [parent=#TMXLayer] getLayerSize
|
||||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the size of the map's tile. <br>
|
||||
-- param size The new size of the map's tile.
|
||||
-- @function [parent=#TMXLayer] setMapTileSize
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
-- Layer orientation, which is the same as the map orientation
|
||||
-- Layer orientation, which is the same as the map orientation.<br>
|
||||
-- return Layer orientation, which is the same as the map orientation.
|
||||
-- @function [parent=#TMXLayer] getLayerOrientation
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the properties to the layer.<br>
|
||||
-- param properties The properties to the layer.
|
||||
-- @function [parent=#TMXLayer] setProperties
|
||||
-- @param self
|
||||
-- @param #map_table properties
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the tile layer name.<br>
|
||||
-- param layerName The new layer name.
|
||||
-- @function [parent=#TMXLayer] setLayerName
|
||||
-- @param self
|
||||
-- @param #string layerName
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
-- removes a tile at given tile coordinate
|
||||
-- Removes a tile at given tile coordinate.<br>
|
||||
-- param tileCoordinate The tile Coordinate.
|
||||
-- @function [parent=#TMXLayer] removeTileAt
|
||||
-- @param self
|
||||
-- @param #vec2_table tileCoordinate
|
||||
|
@ -66,13 +75,16 @@
|
|||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
-- Creates the tiles
|
||||
-- Creates the tiles.
|
||||
-- @function [parent=#TMXLayer] setupTiles
|
||||
-- @param self
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set an sprite to the tile,with the tile coordinate and gid.<br>
|
||||
-- param sprite A Sprite.<br>
|
||||
-- param pos The tile coordinate.<br>
|
||||
-- param gid The tile gid.
|
||||
-- @function [parent=#TMXLayer] setupTileSprite
|
||||
-- @param self
|
||||
-- @param #cc.Sprite sprite
|
||||
|
@ -91,57 +103,69 @@
|
|||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
-- size of the map's tile (could be different from the tile's size)
|
||||
-- Size of the map's tile (could be different from the tile's size).<br>
|
||||
-- return Size of the map's tile (could be different from the tile's size).
|
||||
-- @function [parent=#TMXLayer] getMapTileSize
|
||||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
||||
--------------------------------
|
||||
-- return the value for the specific property name
|
||||
-- Return the value for the specific property name.<br>
|
||||
-- param propertyName The value for the specific property name.<br>
|
||||
-- return The value for the specific property name.
|
||||
-- @function [parent=#TMXLayer] getProperty
|
||||
-- @param self
|
||||
-- @param #string propertyName
|
||||
-- @return Value#Value ret (return value: cc.Value)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the size of the layer in tiles. <br>
|
||||
-- param size The new size of the layer in tiles.
|
||||
-- @function [parent=#TMXLayer] setLayerSize
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the tile layer name.<br>
|
||||
-- return The tile layer name.
|
||||
-- @function [parent=#TMXLayer] getLayerName
|
||||
-- @param self
|
||||
-- @return string#string ret (return value: string)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the tileset information for the layer. <br>
|
||||
-- param info The new tileset information for the layer.
|
||||
-- @function [parent=#TMXLayer] setTileSet
|
||||
-- @param self
|
||||
-- @param #cc.TMXTilesetInfo info
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer self (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
-- Tileset information for the layer
|
||||
-- Tileset information for the layer.<br>
|
||||
-- return Tileset information for the layer.
|
||||
-- @function [parent=#TMXLayer] getTileSet
|
||||
-- @param self
|
||||
-- @return TMXTilesetInfo#TMXTilesetInfo ret (return value: cc.TMXTilesetInfo)
|
||||
|
||||
--------------------------------
|
||||
-- returns the tile (Sprite) at a given a tile coordinate.<br>
|
||||
-- Returns the tile (Sprite) at a given a tile coordinate.<br>
|
||||
-- The returned Sprite will be already added to the TMXLayer. Don't add it again.<br>
|
||||
-- The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.<br>
|
||||
-- You can remove either by calling:<br>
|
||||
-- - layer->removeChild(sprite, cleanup);
|
||||
-- - layer->removeChild(sprite, cleanup);<br>
|
||||
-- return Returns the tile (Sprite) at a given a tile coordinate.
|
||||
-- @function [parent=#TMXLayer] getTileAt
|
||||
-- @param self
|
||||
-- @param #vec2_table tileCoordinate
|
||||
-- @return Sprite#Sprite ret (return value: cc.Sprite)
|
||||
|
||||
--------------------------------
|
||||
-- creates a FastTMXLayer with an tileset info, a layer info and a map info
|
||||
-- Creates a FastTMXLayer with an tileset info, a layer info and a map info.<br>
|
||||
-- param tilesetInfo An tileset info.<br>
|
||||
-- param layerInfo A layer info.<br>
|
||||
-- param mapInfo A map info.<br>
|
||||
-- return Reruen an autorelease object.
|
||||
-- @function [parent=#TMXLayer] create
|
||||
-- @param self
|
||||
-- @param #cc.TMXTilesetInfo tilesetInfo
|
||||
|
|
|
@ -5,28 +5,33 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- Sets the offset position of child objects
|
||||
-- Sets the offset position of child objects. <br>
|
||||
-- param offset The offset position of child objects.
|
||||
-- @function [parent=#TMXObjectGroup] setPositionOffset
|
||||
-- @param self
|
||||
-- @param #vec2_table offset
|
||||
-- @return TMXObjectGroup#TMXObjectGroup self (return value: cc.TMXObjectGroup)
|
||||
|
||||
--------------------------------
|
||||
-- return the value for the specific property name
|
||||
-- Return the value for the specific property name. <br>
|
||||
-- param propertyName The specific property name.<br>
|
||||
-- return Return the value for the specific property name.
|
||||
-- @function [parent=#TMXObjectGroup] getProperty
|
||||
-- @param self
|
||||
-- @param #string propertyName
|
||||
-- @return Value#Value ret (return value: cc.Value)
|
||||
|
||||
--------------------------------
|
||||
-- Gets the offset position of child objects
|
||||
-- Gets the offset position of child objects. <br>
|
||||
-- return The offset position of child objects.
|
||||
-- @function [parent=#TMXObjectGroup] getPositionOffset
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- return the dictionary for the specific object name.<br>
|
||||
-- It will return the 1st object found on the array for the given name.
|
||||
-- Return the dictionary for the specific object name.<br>
|
||||
-- It will return the 1st object found on the array for the given name.<br>
|
||||
-- return Return the dictionary for the specific object name.
|
||||
-- @function [parent=#TMXObjectGroup] getObject
|
||||
-- @param self
|
||||
-- @param #string objectName
|
||||
|
@ -40,7 +45,8 @@
|
|||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the group name. <br>
|
||||
-- param groupname A string,it is used to set the group name.
|
||||
-- @function [parent=#TMXObjectGroup] setGroupName
|
||||
-- @param self
|
||||
-- @param #string groupName
|
||||
|
@ -54,20 +60,23 @@
|
|||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Get the group name. <br>
|
||||
-- return The group name.
|
||||
-- @function [parent=#TMXObjectGroup] getGroupName
|
||||
-- @param self
|
||||
-- @return string#string ret (return value: string)
|
||||
|
||||
--------------------------------
|
||||
-- Sets the list of properties
|
||||
-- Sets the list of properties.<br>
|
||||
-- param properties The list of properties.
|
||||
-- @function [parent=#TMXObjectGroup] setProperties
|
||||
-- @param self
|
||||
-- @param #map_table properties
|
||||
-- @return TMXObjectGroup#TMXObjectGroup self (return value: cc.TMXObjectGroup)
|
||||
|
||||
--------------------------------
|
||||
-- Sets the array of the objects
|
||||
-- Sets the array of the objects.<br>
|
||||
-- param objects The array of the objects.
|
||||
-- @function [parent=#TMXObjectGroup] setObjects
|
||||
-- @param self
|
||||
-- @param #array_table objects
|
||||
|
|
|
@ -5,28 +5,32 @@
|
|||
-- @parent_module ccexp
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set object groups. <br>
|
||||
-- param groups An object groups.
|
||||
-- @function [parent=#TMXTiledMap] setObjectGroups
|
||||
-- @param self
|
||||
-- @param #array_table groups
|
||||
-- @return experimental::TMXTiledMap#experimental::TMXTiledMap self (return value: cc.experimental::TMXTiledMap)
|
||||
|
||||
--------------------------------
|
||||
-- return the value for the specific property name
|
||||
-- Return the value for the specific property name.<br>
|
||||
-- return Return the value for the specific property name.
|
||||
-- @function [parent=#TMXTiledMap] getProperty
|
||||
-- @param self
|
||||
-- @param #string propertyName
|
||||
-- @return Value#Value ret (return value: cc.Value)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the map's size property measured in tiles.<br>
|
||||
-- param mapSize The map's size property measured in tiles.
|
||||
-- @function [parent=#TMXTiledMap] setMapSize
|
||||
-- @param self
|
||||
-- @param #size_table mapSize
|
||||
-- @return experimental::TMXTiledMap#experimental::TMXTiledMap self (return value: cc.experimental::TMXTiledMap)
|
||||
|
||||
--------------------------------
|
||||
-- return the TMXObjectGroup for the specific group
|
||||
-- Return the TMXObjectGroup for the specific group. <br>
|
||||
-- return Return the TMXObjectGroup for the specific group.
|
||||
-- @function [parent=#TMXTiledMap] getObjectGroup
|
||||
-- @param self
|
||||
-- @param #string groupName
|
||||
|
@ -40,73 +44,86 @@
|
|||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- the tiles's size property measured in pixels
|
||||
-- The tiles's size property measured in pixels.<br>
|
||||
-- return The tiles's size property measured in pixels.
|
||||
-- @function [parent=#TMXTiledMap] getTileSize
|
||||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
||||
--------------------------------
|
||||
-- the map's size property measured in tiles
|
||||
-- The map's size property measured in tiles. <br>
|
||||
-- return The map's size property measured in tiles.
|
||||
-- @function [parent=#TMXTiledMap] getMapSize
|
||||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
||||
--------------------------------
|
||||
-- properties
|
||||
-- Get properties.<br>
|
||||
-- return Properties.
|
||||
-- @function [parent=#TMXTiledMap] getProperties
|
||||
-- @param self
|
||||
-- @return map_table#map_table ret (return value: map_table)
|
||||
|
||||
--------------------------------
|
||||
-- return properties dictionary for tile GID
|
||||
-- Return properties dictionary for tile GID.<br>
|
||||
-- return Return properties dictionary for tile GID.
|
||||
-- @function [parent=#TMXTiledMap] getPropertiesForGID
|
||||
-- @param self
|
||||
-- @param #int GID
|
||||
-- @return Value#Value ret (return value: cc.Value)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the tiles's size property measured in pixels. <br>
|
||||
-- param tileSize The tiles's size property measured in pixels.
|
||||
-- @function [parent=#TMXTiledMap] setTileSize
|
||||
-- @param self
|
||||
-- @param #size_table tileSize
|
||||
-- @return experimental::TMXTiledMap#experimental::TMXTiledMap self (return value: cc.experimental::TMXTiledMap)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set properties. <br>
|
||||
-- param properties An ValueMap Properties.
|
||||
-- @function [parent=#TMXTiledMap] setProperties
|
||||
-- @param self
|
||||
-- @param #map_table properties
|
||||
-- @return experimental::TMXTiledMap#experimental::TMXTiledMap self (return value: cc.experimental::TMXTiledMap)
|
||||
|
||||
--------------------------------
|
||||
-- return the FastTMXLayer for the specific layer
|
||||
-- Return the FastTMXLayer for the specific layer. <br>
|
||||
-- return Return the FastTMXLayer for the specific layer.
|
||||
-- @function [parent=#TMXTiledMap] getLayer
|
||||
-- @param self
|
||||
-- @param #string layerName
|
||||
-- @return experimental::TMXLayer#experimental::TMXLayer ret (return value: cc.experimental::TMXLayer)
|
||||
|
||||
--------------------------------
|
||||
-- map orientation
|
||||
-- Get map orientation. <br>
|
||||
-- return The map orientation.
|
||||
-- @function [parent=#TMXTiledMap] getMapOrientation
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set map orientation. <br>
|
||||
-- param mapOrientation The map orientation.
|
||||
-- @function [parent=#TMXTiledMap] setMapOrientation
|
||||
-- @param self
|
||||
-- @param #int mapOrientation
|
||||
-- @return experimental::TMXTiledMap#experimental::TMXTiledMap self (return value: cc.experimental::TMXTiledMap)
|
||||
|
||||
--------------------------------
|
||||
-- creates a TMX Tiled Map with a TMX file.
|
||||
-- Creates a TMX Tiled Map with a TMX file.<br>
|
||||
-- return An autorelease object.
|
||||
-- @function [parent=#TMXTiledMap] create
|
||||
-- @param self
|
||||
-- @param #string tmxFile
|
||||
-- @return experimental::TMXTiledMap#experimental::TMXTiledMap ret (return value: cc.experimental::TMXTiledMap)
|
||||
|
||||
--------------------------------
|
||||
-- initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources
|
||||
-- Initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources. <br>
|
||||
-- param tmxString A TMX formatted XML string.<br>
|
||||
-- param resourcePath A path to TMX resources.<br>
|
||||
-- return An autorelease object.
|
||||
-- @function [parent=#TMXTiledMap] createWithXML
|
||||
-- @param self
|
||||
-- @param #string tmxString
|
||||
|
|
|
@ -5,44 +5,54 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- returns the previous touch location in screen coordinates
|
||||
-- Returns the previous touch location in screen coordinates. <br>
|
||||
-- return The previous touch location in screen coordinates.
|
||||
-- @function [parent=#Touch] getPreviousLocationInView
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- returns the current touch location in OpenGL coordinates
|
||||
-- Returns the current touch location in OpenGL coordinates.<br>
|
||||
-- return The current touch location in OpenGL coordinates.
|
||||
-- @function [parent=#Touch] getLocation
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- returns the delta of 2 current touches locations in screen coordinates
|
||||
-- Returns the delta of 2 current touches locations in screen coordinates.<br>
|
||||
-- return The delta of 2 current touches locations in screen coordinates.
|
||||
-- @function [parent=#Touch] getDelta
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- returns the start touch location in screen coordinates
|
||||
-- Returns the start touch location in screen coordinates.<br>
|
||||
-- return The start touch location in screen coordinates.
|
||||
-- @function [parent=#Touch] getStartLocationInView
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- returns the start touch location in OpenGL coordinates
|
||||
-- Returns the start touch location in OpenGL coordinates.<br>
|
||||
-- return The start touch location in OpenGL coordinates.
|
||||
-- @function [parent=#Touch] getStartLocation
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- Get touch id.<br>
|
||||
-- js getId<br>
|
||||
-- lua getId
|
||||
-- lua getId<br>
|
||||
-- return The id of touch.
|
||||
-- @function [parent=#Touch] getID
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Set the touch infomation. It always used to monitor touch event.<br>
|
||||
-- param id A given id<br>
|
||||
-- param x A given x coordinate.<br>
|
||||
-- param y A given y coordinate.
|
||||
-- @function [parent=#Touch] setTouchInfo
|
||||
-- @param self
|
||||
-- @param #int id
|
||||
|
@ -51,19 +61,21 @@
|
|||
-- @return Touch#Touch self (return value: cc.Touch)
|
||||
|
||||
--------------------------------
|
||||
-- returns the current touch location in screen coordinates
|
||||
-- Returns the current touch location in screen coordinates.<br>
|
||||
-- return The current touch location in screen coordinates.
|
||||
-- @function [parent=#Touch] getLocationInView
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
-- returns the previous touch location in OpenGL coordinates
|
||||
-- Returns the previous touch location in OpenGL coordinates.<br>
|
||||
-- return The previous touch location in OpenGL coordinates.
|
||||
-- @function [parent=#Touch] getPreviousLocation
|
||||
-- @param self
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Constructor.
|
||||
-- @function [parent=#Touch] Touch
|
||||
-- @param self
|
||||
-- @return Touch#Touch self (return value: cc.Touch)
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionCrossFade object.
|
||||
-- @function [parent=#TransitionCrossFade] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- returns the Ease action that will be performed on a linear action.<br>
|
||||
-- since v0.8.2
|
||||
-- Returns the Ease action that will be performed on a linear action.<br>
|
||||
-- since v0.8.2<br>
|
||||
-- param action A given interval action.<br>
|
||||
-- return The Ease action that will be performed on a linear action.
|
||||
-- @function [parent=#TransitionEaseScene] easeActionWithAction
|
||||
-- @param self
|
||||
-- @param #cc.ActionInterval action
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionFadeBL object.
|
||||
-- @function [parent=#TransitionFadeBL] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionFadeDown object.
|
||||
-- @function [parent=#TransitionFadeDown] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -12,14 +12,19 @@
|
|||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Returns the action that will be performed with size.<br>
|
||||
-- param size A given size.<br>
|
||||
-- return The action that will be performed.
|
||||
-- @function [parent=#TransitionFadeTR] actionWithSize
|
||||
-- @param self
|
||||
-- @param #size_table size
|
||||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionFadeTR object.
|
||||
-- @function [parent=#TransitionFadeTR] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionFadeUp object.
|
||||
-- @function [parent=#TransitionFadeUp] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionJumpZoom object.
|
||||
-- @function [parent=#TransitionJumpZoom] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionMoveInB object.
|
||||
-- @function [parent=#TransitionMoveInB] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- returns the action that will be performed
|
||||
-- Returns the action that will be performed. <br>
|
||||
-- return The action that will be performed.
|
||||
-- @function [parent=#TransitionMoveInL] action
|
||||
-- @param self
|
||||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
@ -18,7 +19,10 @@
|
|||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionMoveInL object.
|
||||
-- @function [parent=#TransitionMoveInL] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionMoveInR object.
|
||||
-- @function [parent=#TransitionMoveInR] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionMoveInT object.
|
||||
-- @function [parent=#TransitionMoveInT] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Returns the action that will be performed with size.<br>
|
||||
-- param size A given size.<br>
|
||||
-- return The action that will be performed.
|
||||
-- @function [parent=#TransitionPageTurn] actionWithSize
|
||||
-- @param self
|
||||
-- @param #size_table vector
|
||||
|
@ -13,8 +15,12 @@
|
|||
|
||||
--------------------------------
|
||||
-- Creates a base transition with duration and incoming scene.<br>
|
||||
-- If back is true then the effect is reversed to appear as if the incoming <br>
|
||||
-- scene is being turned from left over the outgoing scene.
|
||||
-- If back is true then the effect is reversed to appear as if the incoming<br>
|
||||
-- scene is being turned from left over the outgoing scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- param backwards If back is true then the effect is reversed to appear as if the incoming scene is being turned from left over the outgoing scene.<br>
|
||||
-- return True if initialize success.
|
||||
-- @function [parent=#TransitionPageTurn] initWithDuration
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
@ -25,7 +31,11 @@
|
|||
--------------------------------
|
||||
-- Creates a base transition with duration and incoming scene.<br>
|
||||
-- If back is true then the effect is reversed to appear as if the incoming<br>
|
||||
-- scene is being turned from left over the outgoing scene.
|
||||
-- scene is being turned from left over the outgoing scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- param backwards If back is true then the effect is reversed to appear as if the incoming scene is being turned from left over the outgoing scene.<br>
|
||||
-- return An autoreleased TransitionPageTurn object.
|
||||
-- @function [parent=#TransitionPageTurn] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgress object.
|
||||
-- @function [parent=#TransitionProgress] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgressHorizontal object.
|
||||
-- @function [parent=#TransitionProgressHorizontal] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgressInOut object.
|
||||
-- @function [parent=#TransitionProgressInOut] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgressOutIn object.
|
||||
-- @function [parent=#TransitionProgressOutIn] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgressRadialCCW object.
|
||||
-- @function [parent=#TransitionProgressRadialCCW] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgressRadialCW object.
|
||||
-- @function [parent=#TransitionProgressRadialCW] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return An autoreleased TransitionProgressVertical object.
|
||||
-- @function [parent=#TransitionProgressVertical] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionRotoZoom object.
|
||||
-- @function [parent=#TransitionRotoZoom] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,19 +5,22 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- called after the transition finishes
|
||||
-- Called after the transition finishes.
|
||||
-- @function [parent=#TransitionScene] finish
|
||||
-- @param self
|
||||
-- @return TransitionScene#TransitionScene self (return value: cc.TransitionScene)
|
||||
|
||||
--------------------------------
|
||||
-- used by some transitions to hide the outer scene
|
||||
-- Used by some transitions to hide the outer scene.
|
||||
-- @function [parent=#TransitionScene] hideOutShowIn
|
||||
-- @param self
|
||||
-- @return TransitionScene#TransitionScene self (return value: cc.TransitionScene)
|
||||
|
||||
--------------------------------
|
||||
-- creates a base transition with duration and incoming scene
|
||||
-- Creates a base transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionScene object.
|
||||
-- @function [parent=#TransitionScene] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- creates a base transition with duration and incoming scene
|
||||
-- Creates a transition with duration, incoming scene and orientation.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- param orientation A given orientation: LeftOver, RightOver, UpOver, DownOver.<br>
|
||||
-- return A autoreleased TransitionSceneOriented object.
|
||||
-- @function [parent=#TransitionSceneOriented] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionShrinkGrow object.
|
||||
-- @function [parent=#TransitionShrinkGrow] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- Creates a transition with duration and incoming scene.<br>
|
||||
-- param t Duration time, in seconds.<br>
|
||||
-- param scene A given scene.<br>
|
||||
-- return A autoreleased TransitionSlideInB object.
|
||||
-- @function [parent=#TransitionSlideInB] create
|
||||
-- @param self
|
||||
-- @param #float t
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue