CCNS(函数库CCPointFromString CCRectFromString CCSizeFromString 参数是字符串"{x,y}"、{{x,y},{w, h}}、"{w, h}")

来源:互联网 发布:淘宝快速冲销量的方法 编辑:程序博客网 时间:2024/05/02 01:06

#ifndef __PLATFOMR_CCNS_H__

#define __PLATFOMR_CCNS_H__


#include "CCGeometry.h"


NS_CC_BEGIN


/**

 * @addtogroup data_structures

 * @{

 */


/**

@brief Returns a Core(核心) Graphics(图形) rectangle(矩形) structure结构 corresponding(相应的) to(对应于) the data in a given string.

@param pszContent   A string object whose contents are of the form "{{x,y},{w, h}}",

                    where x is the x coordinate, y is the y coordinate, w is the width, and h is the height.

                    These components(组件) can represent(代表) integer or float values.

                    An example of a valid(有效地) string is "{{3,2},{4,5}}".

                    The string is not localized(本地化), so items are always separated with a comma(逗号).

@return A Core Graphics structure that represents a rectangle.

        If the string is not well-formed, the function returns CCRectZero.

*/

CCRect CC_DLL CCRectFromString(const char* pszContent);  //根据字符串得到一个ccrect 类似{{x,y},{w, h}}


/**

@brief Returns a Core Graphics point structure corresponding to the data in a given string.

@param pszContent   A string object whose contents are of the form "{x,y}",

                    where x is the x coordinate and y is the y coordinate.

                    The x and y values can represent integer or float values.

                    An example of a valid string is "{3.0,2.5}".

                    The string is not localized, so items are always separated with a comma.

@return A Core Graphics structure that represents a point.

        If the string is not well-formed, the function returns CCPointZero.

*/

CCPoint CC_DLL CCPointFromString(const char* pszContent); //根据字符串得到一个ccpoint类似 "{x,y}"


/**

@brief Returns a Core Graphics size structure corresponding to the data in a given string.

@param pszContent   A string object whose contents are of the form "{w, h}",

                    where w is the width and h is the height.

                    The w and h values can be integer or float values.

                    An example of a valid string is "{3.0,2.5}".

                    The string is not localized, so items are always separated with a comma.

@return A Core Graphics structure that represents a size.

        If the string is not well-formed, the function returns CCSizeZero.

*/

CCSize CC_DLL CCSizeFromString(const char* pszContent);  //根据字符串得到一个ccsize 类似 "{w, h}"


// end of data_structure group

/// @}


NS_CC_END


#endif // __PLATFOMR_CCNS_H__



0 0
原创粉丝点击