您的位置:首页 > 其它

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

2014-05-22 21:13 225 查看
#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__
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐