2013-10-12 15:25:45 +08:00
|
|
|
/****************************************************************************
|
2014-01-07 11:47:11 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2017-02-14 14:36:57 +08:00
|
|
|
Copyright (c) 2013-2017 Chukong Technologies
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2013-10-12 15:25:45 +08:00
|
|
|
|
2022-10-01 16:24:52 +08:00
|
|
|
https://axmolengine.github.io/
|
2013-10-12 15:25:45 +08:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2017-09-20 09:05:00 +08:00
|
|
|
#ifndef __PLATFORM_CCNS_H__
|
|
|
|
#define __PLATFORM_CCNS_H__
|
2013-10-12 15:25:45 +08:00
|
|
|
|
2023-06-11 13:08:08 +08:00
|
|
|
#include "math/Math.h"
|
2013-10-12 15:25:45 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2013-10-12 15:25:45 +08:00
|
|
|
|
|
|
|
/**
|
2015-03-27 15:31:42 +08:00
|
|
|
* @addtogroup base
|
2013-10-12 15:25:45 +08:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-03-19 21:03:28 +08:00
|
|
|
* @brief Returns a Core Graphics rectangle structure corresponding to the data in a given string.
|
2015-03-27 11:39:31 +08:00
|
|
|
* @param str A string object whose contents are of the form "{{x,y},{w, h}}",
|
2015-03-19 21:03:28 +08:00
|
|
|
* 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 Rect::ZERO.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
Rect AX_DLL RectFromString(std::string_view str);
|
2013-10-12 15:25:45 +08:00
|
|
|
|
|
|
|
/**
|
2015-03-19 21:03:28 +08:00
|
|
|
* @brief Returns a Core Graphics point structure corresponding to the data in a given string.
|
2015-03-27 11:39:31 +08:00
|
|
|
* @param str A string object whose contents are of the form "{x,y}",
|
2015-03-19 21:03:28 +08:00
|
|
|
* 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 Vec2::ZERO.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
Vec2 AX_DLL PointFromString(std::string_view str);
|
2013-10-12 15:25:45 +08:00
|
|
|
|
|
|
|
/**
|
2015-03-19 21:03:28 +08:00
|
|
|
* @brief Returns a Core Graphics size structure corresponding to the data in a given string.
|
2015-03-27 11:39:31 +08:00
|
|
|
* @param str A string object whose contents are of the form "{w, h}",
|
2015-03-19 21:03:28 +08:00
|
|
|
* 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.
|
2021-10-23 23:27:14 +08:00
|
|
|
* If the string is not well-formed, the function returns Vec2::ZERO.
|
2015-03-19 21:03:28 +08:00
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
Vec2 AX_DLL SizeFromString(std::string_view str);
|
2013-10-12 15:25:45 +08:00
|
|
|
|
|
|
|
// end of data_structure group
|
2015-03-19 21:03:28 +08:00
|
|
|
/** @} */
|
2013-10-12 15:25:45 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|
2013-10-12 15:25:45 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
#endif // __PLATFORM_CCNS_H__
|