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__
#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__
相关文章推荐
- printf函数以参数"%s"输出字符串时过程
- // 写一个函数,实现将一个字符串中的'/t'替换成四个'*', '/t'个数不定。如char *p="ht/thdsf/t/ttt/tfds dfsw/t ew/t",替换后p="ht****hdsf********tt****fds dfsw****
- 牛腩新闻发布系统 (3) 存过过程或函数""需要""参数,但未提供该参数
- 函数功能:传入一个数组,返回数组中第二大数。已知数组中的对象都是数字构成的字符串,且任意两元素不相等。 如传入:@[@"1",@"2",@"3",@"4"],返回@"3"
- 用 Split 函数将有序字符串(如"A1,A2,A3,A4,A5,A6")分散拆开为数组
- 填充指定字符串的每一节到指定长度,不够的在左恻用0补足,并将分隔符"-"去除,可用于排序的函数
- "Gdiplus::GdiplusBase::operator new 函数不接受3 个参数"问题的处理
- 已知字母序列【d, g, e, c, f, b, o, a】,请实现一个函数针对输入的一组字符串 input[] = {"bed", "dog", "dear", "eye"},按照字母顺序排序并打印
- 编写一个业务函数,实现字符串(前后各有三个空格,单词前后也均有空格) " i am student, you are teacher " , 各个单词首字符大写
- C#: 调用存储过程或函数显示"需要"参数,但未提供该参数的解决方法
- 关于ASP.net中的存储过程"为过程或函数指定的参数太多?"的问题
- "Gdiplus::GdiplusBase::operator new 函数不接受3 个参数"问题的处理
- 已知字母序列【d, g, e, c, f, b, o, a】,请实现一个函数针对输入的一组字符串 input[] = {"bed", "dog", "dear", "eye"},按照字母顺序排序并打印
- 把json格式对象转成可提交字符串格式,会过滤掉函数 {a: {b: 3}, b: [1], c: "d"} -> a.b=3&b[0]=1&c=d
- extern "c" 动态链接库符号表导出问题 以及函数参数压栈顺序
- Enterprise Library- Data Block使用oracle存储过程,字符串参数传入值为""时出现问题的解决
- 不用闭包,不用函数,实现传递"参数"的功能
- 各个浏览器对于JavaScript Date.parse函数参数-"短日期格式"的支持
- 介绍几个程序中关于"路径字符串"的函数
- C++怎么让函数返回固定长度字符串,比如给“zhangsan"返回原字符串加上4各空格,给“lisi"返回"lisi"加6