mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3_VideoPlayer
Conflicts: build/cocos2d_tests.xcodeproj/project.pbxproj
This commit is contained in:
commit
b3da322920
1
AUTHORS
1
AUTHORS
|
@ -656,6 +656,7 @@ Developers:
|
||||||
|
|
||||||
lite3
|
lite3
|
||||||
Fixed a bug that Node's anchor point was changed after being added to ScrollView.
|
Fixed a bug that Node's anchor point was changed after being added to ScrollView.
|
||||||
|
Added HttpClient::sendImmediate()
|
||||||
|
|
||||||
superrad
|
superrad
|
||||||
Clear NoSuchMethodError Exception when JniHelper fails to find methodID
|
Clear NoSuchMethodError Exception when JniHelper fails to find methodID
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
cocos2d-x-3.2 ???
|
cocos2d-x-3.2 ???
|
||||||
|
[NEW] HttpClient: added sendImmediate()
|
||||||
[NEW] Label: support setting line height and additional kerning of label that not using system font
|
[NEW] Label: support setting line height and additional kerning of label that not using system font
|
||||||
[NEW] Lua-binding: Animation3D supported
|
[NEW] Lua-binding: Animation3D supported
|
||||||
[NEW] Lua-binding: UIEditor test cases added
|
[NEW] Lua-binding: UIEditor test cases added
|
||||||
|
@ -6,6 +7,7 @@ cocos2d-x-3.2 ???
|
||||||
[NEW] Node: added getName(), setName(), getChildByName(), enumerateChildren()
|
[NEW] Node: added getName(), setName(), getChildByName(), enumerateChildren()
|
||||||
and addChild(Node* node, int localZOrder, const std::string &name)
|
and addChild(Node* node, int localZOrder, const std::string &name)
|
||||||
[NEW] Node: physical body supports rotation
|
[NEW] Node: physical body supports rotation
|
||||||
|
[NEW] utils: added findChildren() to find all children by name
|
||||||
|
|
||||||
|
|
||||||
[FIX] FileUtils: getStringFromFile may return a unterminated string
|
[FIX] FileUtils: getStringFromFile may return a unterminated string
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; };
|
1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; };
|
||||||
1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
|
1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
|
||||||
1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
|
1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
|
||||||
15AECE06195C0AC900907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
|
15B0870D195AD52000D6F62B /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; };
|
||||||
15C64825165F3934007D4F18 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };
|
15C64825165F3934007D4F18 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };
|
||||||
15C64827165F394E007D4F18 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };
|
15C64827165F394E007D4F18 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };
|
||||||
15C64829165F396B007D4F18 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };
|
15C64829165F396B007D4F18 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };
|
||||||
|
@ -1983,7 +1983,6 @@
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
15AECE06195C0AC900907DB0 /* MediaPlayer.framework in Frameworks */,
|
|
||||||
1ABCA3B018CDA06D0087CE3A /* libz.dylib in Frameworks */,
|
1ABCA3B018CDA06D0087CE3A /* libz.dylib in Frameworks */,
|
||||||
1ABCA3AA18CD9F1A0087CE3A /* CoreMotion.framework in Frameworks */,
|
1ABCA3AA18CD9F1A0087CE3A /* CoreMotion.framework in Frameworks */,
|
||||||
1ABCA3A918CD9F130087CE3A /* AudioToolbox.framework in Frameworks */,
|
1ABCA3A918CD9F130087CE3A /* AudioToolbox.framework in Frameworks */,
|
||||||
|
@ -4323,6 +4322,7 @@
|
||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
15B0870D195AD52000D6F62B /* ActionTimeline in Resources */,
|
||||||
15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */,
|
15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */,
|
||||||
15C90B4418E66C1800D69802 /* mime.lua in Resources */,
|
15C90B4418E66C1800D69802 /* mime.lua in Resources */,
|
||||||
15C90B4C18E66C3100D69802 /* url.lua in Resources */,
|
15C90B4C18E66C3100D69802 /* url.lua in Resources */,
|
||||||
|
|
|
@ -117,6 +117,19 @@ void captureScreen(const std::function<void(bool, const std::string&)>& afterCap
|
||||||
captureScreenCommand.func = std::bind(onCaptureScreen, afterCaptured, filename);
|
captureScreenCommand.func = std::bind(onCaptureScreen, afterCaptured, filename);
|
||||||
Director::getInstance()->getRenderer()->addCommand(&captureScreenCommand);
|
Director::getInstance()->getRenderer()->addCommand(&captureScreenCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Node*> findChildren(const Node &node, const std::string &name)
|
||||||
|
{
|
||||||
|
std::vector<Node*> vec;
|
||||||
|
|
||||||
|
node.enumerateChildren(name, [&vec](Node* nodeFound) -> bool {
|
||||||
|
vec.push_back(nodeFound);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -24,6 +24,10 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifndef __SUPPORT_CC_UTILS_H__
|
#ifndef __SUPPORT_CC_UTILS_H__
|
||||||
#define __SUPPORT_CC_UTILS_H__
|
#define __SUPPORT_CC_UTILS_H__
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include "2d/CCNode.h"
|
||||||
#include "base/ccMacros.h"
|
#include "base/ccMacros.h"
|
||||||
|
|
||||||
/** @file ccUtils.h
|
/** @file ccUtils.h
|
||||||
|
@ -58,6 +62,17 @@ namespace utils
|
||||||
* @since v3.2
|
* @since v3.2
|
||||||
*/
|
*/
|
||||||
void captureScreen(const std::function<void(bool, const std::string&)>& afterCaptured, const std::string& filename);
|
void captureScreen(const std::function<void(bool, const std::string&)>& afterCaptured, const std::string& filename);
|
||||||
|
|
||||||
|
/** Find children by name, it will return all child that has the same name.
|
||||||
|
* It supports c++ 11 regular expression. It is a helper function of `Node::enumerateChildren()`.
|
||||||
|
* You can refer to `Node::enumerateChildren()` for detail information.
|
||||||
|
*
|
||||||
|
* @param node The node to find
|
||||||
|
* @param name The name to search for, it supports c++ 11 expression
|
||||||
|
* @return Array of Nodes that matches the name
|
||||||
|
* @since v3.2
|
||||||
|
*/
|
||||||
|
std::vector<Node*> findChildren(const Node &node, const std::string &name);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -95,12 +95,12 @@ static size_t writeHeaderData(void *ptr, size_t size, size_t nmemb, void *stream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);
|
static int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer);
|
||||||
static int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);
|
static int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer);
|
||||||
static int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);
|
static int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer);
|
||||||
static int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);
|
static int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream, char *errorBuffer);
|
||||||
// int processDownloadTask(HttpRequest *task, write_callback callback, void *stream, int32_t *errorCode);
|
// int processDownloadTask(HttpRequest *task, write_callback callback, void *stream, int32_t *errorCode);
|
||||||
|
static void processResponse(HttpResponse* response, char* errorBuffer);
|
||||||
|
|
||||||
// Worker thread
|
// Worker thread
|
||||||
void HttpClient::networkThread()
|
void HttpClient::networkThread()
|
||||||
|
@ -144,69 +144,7 @@ void HttpClient::networkThread()
|
||||||
// Create a HttpResponse object, the default setting is http access failed
|
// Create a HttpResponse object, the default setting is http access failed
|
||||||
HttpResponse *response = new HttpResponse(request);
|
HttpResponse *response = new HttpResponse(request);
|
||||||
|
|
||||||
// request's refcount = 2 here, it's retained by HttpRespose constructor
|
processResponse(response, s_errorBuffer);
|
||||||
request->release();
|
|
||||||
// ok, refcount = 1 now, only HttpResponse hold it.
|
|
||||||
|
|
||||||
long responseCode = -1;
|
|
||||||
int retValue = 0;
|
|
||||||
|
|
||||||
// Process the request -> get response packet
|
|
||||||
switch (request->getRequestType())
|
|
||||||
{
|
|
||||||
case HttpRequest::Type::GET: // HTTP GET
|
|
||||||
retValue = processGetTask(request,
|
|
||||||
writeData,
|
|
||||||
response->getResponseData(),
|
|
||||||
&responseCode,
|
|
||||||
writeHeaderData,
|
|
||||||
response->getResponseHeader());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HttpRequest::Type::POST: // HTTP POST
|
|
||||||
retValue = processPostTask(request,
|
|
||||||
writeData,
|
|
||||||
response->getResponseData(),
|
|
||||||
&responseCode,
|
|
||||||
writeHeaderData,
|
|
||||||
response->getResponseHeader());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HttpRequest::Type::PUT:
|
|
||||||
retValue = processPutTask(request,
|
|
||||||
writeData,
|
|
||||||
response->getResponseData(),
|
|
||||||
&responseCode,
|
|
||||||
writeHeaderData,
|
|
||||||
response->getResponseHeader());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HttpRequest::Type::DELETE:
|
|
||||||
retValue = processDeleteTask(request,
|
|
||||||
writeData,
|
|
||||||
response->getResponseData(),
|
|
||||||
&responseCode,
|
|
||||||
writeHeaderData,
|
|
||||||
response->getResponseHeader());
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
CCASSERT(true, "CCHttpClient: unkown request type, only GET and POSt are supported");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// write data to HttpResponse
|
|
||||||
response->setResponseCode(responseCode);
|
|
||||||
|
|
||||||
if (retValue != 0)
|
|
||||||
{
|
|
||||||
response->setSucceed(false);
|
|
||||||
response->setErrorBuffer(s_errorBuffer);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
response->setSucceed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// add response packet into queue
|
// add response packet into queue
|
||||||
|
@ -234,15 +172,43 @@ void HttpClient::networkThread()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Worker thread
|
||||||
|
void HttpClient::networkThreadAlone(HttpRequest* request)
|
||||||
|
{
|
||||||
|
// Create a HttpResponse object, the default setting is http access failed
|
||||||
|
HttpResponse *response = new HttpResponse(request);
|
||||||
|
char errorBuffer[CURL_ERROR_SIZE] = { 0 };
|
||||||
|
processResponse(response, errorBuffer);
|
||||||
|
|
||||||
|
auto scheduler = Director::getInstance()->getScheduler();
|
||||||
|
scheduler->performFunctionInCocosThread([response, request]{
|
||||||
|
const ccHttpRequestCallback& callback = request->getCallback();
|
||||||
|
Ref* pTarget = request->getTarget();
|
||||||
|
SEL_HttpResponse pSelector = request->getSelector();
|
||||||
|
|
||||||
|
if (callback != nullptr)
|
||||||
|
{
|
||||||
|
callback(s_pHttpClient, response);
|
||||||
|
}
|
||||||
|
else if (pTarget && pSelector)
|
||||||
|
{
|
||||||
|
(pTarget->*pSelector)(s_pHttpClient, response);
|
||||||
|
}
|
||||||
|
response->release();
|
||||||
|
// do not release in other thread
|
||||||
|
request->release();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//Configure curl's timeout property
|
//Configure curl's timeout property
|
||||||
static bool configureCURL(CURL *handle)
|
static bool configureCURL(CURL *handle, char *errorBuffer)
|
||||||
{
|
{
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t code;
|
int32_t code;
|
||||||
code = curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, s_errorBuffer);
|
code = curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errorBuffer);
|
||||||
if (code != CURLE_OK) {
|
if (code != CURLE_OK) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -298,11 +264,11 @@ public:
|
||||||
* @param callback Response write callback
|
* @param callback Response write callback
|
||||||
* @param stream Response write stream
|
* @param stream Response write stream
|
||||||
*/
|
*/
|
||||||
bool init(HttpRequest *request, write_callback callback, void *stream, write_callback headerCallback, void *headerStream)
|
bool init(HttpRequest *request, write_callback callback, void *stream, write_callback headerCallback, void *headerStream, char *errorBuffer)
|
||||||
{
|
{
|
||||||
if (!_curl)
|
if (!_curl)
|
||||||
return false;
|
return false;
|
||||||
if (!configureCURL(_curl))
|
if (!configureCURL(_curl, errorBuffer))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* get custom header data (if set) */
|
/* get custom header data (if set) */
|
||||||
|
@ -350,20 +316,20 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//Process Get Request
|
//Process Get Request
|
||||||
static int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)
|
static int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer)
|
||||||
{
|
{
|
||||||
CURLRaii curl;
|
CURLRaii curl;
|
||||||
bool ok = curl.init(request, callback, stream, headerCallback, headerStream)
|
bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer)
|
||||||
&& curl.setOption(CURLOPT_FOLLOWLOCATION, true)
|
&& curl.setOption(CURLOPT_FOLLOWLOCATION, true)
|
||||||
&& curl.perform(responseCode);
|
&& curl.perform(responseCode);
|
||||||
return ok ? 0 : 1;
|
return ok ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Process POST Request
|
//Process POST Request
|
||||||
static int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)
|
static int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer)
|
||||||
{
|
{
|
||||||
CURLRaii curl;
|
CURLRaii curl;
|
||||||
bool ok = curl.init(request, callback, stream, headerCallback, headerStream)
|
bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer)
|
||||||
&& curl.setOption(CURLOPT_POST, 1)
|
&& curl.setOption(CURLOPT_POST, 1)
|
||||||
&& curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData())
|
&& curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData())
|
||||||
&& curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize())
|
&& curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize())
|
||||||
|
@ -372,10 +338,10 @@ static int processPostTask(HttpRequest *request, write_callback callback, void *
|
||||||
}
|
}
|
||||||
|
|
||||||
//Process PUT Request
|
//Process PUT Request
|
||||||
static int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)
|
static int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer)
|
||||||
{
|
{
|
||||||
CURLRaii curl;
|
CURLRaii curl;
|
||||||
bool ok = curl.init(request, callback, stream, headerCallback, headerStream)
|
bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer)
|
||||||
&& curl.setOption(CURLOPT_CUSTOMREQUEST, "PUT")
|
&& curl.setOption(CURLOPT_CUSTOMREQUEST, "PUT")
|
||||||
&& curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData())
|
&& curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData())
|
||||||
&& curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize())
|
&& curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize())
|
||||||
|
@ -384,16 +350,86 @@ static int processPutTask(HttpRequest *request, write_callback callback, void *s
|
||||||
}
|
}
|
||||||
|
|
||||||
//Process DELETE Request
|
//Process DELETE Request
|
||||||
static int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)
|
static int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream, char *errorBuffer)
|
||||||
{
|
{
|
||||||
CURLRaii curl;
|
CURLRaii curl;
|
||||||
bool ok = curl.init(request, callback, stream, headerCallback, headerStream)
|
bool ok = curl.init(request, callback, stream, headerCallback, headerStream, errorBuffer)
|
||||||
&& curl.setOption(CURLOPT_CUSTOMREQUEST, "DELETE")
|
&& curl.setOption(CURLOPT_CUSTOMREQUEST, "DELETE")
|
||||||
&& curl.setOption(CURLOPT_FOLLOWLOCATION, true)
|
&& curl.setOption(CURLOPT_FOLLOWLOCATION, true)
|
||||||
&& curl.perform(responseCode);
|
&& curl.perform(responseCode);
|
||||||
return ok ? 0 : 1;
|
return ok ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Process Response
|
||||||
|
static void processResponse(HttpResponse* response, char* errorBuffer)
|
||||||
|
{
|
||||||
|
auto request = response->getHttpRequest();
|
||||||
|
long responseCode = -1;
|
||||||
|
int retValue = 0;
|
||||||
|
|
||||||
|
// Process the request -> get response packet
|
||||||
|
switch (request->getRequestType())
|
||||||
|
{
|
||||||
|
case HttpRequest::Type::GET: // HTTP GET
|
||||||
|
retValue = processGetTask(request,
|
||||||
|
writeData,
|
||||||
|
response->getResponseData(),
|
||||||
|
&responseCode,
|
||||||
|
writeHeaderData,
|
||||||
|
response->getResponseHeader(),
|
||||||
|
errorBuffer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HttpRequest::Type::POST: // HTTP POST
|
||||||
|
retValue = processPostTask(request,
|
||||||
|
writeData,
|
||||||
|
response->getResponseData(),
|
||||||
|
&responseCode,
|
||||||
|
writeHeaderData,
|
||||||
|
response->getResponseHeader(),
|
||||||
|
errorBuffer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HttpRequest::Type::PUT:
|
||||||
|
retValue = processPutTask(request,
|
||||||
|
writeData,
|
||||||
|
response->getResponseData(),
|
||||||
|
&responseCode,
|
||||||
|
writeHeaderData,
|
||||||
|
response->getResponseHeader(),
|
||||||
|
errorBuffer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HttpRequest::Type::DELETE:
|
||||||
|
retValue = processDeleteTask(request,
|
||||||
|
writeData,
|
||||||
|
response->getResponseData(),
|
||||||
|
&responseCode,
|
||||||
|
writeHeaderData,
|
||||||
|
response->getResponseHeader(),
|
||||||
|
errorBuffer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
CCASSERT(true, "CCHttpClient: unkown request type, only GET and POSt are supported");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// write data to HttpResponse
|
||||||
|
response->setResponseCode(responseCode);
|
||||||
|
|
||||||
|
if (retValue != 0)
|
||||||
|
{
|
||||||
|
response->setSucceed(false);
|
||||||
|
response->setErrorBuffer(errorBuffer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response->setSucceed(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HttpClient implementation
|
// HttpClient implementation
|
||||||
HttpClient* HttpClient::getInstance()
|
HttpClient* HttpClient::getInstance()
|
||||||
{
|
{
|
||||||
|
@ -445,10 +481,10 @@ bool HttpClient::lazyInitThreadSemphore()
|
||||||
s_requestQueue = new Vector<HttpRequest*>();
|
s_requestQueue = new Vector<HttpRequest*>();
|
||||||
s_responseQueue = new Vector<HttpResponse*>();
|
s_responseQueue = new Vector<HttpResponse*>();
|
||||||
|
|
||||||
|
s_need_quit = false;
|
||||||
|
|
||||||
auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this));
|
auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this));
|
||||||
t.detach();
|
t.detach();
|
||||||
|
|
||||||
s_need_quit = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -479,6 +515,18 @@ void HttpClient::send(HttpRequest* request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HttpClient::sendImmediate(HttpRequest* request)
|
||||||
|
{
|
||||||
|
if(!request)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
request->retain();
|
||||||
|
auto t = std::thread(&HttpClient::networkThreadAlone, this, request);
|
||||||
|
t.detach();
|
||||||
|
}
|
||||||
|
|
||||||
// Poll and notify main thread if responses exists in queue
|
// Poll and notify main thread if responses exists in queue
|
||||||
void HttpClient::dispatchResponseCallbacks()
|
void HttpClient::dispatchResponseCallbacks()
|
||||||
{
|
{
|
||||||
|
@ -516,6 +564,8 @@ void HttpClient::dispatchResponseCallbacks()
|
||||||
}
|
}
|
||||||
|
|
||||||
response->release();
|
response->release();
|
||||||
|
// do not release in other thread
|
||||||
|
request->release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,13 @@ public:
|
||||||
*/
|
*/
|
||||||
void send(HttpRequest* request);
|
void send(HttpRequest* request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Immediate send a request
|
||||||
|
* @param request a HttpRequest object, which includes url, response callback etc.
|
||||||
|
please make sure request->_requestData is clear before calling "sendImmediate" here.
|
||||||
|
*/
|
||||||
|
void sendImmediate(HttpRequest* request);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the connect timeout
|
* Change the connect timeout
|
||||||
|
@ -101,6 +108,7 @@ private:
|
||||||
*/
|
*/
|
||||||
bool lazyInitThreadSemphore();
|
bool lazyInitThreadSemphore();
|
||||||
void networkThread();
|
void networkThread();
|
||||||
|
void networkThreadAlone(HttpRequest* request);
|
||||||
/** Poll function called from main thread to dispatch callbacks when http requests finished **/
|
/** Poll function called from main thread to dispatch callbacks when http requests finished **/
|
||||||
void dispatchResponseCallbacks();
|
void dispatchResponseCallbacks();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionFadeFrame
|
||||||
|
-- @extend ActionFrame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFadeFrame] getOpacity
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFadeFrame] getAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFadeFrame] setOpacity
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFadeFrame] ActionFadeFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,67 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionFrame
|
||||||
|
-- @extend Ref
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- overload function: getAction(float, ccs.ActionFrame)
|
||||||
|
--
|
||||||
|
-- overload function: getAction(float)
|
||||||
|
--
|
||||||
|
-- @function [parent=#ActionFrame] getAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
-- @param #ccs.ActionFrame actionframe
|
||||||
|
-- @return ActionInterval#ActionInterval ret (retunr value: cc.ActionInterval)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] getFrameType
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] setFrameTime
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] setEasingType
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] getFrameTime
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] getFrameIndex
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] setFrameType
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] setFrameIndex
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] setEasingParameter
|
||||||
|
-- @param self
|
||||||
|
-- @param #array_table array
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] getEasingType
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionFrame] ActionFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionMoveFrame
|
||||||
|
-- @extend ActionFrame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionMoveFrame] setPosition
|
||||||
|
-- @param self
|
||||||
|
-- @param #vec2_table vec2
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionMoveFrame] getAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionMoveFrame] getPosition
|
||||||
|
-- @param self
|
||||||
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionMoveFrame] ActionMoveFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionRotationFrame
|
||||||
|
-- @extend ActionFrame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionRotationFrame] setRotation
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- overload function: getAction(float, ccs.ActionFrame)
|
||||||
|
--
|
||||||
|
-- overload function: getAction(float)
|
||||||
|
--
|
||||||
|
-- @function [parent=#ActionRotationFrame] getAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
-- @param #ccs.ActionFrame actionframe
|
||||||
|
-- @return ActionInterval#ActionInterval ret (retunr value: cc.ActionInterval)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionRotationFrame] getRotation
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionRotationFrame] ActionRotationFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,37 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionScaleFrame
|
||||||
|
-- @extend ActionFrame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionScaleFrame] setScaleY
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionScaleFrame] setScaleX
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionScaleFrame] getScaleY
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionScaleFrame] getScaleX
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionScaleFrame] getAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionScaleFrame] ActionScaleFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,136 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionTimeline
|
||||||
|
-- @extend Action
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] getTimelines
|
||||||
|
-- @param self
|
||||||
|
-- @return array_table#array_table ret (return value: array_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] getCurrentFrame
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] getStartFrame
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] pause
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] setFrameEventCallFunc
|
||||||
|
-- @param self
|
||||||
|
-- @param #function func
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] resume
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] getDuration
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] addTimeline
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.Timeline timeline
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] getEndFrame
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] setTimeSpeed
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] init
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] setDuration
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] getTimeSpeed
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] gotoFrameAndPause
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] isPlaying
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- overload function: gotoFrameAndPlay(int, bool)
|
||||||
|
--
|
||||||
|
-- overload function: gotoFrameAndPlay(int)
|
||||||
|
--
|
||||||
|
-- overload function: gotoFrameAndPlay(int, int, bool)
|
||||||
|
--
|
||||||
|
-- @function [parent=#ActionTimeline] gotoFrameAndPlay
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
-- @param #int int
|
||||||
|
-- @param #bool bool
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] removeTimeline
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.Timeline timeline
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] clearFrameEventCallFunc
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] create
|
||||||
|
-- @param self
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] step
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] startWithTarget
|
||||||
|
-- @param self
|
||||||
|
-- @param #cc.Node node
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] reverse
|
||||||
|
-- @param self
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] isDone
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimeline] ActionTimeline
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionTimelineCache
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] createAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] purge
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] init
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] loadAnimationActionWithContent
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
-- @param #string str
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] loadAnimationActionWithFile
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] removeAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTimelineCache] destroyInstance
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -18,6 +18,6 @@
|
||||||
-- @function [parent=#ActionTimelineData] create
|
-- @function [parent=#ActionTimelineData] create
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #int int
|
-- @param #int int
|
||||||
-- @return timeline::ActionTimelineData#timeline::ActionTimelineData ret (return value: ccs.timeline::ActionTimelineData)
|
-- @return ActionTimelineData#ActionTimelineData ret (return value: ccs.ActionTimelineData)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ActionTintFrame
|
||||||
|
-- @extend ActionFrame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTintFrame] getColor
|
||||||
|
-- @param self
|
||||||
|
-- @return color3b_table#color3b_table ret (return value: color3b_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTintFrame] getAction
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
-- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTintFrame] setColor
|
||||||
|
-- @param self
|
||||||
|
-- @param #color3b_table color3b
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ActionTintFrame] ActionTintFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module AnchorPointFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#AnchorPointFrame] setAnchorPoint
|
||||||
|
-- @param self
|
||||||
|
-- @param #vec2_table vec2
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#AnchorPointFrame] getAnchorPoint
|
||||||
|
-- @param self
|
||||||
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#AnchorPointFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return AnchorPointFrame#AnchorPointFrame ret (return value: ccs.AnchorPointFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#AnchorPointFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#AnchorPointFrame] AnchorPointFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ColorFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] getAlpha
|
||||||
|
-- @param self
|
||||||
|
-- @return unsigned char#unsigned char ret (return value: unsigned char)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] getColor
|
||||||
|
-- @param self
|
||||||
|
-- @return color3b_table#color3b_table ret (return value: color3b_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] setAlpha
|
||||||
|
-- @param self
|
||||||
|
-- @param #unsigned char char
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] setColor
|
||||||
|
-- @param self
|
||||||
|
-- @param #color3b_table color3b
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return ColorFrame#ColorFrame ret (return value: ccs.ColorFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ColorFrame] ColorFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module EventFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#EventFrame] setEvent
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#EventFrame] getEvent
|
||||||
|
-- @param self
|
||||||
|
-- @return string#string ret (return value: string)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#EventFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return EventFrame#EventFrame ret (return value: ccs.EventFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#EventFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#EventFrame] EventFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,57 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module Frame
|
||||||
|
-- @extend Ref
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] setNode
|
||||||
|
-- @param self
|
||||||
|
-- @param #cc.Node node
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] setTimeline
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.Timeline timeline
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] getFrameIndex
|
||||||
|
-- @param self
|
||||||
|
-- @return unsigned int#unsigned int ret (return value: unsigned int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] isTween
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] setFrameIndex
|
||||||
|
-- @param self
|
||||||
|
-- @param #unsigned int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] setTween
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool bool
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] getTimeline
|
||||||
|
-- @param self
|
||||||
|
-- @return Timeline#Timeline ret (return value: ccs.Timeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Frame] getNode
|
||||||
|
-- @param self
|
||||||
|
-- @return Node#Node ret (return value: cc.Node)
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module InnerActionFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] getInnerActionType
|
||||||
|
-- @param self
|
||||||
|
-- @return InnerActionType#InnerActionType ret (return value: ccs.InnerActionType)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] setStartFrameIndex
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] setInnerActionType
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.InnerActionType inneractiontype
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] getStartFrameIndex
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return InnerActionFrame#InnerActionFrame ret (return value: ccs.InnerActionFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#InnerActionFrame] InnerActionFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,59 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module NodeReader
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] setJsonPath
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] createNode
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
-- @return Node#Node ret (return value: cc.Node)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] loadNodeWithFile
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
-- @return Node#Node ret (return value: cc.Node)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] purge
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] init
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] loadNodeWithContent
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
-- @return Node#Node ret (return value: cc.Node)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] isRecordJsonPath
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] getJsonPath
|
||||||
|
-- @param self
|
||||||
|
-- @return string#string ret (return value: string)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] setRecordJsonPath
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool bool
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] destroyInstance
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#NodeReader] NodeReader
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,56 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module PositionFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] getX
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] getY
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] setPosition
|
||||||
|
-- @param self
|
||||||
|
-- @param #vec2_table vec2
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] setX
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] setY
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] getPosition
|
||||||
|
-- @param self
|
||||||
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return PositionFrame#PositionFrame ret (return value: ccs.PositionFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#PositionFrame] PositionFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module RotationFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationFrame] setRotation
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationFrame] getRotation
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return RotationFrame#RotationFrame ret (return value: ccs.RotationFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationFrame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationFrame] RotationFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module RotationSkewFrame
|
||||||
|
-- @extend SkewFrame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationSkewFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return RotationSkewFrame#RotationSkewFrame ret (return value: ccs.RotationSkewFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationSkewFrame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationSkewFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#RotationSkewFrame] RotationSkewFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,51 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ScaleFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] setScaleY
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] setScaleX
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] getScaleY
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] getScaleX
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] setScale
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return ScaleFrame#ScaleFrame ret (return value: ccs.ScaleFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ScaleFrame] ScaleFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module SkewFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] getSkewY
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] setSkewX
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] setSkewY
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] getSkewX
|
||||||
|
-- @param self
|
||||||
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return SkewFrame#SkewFrame ret (return value: ccs.SkewFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] apply
|
||||||
|
-- @param self
|
||||||
|
-- @param #float float
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#SkewFrame] SkewFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module TextureFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#TextureFrame] getTextureName
|
||||||
|
-- @param self
|
||||||
|
-- @return string#string ret (return value: string)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#TextureFrame] setNode
|
||||||
|
-- @param self
|
||||||
|
-- @param #cc.Node node
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#TextureFrame] setTextureName
|
||||||
|
-- @param self
|
||||||
|
-- @param #string str
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#TextureFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return TextureFrame#TextureFrame ret (return value: ccs.TextureFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#TextureFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#TextureFrame] TextureFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,82 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module Timeline
|
||||||
|
-- @extend Ref
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Timeline#Timeline ret (return value: ccs.Timeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] gotoFrame
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] setNode
|
||||||
|
-- @param self
|
||||||
|
-- @param #cc.Node node
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] getActionTimeline
|
||||||
|
-- @param self
|
||||||
|
-- @return ActionTimeline#ActionTimeline ret (return value: ccs.ActionTimeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] insertFrame
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.Frame frame
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] setActionTag
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] addFrame
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.Frame frame
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] getFrames
|
||||||
|
-- @param self
|
||||||
|
-- @return array_table#array_table ret (return value: array_table)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] getActionTag
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] getNode
|
||||||
|
-- @param self
|
||||||
|
-- @return Node#Node ret (return value: cc.Node)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] removeFrame
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.Frame frame
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] setActionTimeline
|
||||||
|
-- @param self
|
||||||
|
-- @param #ccs.ActionTimeline actiontimeline
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] stepToFrame
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] create
|
||||||
|
-- @param self
|
||||||
|
-- @return Timeline#Timeline ret (return value: ccs.Timeline)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#Timeline] Timeline
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module VisibleFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#VisibleFrame] isVisible
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#VisibleFrame] setVisible
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool bool
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#VisibleFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return VisibleFrame#VisibleFrame ret (return value: ccs.VisibleFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#VisibleFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#VisibleFrame] VisibleFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @module ZOrderFrame
|
||||||
|
-- @extend Frame
|
||||||
|
-- @parent_module ccs
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ZOrderFrame] getZOrder
|
||||||
|
-- @param self
|
||||||
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ZOrderFrame] setZOrder
|
||||||
|
-- @param self
|
||||||
|
-- @param #int int
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ZOrderFrame] create
|
||||||
|
-- @param self
|
||||||
|
-- @return ZOrderFrame#ZOrderFrame ret (return value: ccs.ZOrderFrame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ZOrderFrame] clone
|
||||||
|
-- @param self
|
||||||
|
-- @return Frame#Frame ret (return value: ccs.Frame)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- @function [parent=#ZOrderFrame] ZOrderFrame
|
||||||
|
-- @param self
|
||||||
|
|
||||||
|
return nil
|
|
@ -1,6 +1,36 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- @module ccs
|
-- @module ccs
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionFrame
|
||||||
|
-- @field [parent=#ccs] ActionFrame#ActionFrame ActionFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionMoveFrame
|
||||||
|
-- @field [parent=#ccs] ActionMoveFrame#ActionMoveFrame ActionMoveFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionScaleFrame
|
||||||
|
-- @field [parent=#ccs] ActionScaleFrame#ActionScaleFrame ActionScaleFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionRotationFrame
|
||||||
|
-- @field [parent=#ccs] ActionRotationFrame#ActionRotationFrame ActionRotationFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionFadeFrame
|
||||||
|
-- @field [parent=#ccs] ActionFadeFrame#ActionFadeFrame ActionFadeFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionTintFrame
|
||||||
|
-- @field [parent=#ccs] ActionTintFrame#ActionTintFrame ActionTintFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
-- the ccs ActionObject
|
-- the ccs ActionObject
|
||||||
-- @field [parent=#ccs] ActionObject#ActionObject ActionObject preloaded module
|
-- @field [parent=#ccs] ActionObject#ActionObject ActionObject preloaded module
|
||||||
|
@ -146,9 +176,94 @@
|
||||||
-- @field [parent=#ccs] SceneReader#SceneReader SceneReader preloaded module
|
-- @field [parent=#ccs] SceneReader#SceneReader SceneReader preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs NodeReader
|
||||||
|
-- @field [parent=#ccs] NodeReader#NodeReader NodeReader preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionTimelineCache
|
||||||
|
-- @field [parent=#ccs] ActionTimelineCache#ActionTimelineCache ActionTimelineCache preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs Frame
|
||||||
|
-- @field [parent=#ccs] Frame#Frame Frame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs VisibleFrame
|
||||||
|
-- @field [parent=#ccs] VisibleFrame#VisibleFrame VisibleFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs TextureFrame
|
||||||
|
-- @field [parent=#ccs] TextureFrame#TextureFrame TextureFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs RotationFrame
|
||||||
|
-- @field [parent=#ccs] RotationFrame#RotationFrame RotationFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs SkewFrame
|
||||||
|
-- @field [parent=#ccs] SkewFrame#SkewFrame SkewFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs RotationSkewFrame
|
||||||
|
-- @field [parent=#ccs] RotationSkewFrame#RotationSkewFrame RotationSkewFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs PositionFrame
|
||||||
|
-- @field [parent=#ccs] PositionFrame#PositionFrame PositionFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ScaleFrame
|
||||||
|
-- @field [parent=#ccs] ScaleFrame#ScaleFrame ScaleFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs AnchorPointFrame
|
||||||
|
-- @field [parent=#ccs] AnchorPointFrame#AnchorPointFrame AnchorPointFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs InnerActionFrame
|
||||||
|
-- @field [parent=#ccs] InnerActionFrame#InnerActionFrame InnerActionFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ColorFrame
|
||||||
|
-- @field [parent=#ccs] ColorFrame#ColorFrame ColorFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs EventFrame
|
||||||
|
-- @field [parent=#ccs] EventFrame#EventFrame EventFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ZOrderFrame
|
||||||
|
-- @field [parent=#ccs] ZOrderFrame#ZOrderFrame ZOrderFrame preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs Timeline
|
||||||
|
-- @field [parent=#ccs] Timeline#Timeline Timeline preloaded module
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
-- the ccs ActionTimelineData
|
-- the ccs ActionTimelineData
|
||||||
-- @field [parent=#ccs] ActionTimelineData#ActionTimelineData ActionTimelineData preloaded module
|
-- @field [parent=#ccs] ActionTimelineData#ActionTimelineData ActionTimelineData preloaded module
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------
|
||||||
|
-- the ccs ActionTimeline
|
||||||
|
-- @field [parent=#ccs] ActionTimeline#ActionTimeline ActionTimeline preloaded module
|
||||||
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -291,6 +291,185 @@ int register_all_cocos2dx_studio(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -405,6 +405,155 @@ static void extendBone(lua_State* L)
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lua_cocos2dx_studio_NodeReader_getInstance(lua_State* L)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertable(L,1,"ccs.NodeReader",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(L) - 1;
|
||||||
|
|
||||||
|
if (argc == 0)
|
||||||
|
{
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
cocostudio::timeline::NodeReader* ret = cocostudio::timeline::NodeReader::getInstance();
|
||||||
|
tolua_pushusertype(L,(void*)ret, "ccs.NodeReader");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getInstance",argc, 0);
|
||||||
|
return 0;
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(L,"#ferror in function 'lua_cocos2dx_studio_NodeReader_getInstance'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void extendNodeReader(lua_State* L)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "ccs.NodeReader");
|
||||||
|
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||||
|
if (lua_istable(L,-1))
|
||||||
|
{
|
||||||
|
tolua_function(L, "getInstance", lua_cocos2dx_studio_NodeReader_getInstance);
|
||||||
|
}
|
||||||
|
lua_pop(L, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int lua_cocos2dx_studio_ActionTimelineCache_getInstance(lua_State* L)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertable(L,1,"ccs.ActionTimelineCache",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(L) - 1;
|
||||||
|
|
||||||
|
if (argc == 0)
|
||||||
|
{
|
||||||
|
if(!ok)
|
||||||
|
return 0;
|
||||||
|
cocostudio::timeline::ActionTimelineCache* ret = cocostudio::timeline::ActionTimelineCache::getInstance();
|
||||||
|
tolua_pushusertype(L,(void*)ret, "ccs.ActionTimelineCache");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getInstance",argc, 0);
|
||||||
|
return 0;
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(L,"#ferror in function 'lua_cocos2dx_studio_ActionTimelineCache_getInstance'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void extendActionTimelineCache(lua_State* L)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "ccs.ActionTimelineCache");
|
||||||
|
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||||
|
if (lua_istable(L,-1))
|
||||||
|
{
|
||||||
|
tolua_function(L, "getInstance", lua_cocos2dx_studio_ActionTimelineCache_getInstance);
|
||||||
|
}
|
||||||
|
lua_pop(L, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int lua_cocos2dx_ActionTimeline_setFrameEventCallFunc(lua_State* L)
|
||||||
|
{
|
||||||
|
if (nullptr == L)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int argc = 0;
|
||||||
|
cocostudio::timeline::ActionTimeline* self = nullptr;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
if (!tolua_isusertype(L,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
self = static_cast<cocostudio::timeline::ActionTimeline*>(tolua_tousertype(L,1,0));
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (nullptr == self) {
|
||||||
|
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_ActionTimeline_setFrameEventCallFunc'\n", NULL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
argc = lua_gettop(L) - 1;
|
||||||
|
|
||||||
|
if (1 == argc)
|
||||||
|
{
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) )
|
||||||
|
{
|
||||||
|
goto tolua_lerror;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0));
|
||||||
|
self->setFrameEventCallFunc([=](cocostudio::timeline::Frame* frame){
|
||||||
|
toluafix_pushusertype_ccobject(L, frame->_ID, &frame->_luaID, (void*)frame, getLuaTypeName(frame, "ccs.Frame"));
|
||||||
|
LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CCLOG("'setFrameEventCallFunc' function of ActionTimeline has wrong number of arguments: %d, was expecting %d\n", argc, 1);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(L,"#ferror in function 'setFrameEventCallFunc'.",&tolua_err);
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void extendActionTimeline(lua_State* L)
|
||||||
|
{
|
||||||
|
lua_pushstring(L, "ccs.ActionTimeline");
|
||||||
|
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||||
|
if (lua_istable(L,-1))
|
||||||
|
{
|
||||||
|
tolua_function(L, "setFrameEventCallFunc", lua_cocos2dx_ActionTimeline_setFrameEventCallFunc);
|
||||||
|
}
|
||||||
|
lua_pop(L, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int register_all_cocos2dx_coco_studio_manual(lua_State* L)
|
int register_all_cocos2dx_coco_studio_manual(lua_State* L)
|
||||||
{
|
{
|
||||||
if (nullptr == L)
|
if (nullptr == L)
|
||||||
|
@ -412,6 +561,9 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L)
|
||||||
extendArmatureAnimation(L);
|
extendArmatureAnimation(L);
|
||||||
extendArmatureDataManager(L);
|
extendArmatureDataManager(L);
|
||||||
extendBone(L);
|
extendBone(L);
|
||||||
|
extendActionTimelineCache(L);
|
||||||
|
extendNodeReader(L);
|
||||||
|
extendActionTimeline(L);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3523,13 +3523,22 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Action.lua",
|
"cocos/scripting/lua-bindings/auto/api/Action.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionCamera.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionCamera.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionEase.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionEase.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionFadeFrame.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionInstant.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionInstant.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionInterval.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionInterval.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionManager.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionManager.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionManagerEx.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionManagerEx.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionMoveFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionObject.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionObject.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionRotationFrame.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionScaleFrame.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionTimeline.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionTimelineCache.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionTimelineData.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionTimelineData.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ActionTintFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ActionTween.lua",
|
"cocos/scripting/lua-bindings/auto/api/ActionTween.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/AnchorPointFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Animate.lua",
|
"cocos/scripting/lua-bindings/auto/api/Animate.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Animate3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/Animate3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Animation.lua",
|
"cocos/scripting/lua-bindings/auto/api/Animation.lua",
|
||||||
|
@ -3562,6 +3571,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/CatmullRomTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/CatmullRomTo.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/CheckBox.lua",
|
"cocos/scripting/lua-bindings/auto/api/CheckBox.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ClippingNode.lua",
|
"cocos/scripting/lua-bindings/auto/api/ClippingNode.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ColorFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ComAttribute.lua",
|
"cocos/scripting/lua-bindings/auto/api/ComAttribute.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ComAudio.lua",
|
"cocos/scripting/lua-bindings/auto/api/ComAudio.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ComController.lua",
|
"cocos/scripting/lua-bindings/auto/api/ComController.lua",
|
||||||
|
@ -3626,6 +3636,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/EventCustom.lua",
|
"cocos/scripting/lua-bindings/auto/api/EventCustom.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua",
|
"cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/EventFocus.lua",
|
"cocos/scripting/lua-bindings/auto/api/EventFocus.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/EventFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/EventKeyboard.lua",
|
"cocos/scripting/lua-bindings/auto/api/EventKeyboard.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/EventListener.lua",
|
"cocos/scripting/lua-bindings/auto/api/EventListener.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/EventListenerAcceleration.lua",
|
"cocos/scripting/lua-bindings/auto/api/EventListenerAcceleration.lua",
|
||||||
|
@ -3655,6 +3666,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/FlipY.lua",
|
"cocos/scripting/lua-bindings/auto/api/FlipY.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/FlipY3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/FlipY3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Follow.lua",
|
"cocos/scripting/lua-bindings/auto/api/Follow.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/Frame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/FrameData.lua",
|
"cocos/scripting/lua-bindings/auto/api/FrameData.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/GLProgram.lua",
|
"cocos/scripting/lua-bindings/auto/api/GLProgram.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/GLProgramCache.lua",
|
"cocos/scripting/lua-bindings/auto/api/GLProgramCache.lua",
|
||||||
|
@ -3671,6 +3683,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Hide.lua",
|
"cocos/scripting/lua-bindings/auto/api/Hide.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Image.lua",
|
"cocos/scripting/lua-bindings/auto/api/Image.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ImageView.lua",
|
"cocos/scripting/lua-bindings/auto/api/ImageView.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/InnerActionFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/JumpBy.lua",
|
"cocos/scripting/lua-bindings/auto/api/JumpBy.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/JumpTiles3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/JumpTiles3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/JumpTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/JumpTo.lua",
|
||||||
|
@ -3703,6 +3716,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/MovementData.lua",
|
"cocos/scripting/lua-bindings/auto/api/MovementData.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Node.lua",
|
"cocos/scripting/lua-bindings/auto/api/Node.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/NodeGrid.lua",
|
"cocos/scripting/lua-bindings/auto/api/NodeGrid.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/NodeReader.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua",
|
"cocos/scripting/lua-bindings/auto/api/OrbitCamera.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/PageTurn3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/PageTurn3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/PageView.lua",
|
"cocos/scripting/lua-bindings/auto/api/PageView.lua",
|
||||||
|
@ -3749,6 +3763,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/PhysicsShapePolygon.lua",
|
"cocos/scripting/lua-bindings/auto/api/PhysicsShapePolygon.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua",
|
"cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Place.lua",
|
"cocos/scripting/lua-bindings/auto/api/Place.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/PositionFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ProgressFromTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/ProgressFromTo.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ProgressTimer.lua",
|
"cocos/scripting/lua-bindings/auto/api/ProgressTimer.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ProgressTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/ProgressTo.lua",
|
||||||
|
@ -3769,8 +3784,11 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Ripple3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/Ripple3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/RotateBy.lua",
|
"cocos/scripting/lua-bindings/auto/api/RotateBy.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/RotateTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/RotateTo.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/RotationFrame.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/RotationSkewFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Scale9Sprite.lua",
|
"cocos/scripting/lua-bindings/auto/api/Scale9Sprite.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ScaleBy.lua",
|
"cocos/scripting/lua-bindings/auto/api/ScaleBy.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ScaleFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/ScaleTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/ScaleTo.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Scene.lua",
|
"cocos/scripting/lua-bindings/auto/api/Scene.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/SceneReader.lua",
|
"cocos/scripting/lua-bindings/auto/api/SceneReader.lua",
|
||||||
|
@ -3786,6 +3804,7 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Skeleton.lua",
|
"cocos/scripting/lua-bindings/auto/api/Skeleton.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/SkeletonAnimation.lua",
|
"cocos/scripting/lua-bindings/auto/api/SkeletonAnimation.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/SkewBy.lua",
|
"cocos/scripting/lua-bindings/auto/api/SkewBy.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/SkewFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/SkewTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/SkewTo.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Skin.lua",
|
"cocos/scripting/lua-bindings/auto/api/Skin.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Slider.lua",
|
"cocos/scripting/lua-bindings/auto/api/Slider.lua",
|
||||||
|
@ -3816,9 +3835,11 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Texture2D.lua",
|
"cocos/scripting/lua-bindings/auto/api/Texture2D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TextureCache.lua",
|
"cocos/scripting/lua-bindings/auto/api/TextureCache.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TextureData.lua",
|
"cocos/scripting/lua-bindings/auto/api/TextureData.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/TextureFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TileMapAtlas.lua",
|
"cocos/scripting/lua-bindings/auto/api/TileMapAtlas.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TiledGrid3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/TiledGrid3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TiledGrid3DAction.lua",
|
"cocos/scripting/lua-bindings/auto/api/TiledGrid3DAction.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/Timeline.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Timer.lua",
|
"cocos/scripting/lua-bindings/auto/api/Timer.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TintBy.lua",
|
"cocos/scripting/lua-bindings/auto/api/TintBy.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/TintTo.lua",
|
"cocos/scripting/lua-bindings/auto/api/TintTo.lua",
|
||||||
|
@ -3866,10 +3887,12 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Twirl.lua",
|
"cocos/scripting/lua-bindings/auto/api/Twirl.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/UserDefault.lua",
|
"cocos/scripting/lua-bindings/auto/api/UserDefault.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/VBox.lua",
|
"cocos/scripting/lua-bindings/auto/api/VBox.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/VisibleFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Waves.lua",
|
"cocos/scripting/lua-bindings/auto/api/Waves.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Waves3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/Waves3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/WavesTiles3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/WavesTiles3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Widget.lua",
|
"cocos/scripting/lua-bindings/auto/api/Widget.lua",
|
||||||
|
"cocos/scripting/lua-bindings/auto/api/ZOrderFrame.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua",
|
"cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua",
|
"cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_physics_auto_api.lua",
|
"cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_physics_auto_api.lua",
|
||||||
|
|
|
@ -14,6 +14,9 @@ HttpClientTest::HttpClientTest()
|
||||||
const int MARGIN = 40;
|
const int MARGIN = 40;
|
||||||
const int SPACE = 35;
|
const int SPACE = 35;
|
||||||
|
|
||||||
|
const int LEFT = winSize.width / 4;
|
||||||
|
const int RIGHT = winSize.width / 4 * 3;
|
||||||
|
|
||||||
auto label = Label::createWithTTF("Http Request Test", "fonts/arial.ttf", 28);
|
auto label = Label::createWithTTF("Http Request Test", "fonts/arial.ttf", 28);
|
||||||
label->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN));
|
label->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN));
|
||||||
addChild(label, 0);
|
addChild(label, 0);
|
||||||
|
@ -24,36 +27,66 @@ HttpClientTest::HttpClientTest()
|
||||||
|
|
||||||
// Get
|
// Get
|
||||||
auto labelGet = Label::createWithTTF("Test Get", "fonts/arial.ttf", 22);
|
auto labelGet = Label::createWithTTF("Test Get", "fonts/arial.ttf", 22);
|
||||||
auto itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this));
|
auto itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this, false));
|
||||||
itemGet->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - SPACE));
|
itemGet->setPosition(Vec2(LEFT, winSize.height - MARGIN - SPACE));
|
||||||
menuRequest->addChild(itemGet);
|
menuRequest->addChild(itemGet);
|
||||||
|
|
||||||
// Post
|
// Post
|
||||||
auto labelPost = Label::createWithTTF("Test Post", "fonts/arial.ttf", 22);
|
auto labelPost = Label::createWithTTF("Test Post", "fonts/arial.ttf", 22);
|
||||||
auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this));
|
auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this, false));
|
||||||
itemPost->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE));
|
itemPost->setPosition(Vec2(LEFT, winSize.height - MARGIN - 2 * SPACE));
|
||||||
menuRequest->addChild(itemPost);
|
menuRequest->addChild(itemPost);
|
||||||
|
|
||||||
// Post Binary
|
// Post Binary
|
||||||
auto labelPostBinary = Label::createWithTTF("Test Post Binary", "fonts/arial.ttf", 22);
|
auto labelPostBinary = Label::createWithTTF("Test Post Binary", "fonts/arial.ttf", 22);
|
||||||
auto itemPostBinary = MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this));
|
auto itemPostBinary = MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this, false));
|
||||||
itemPostBinary->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 3 * SPACE));
|
itemPostBinary->setPosition(Vec2(LEFT, winSize.height - MARGIN - 3 * SPACE));
|
||||||
menuRequest->addChild(itemPostBinary);
|
menuRequest->addChild(itemPostBinary);
|
||||||
|
|
||||||
// Put
|
// Put
|
||||||
auto labelPut = Label::createWithTTF("Test Put", "fonts/arial.ttf", 22);
|
auto labelPut = Label::createWithTTF("Test Put", "fonts/arial.ttf", 22);
|
||||||
auto itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this));
|
auto itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this, false));
|
||||||
itemPut->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 4 * SPACE));
|
itemPut->setPosition(Vec2(LEFT, winSize.height - MARGIN - 4 * SPACE));
|
||||||
menuRequest->addChild(itemPut);
|
menuRequest->addChild(itemPut);
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
auto labelDelete = Label::createWithTTF("Test Delete", "fonts/arial.ttf", 22);
|
auto labelDelete = Label::createWithTTF("Test Delete", "fonts/arial.ttf", 22);
|
||||||
auto itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this));
|
auto itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this, false));
|
||||||
itemDelete->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 5 * SPACE));
|
itemDelete->setPosition(Vec2(LEFT, winSize.height - MARGIN - 5 * SPACE));
|
||||||
|
menuRequest->addChild(itemDelete);
|
||||||
|
|
||||||
|
// Get for sendImmediate
|
||||||
|
labelGet = Label::createWithTTF("Test Immediate Get", "fonts/arial.ttf", 22);
|
||||||
|
itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this, true));
|
||||||
|
itemGet->setPosition(Vec2(RIGHT, winSize.height - MARGIN - SPACE));
|
||||||
|
menuRequest->addChild(itemGet);
|
||||||
|
|
||||||
|
// Post for sendImmediate
|
||||||
|
labelPost = Label::createWithTTF("Test Immediate Post", "fonts/arial.ttf", 22);
|
||||||
|
itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this, true));
|
||||||
|
itemPost->setPosition(Vec2(RIGHT, winSize.height - MARGIN - 2 * SPACE));
|
||||||
|
menuRequest->addChild(itemPost);
|
||||||
|
|
||||||
|
// Post Binary for sendImmediate
|
||||||
|
labelPostBinary = Label::createWithTTF("Test Immediate Post Binary", "fonts/arial.ttf", 22);
|
||||||
|
itemPostBinary = MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this, true));
|
||||||
|
itemPostBinary->setPosition(Vec2(RIGHT, winSize.height - MARGIN - 3 * SPACE));
|
||||||
|
menuRequest->addChild(itemPostBinary);
|
||||||
|
|
||||||
|
// Put for sendImmediate
|
||||||
|
labelPut = Label::createWithTTF("Test Immediate Put", "fonts/arial.ttf", 22);
|
||||||
|
itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this, true));
|
||||||
|
itemPut->setPosition(Vec2(RIGHT, winSize.height - MARGIN - 4 * SPACE));
|
||||||
|
menuRequest->addChild(itemPut);
|
||||||
|
|
||||||
|
// Delete for sendImmediate
|
||||||
|
labelDelete = Label::createWithTTF("Test Immediate Delete", "fonts/arial.ttf", 22);
|
||||||
|
itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this, true));
|
||||||
|
itemDelete->setPosition(Vec2(RIGHT, winSize.height - MARGIN - 5 * SPACE));
|
||||||
menuRequest->addChild(itemDelete);
|
menuRequest->addChild(itemDelete);
|
||||||
|
|
||||||
// Response Code Label
|
// Response Code Label
|
||||||
_labelStatusCode = Label::createWithTTF("HTTP Status Code", "fonts/arial.ttf", 22);
|
_labelStatusCode = Label::createWithTTF("HTTP Status Code", "fonts/arial.ttf", 18);
|
||||||
_labelStatusCode->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 6 * SPACE));
|
_labelStatusCode->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 6 * SPACE));
|
||||||
addChild(_labelStatusCode);
|
addChild(_labelStatusCode);
|
||||||
|
|
||||||
|
@ -70,7 +103,7 @@ HttpClientTest::~HttpClientTest()
|
||||||
HttpClient::destroyInstance();
|
HttpClient::destroyInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpClientTest::onMenuGetTestClicked(cocos2d::Ref *sender)
|
void HttpClientTest::onMenuGetTestClicked(cocos2d::Ref *sender, bool isImmediate)
|
||||||
{
|
{
|
||||||
// test 1
|
// test 1
|
||||||
{
|
{
|
||||||
|
@ -78,8 +111,15 @@ void HttpClientTest::onMenuGetTestClicked(cocos2d::Ref *sender)
|
||||||
request->setUrl("http://just-make-this-request-failed.com");
|
request->setUrl("http://just-make-this-request-failed.com");
|
||||||
request->setRequestType(HttpRequest::Type::GET);
|
request->setRequestType(HttpRequest::Type::GET);
|
||||||
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("GET immediate test1");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("GET test1");
|
request->setTag("GET test1");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,11 +130,15 @@ void HttpClientTest::onMenuGetTestClicked(cocos2d::Ref *sender)
|
||||||
request->setUrl("http://httpbin.org/ip");
|
request->setUrl("http://httpbin.org/ip");
|
||||||
request->setRequestType(HttpRequest::Type::GET);
|
request->setRequestType(HttpRequest::Type::GET);
|
||||||
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
||||||
// optional fields
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("GET immediate test2");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("GET test2");
|
request->setTag("GET test2");
|
||||||
|
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
// don't forget to release it, pair to new
|
// don't forget to release it, pair to new
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
@ -105,8 +149,15 @@ void HttpClientTest::onMenuGetTestClicked(cocos2d::Ref *sender)
|
||||||
request->setUrl("https://httpbin.org/get");
|
request->setUrl("https://httpbin.org/get");
|
||||||
request->setRequestType(HttpRequest::Type::GET);
|
request->setRequestType(HttpRequest::Type::GET);
|
||||||
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("GET immediate test3");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("GET test3");
|
request->setTag("GET test3");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +166,7 @@ void HttpClientTest::onMenuGetTestClicked(cocos2d::Ref *sender)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpClientTest::onMenuPostTestClicked(cocos2d::Ref *sender)
|
void HttpClientTest::onMenuPostTestClicked(cocos2d::Ref *sender, bool isImmediate)
|
||||||
{
|
{
|
||||||
// test 1
|
// test 1
|
||||||
{
|
{
|
||||||
|
@ -127,9 +178,15 @@ void HttpClientTest::onMenuPostTestClicked(cocos2d::Ref *sender)
|
||||||
// write the post data
|
// write the post data
|
||||||
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
||||||
request->setRequestData(postData, strlen(postData));
|
request->setRequestData(postData, strlen(postData));
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("POST immediate test1");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("POST test1");
|
request->setTag("POST test1");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,9 +203,15 @@ void HttpClientTest::onMenuPostTestClicked(cocos2d::Ref *sender)
|
||||||
// write the post data
|
// write the post data
|
||||||
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
||||||
request->setRequestData(postData, strlen(postData));
|
request->setRequestData(postData, strlen(postData));
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("POST immediate test2");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("POST test2");
|
request->setTag("POST test2");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +219,7 @@ void HttpClientTest::onMenuPostTestClicked(cocos2d::Ref *sender)
|
||||||
_labelStatusCode->setString("waiting...");
|
_labelStatusCode->setString("waiting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpClientTest::onMenuPostBinaryTestClicked(cocos2d::Ref *sender)
|
void HttpClientTest::onMenuPostBinaryTestClicked(cocos2d::Ref *sender, bool isImmediate)
|
||||||
{
|
{
|
||||||
HttpRequest* request = new HttpRequest();
|
HttpRequest* request = new HttpRequest();
|
||||||
request->setUrl("http://httpbin.org/post");
|
request->setUrl("http://httpbin.org/post");
|
||||||
|
@ -166,9 +229,15 @@ void HttpClientTest::onMenuPostBinaryTestClicked(cocos2d::Ref *sender)
|
||||||
// write the post data
|
// write the post data
|
||||||
char postData[22] = "binary=hello\0\0cocos2d"; // including \0, the strings after \0 should not be cut in response
|
char postData[22] = "binary=hello\0\0cocos2d"; // including \0, the strings after \0 should not be cut in response
|
||||||
request->setRequestData(postData, 22);
|
request->setRequestData(postData, 22);
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("POST Binary immediate test");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("POST Binary test");
|
request->setTag("POST Binary test");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
|
|
||||||
// waiting
|
// waiting
|
||||||
|
@ -177,7 +246,7 @@ void HttpClientTest::onMenuPostBinaryTestClicked(cocos2d::Ref *sender)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpClientTest::onMenuPutTestClicked(Ref *sender)
|
void HttpClientTest::onMenuPutTestClicked(Ref *sender, bool isImmediate)
|
||||||
{
|
{
|
||||||
// test 1
|
// test 1
|
||||||
{
|
{
|
||||||
|
@ -189,9 +258,15 @@ void HttpClientTest::onMenuPutTestClicked(Ref *sender)
|
||||||
// write the post data
|
// write the post data
|
||||||
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
||||||
request->setRequestData(postData, strlen(postData));
|
request->setRequestData(postData, strlen(postData));
|
||||||
|
if (isImmediate)
|
||||||
request->setTag("PUT test1");
|
{
|
||||||
|
request->setTag("PUT Binary immediate test1");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
request->setTag("PUT Binary test1");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,9 +283,15 @@ void HttpClientTest::onMenuPutTestClicked(Ref *sender)
|
||||||
// write the post data
|
// write the post data
|
||||||
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
|
||||||
request->setRequestData(postData, strlen(postData));
|
request->setRequestData(postData, strlen(postData));
|
||||||
|
if (isImmediate)
|
||||||
request->setTag("PUT test2");
|
{
|
||||||
|
request->setTag("PUT Binary immediate test2");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
request->setTag("PUT Binary test2");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +299,7 @@ void HttpClientTest::onMenuPutTestClicked(Ref *sender)
|
||||||
_labelStatusCode->setString("waiting...");
|
_labelStatusCode->setString("waiting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpClientTest::onMenuDeleteTestClicked(Ref *sender)
|
void HttpClientTest::onMenuDeleteTestClicked(Ref *sender, bool isImmediate)
|
||||||
{
|
{
|
||||||
// test 1
|
// test 1
|
||||||
{
|
{
|
||||||
|
@ -226,8 +307,15 @@ void HttpClientTest::onMenuDeleteTestClicked(Ref *sender)
|
||||||
request->setUrl("http://just-make-this-request-failed.com");
|
request->setUrl("http://just-make-this-request-failed.com");
|
||||||
request->setRequestType(HttpRequest::Type::DELETE);
|
request->setRequestType(HttpRequest::Type::DELETE);
|
||||||
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("DELETE immediate test1");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("DELETE test1");
|
request->setTag("DELETE test1");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,8 +325,15 @@ void HttpClientTest::onMenuDeleteTestClicked(Ref *sender)
|
||||||
request->setUrl("http://httpbin.org/delete");
|
request->setUrl("http://httpbin.org/delete");
|
||||||
request->setRequestType(HttpRequest::Type::DELETE);
|
request->setRequestType(HttpRequest::Type::DELETE);
|
||||||
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
request->setResponseCallback(CC_CALLBACK_2(HttpClientTest::onHttpRequestCompleted, this));
|
||||||
|
if (isImmediate)
|
||||||
|
{
|
||||||
|
request->setTag("DELETE immediate test2");
|
||||||
|
HttpClient::getInstance()->sendImmediate(request);
|
||||||
|
}else
|
||||||
|
{
|
||||||
request->setTag("DELETE test2");
|
request->setTag("DELETE test2");
|
||||||
HttpClient::getInstance()->send(request);
|
HttpClient::getInstance()->send(request);
|
||||||
|
}
|
||||||
request->release();
|
request->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,6 +375,10 @@ void HttpClientTest::onHttpRequestCompleted(HttpClient *sender, HttpResponse *re
|
||||||
printf("%c", (*buffer)[i]);
|
printf("%c", (*buffer)[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
if (response->getHttpRequest()->getReferenceCount() != 2)
|
||||||
|
{
|
||||||
|
log("request ref count not 2, is %d", response->getHttpRequest()->getReferenceCount());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpClientTest::toExtensionsMainLayer(cocos2d::Ref *sender)
|
void HttpClientTest::toExtensionsMainLayer(cocos2d::Ref *sender)
|
||||||
|
|
|
@ -13,11 +13,11 @@ public:
|
||||||
void toExtensionsMainLayer(cocos2d::Ref *sender);
|
void toExtensionsMainLayer(cocos2d::Ref *sender);
|
||||||
|
|
||||||
//Menu Callbacks
|
//Menu Callbacks
|
||||||
void onMenuGetTestClicked(cocos2d::Ref *sender);
|
void onMenuGetTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
||||||
void onMenuPostTestClicked(cocos2d::Ref *sender);
|
void onMenuPostTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
||||||
void onMenuPostBinaryTestClicked(cocos2d::Ref *sender);
|
void onMenuPostBinaryTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
||||||
void onMenuPutTestClicked(cocos2d::Ref *sender);
|
void onMenuPutTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
||||||
void onMenuDeleteTestClicked(cocos2d::Ref *sender);
|
void onMenuDeleteTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
||||||
|
|
||||||
//Http Response Callback
|
//Http Response Callback
|
||||||
void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
|
void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
|
||||||
|
|
|
@ -1266,23 +1266,9 @@ void NodeNameTest::onEnter()
|
||||||
log("find child: %s", node->getName().c_str());
|
log("find child: %s", node->getName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// enumerateChildren()
|
|
||||||
int i = 0;
|
|
||||||
parent->enumerateChildren("test", [&i](Node* node) -> bool {
|
|
||||||
++i;
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
CCAssert(i == 1, "");
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
parent->enumerateChildren("test", [&i](Node* node) -> bool {
|
|
||||||
++i;
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
CCAssert(i == 2, "");
|
|
||||||
|
|
||||||
// enumerateChildren()
|
// enumerateChildren()
|
||||||
// name = regular expression
|
// name = regular expression
|
||||||
|
int i = 0;
|
||||||
parent = Node::create();
|
parent = Node::create();
|
||||||
for (int i = 0; i < 100; ++i)
|
for (int i = 0; i < 100; ++i)
|
||||||
{
|
{
|
||||||
|
@ -1422,6 +1408,19 @@ void NodeNameTest::onEnter()
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
CCAssert(i == 10000, "");
|
CCAssert(i == 10000, "");
|
||||||
|
|
||||||
|
// utils::findChildren()
|
||||||
|
|
||||||
|
parent = Node::create();
|
||||||
|
for (int i = 0; i < 50; ++i)
|
||||||
|
{
|
||||||
|
auto child = Node::create();
|
||||||
|
child->setName("node");
|
||||||
|
parent->addChild(child);
|
||||||
|
}
|
||||||
|
auto findChildren = utils::findChildren(*parent, "node");
|
||||||
|
CCAssert(findChildren.size() == 50, "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
|
@ -0,0 +1,451 @@
|
||||||
|
local itemTagBasic = 1000
|
||||||
|
local winSize = cc.Director:getInstance():getWinSize()
|
||||||
|
local scheduler = cc.Director:getInstance():getScheduler()
|
||||||
|
local TimelineTestIndex =
|
||||||
|
{
|
||||||
|
TEST_ACTION_TIMELINE = 1,
|
||||||
|
TEST_CHANGE_PLAY_SECTION = 2,
|
||||||
|
TEST_TIMELINE_FRAME_EVENT = 3,
|
||||||
|
TEST_TIMELINE_PERFORMACE = 4,
|
||||||
|
}
|
||||||
|
local timelineSceneIdx = TimelineTestIndex.TEST_ACTION_TIMELINE
|
||||||
|
|
||||||
|
local TimelineTestScene = class("TimelineTestScene")
|
||||||
|
TimelineTestScene.__index = TimelineTestScene
|
||||||
|
|
||||||
|
function TimelineTestScene.extend(target)
|
||||||
|
local t = tolua.getpeer(target)
|
||||||
|
if not t then
|
||||||
|
t = {}
|
||||||
|
tolua.setpeer(target, t)
|
||||||
|
end
|
||||||
|
setmetatable(t, TimelineTestScene)
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestScene:runThisTest()
|
||||||
|
timelineSceneIdx = TimelineTestIndex.TEST_ACTION_TIMELINE
|
||||||
|
self:addChild(restartTimelineTest())
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestScene.create()
|
||||||
|
local scene = TimelineTestScene.extend(cc.Scene:create())
|
||||||
|
local bg = cc.Sprite:create("armature/bg.jpg")
|
||||||
|
bg:setPosition(VisibleRect:center())
|
||||||
|
|
||||||
|
local scaleX = VisibleRect:getVisibleRect().width / bg:getContentSize().width
|
||||||
|
local scaleY = VisibleRect:getVisibleRect().height / bg:getContentSize().height
|
||||||
|
|
||||||
|
bg:setScaleX(scaleX)
|
||||||
|
bg:setScaleY(scaleY)
|
||||||
|
|
||||||
|
scene:addChild(bg)
|
||||||
|
return scene
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestScene.toMainMenuCallback()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
local TimelineTestLayer = class("TimelineTestLayer")
|
||||||
|
TimelineTestLayer.__index = TimelineTestLayer
|
||||||
|
TimelineTestLayer._backItem = nil
|
||||||
|
TimelineTestLayer._restarItem = nil
|
||||||
|
TimelineTestLayer._nextItem = nil
|
||||||
|
|
||||||
|
function TimelineTestLayer:onEnter()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.title(idx)
|
||||||
|
if TimelineTestIndex.TEST_ACTION_TIMELINE == idx then
|
||||||
|
return "CSArmature Test Bed"
|
||||||
|
elseif TimelineTestIndex.TEST_CHANGE_PLAY_SECTION == idx then
|
||||||
|
return "Test Change Play Section"
|
||||||
|
elseif TimelineTestIndex.TEST_TIMELINE_FRAME_EVENT == idx then
|
||||||
|
return "Test Frame Event"
|
||||||
|
elseif TimelineTestIndex.TEST_TIMELINE_PERFORMACE == idx then
|
||||||
|
return "Test ActionTimeline performance"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.subTitle(idx)
|
||||||
|
if TimelineTestIndex.TEST_ACTION_TIMELINE == idx then
|
||||||
|
return ""
|
||||||
|
else
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.create()
|
||||||
|
local layer = TimelineTestLayer.extend(cc.Layer:create())
|
||||||
|
|
||||||
|
if nil ~= layer then
|
||||||
|
layer:createMenu()
|
||||||
|
layer:createToExtensionMenu()
|
||||||
|
layer:creatTitleAndSubTitle(timelineSceneIdx)
|
||||||
|
local function onNodeEvent(event)
|
||||||
|
if "enter" == event then
|
||||||
|
layer:onEnter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
layer:registerScriptHandler(onNodeEvent)
|
||||||
|
end
|
||||||
|
|
||||||
|
return layer
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.backCallback()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(backimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.restartCallback()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(restartTimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.nextCallback()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(nextTimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer:createMenu()
|
||||||
|
local menu = cc.Menu:create()
|
||||||
|
|
||||||
|
self._backItem = cc.MenuItemImage:create(s_pPathB1, s_pPathB2)
|
||||||
|
self._backItem:registerScriptTapHandler(self.backCallback)
|
||||||
|
menu:addChild(self._backItem,itemTagBasic)
|
||||||
|
self._restarItem = cc.MenuItemImage:create(s_pPathR1, s_pPathR2)
|
||||||
|
self._restarItem:registerScriptTapHandler(self.restartCallback)
|
||||||
|
menu:addChild(self._restarItem,itemTagBasic)
|
||||||
|
self._nextItem = cc.MenuItemImage:create(s_pPathF1, s_pPathF2)
|
||||||
|
menu:addChild(self._nextItem,itemTagBasic)
|
||||||
|
self._nextItem:registerScriptTapHandler(self.nextCallback)
|
||||||
|
|
||||||
|
local size = cc.Director:getInstance():getWinSize()
|
||||||
|
self._backItem:setPosition(cc.p(size.width / 2 - self._restarItem:getContentSize().width * 2, self._restarItem:getContentSize().height / 2))
|
||||||
|
self._restarItem:setPosition(cc.p(size.width / 2, self._restarItem:getContentSize().height / 2))
|
||||||
|
self._nextItem:setPosition(cc.p(size.width / 2 + self._restarItem:getContentSize().width * 2, self._restarItem:getContentSize().height / 2))
|
||||||
|
|
||||||
|
menu:setPosition(cc.p(0, 0))
|
||||||
|
|
||||||
|
self:addChild(menu)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer.toExtensionMenu()
|
||||||
|
ccs.ArmatureDataManager:destroyInstance()
|
||||||
|
local scene = CocoStudioTestMain()
|
||||||
|
if scene ~= nil then
|
||||||
|
cc.Director:getInstance():replaceScene(scene)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer:createToExtensionMenu()
|
||||||
|
cc.MenuItemFont:setFontName("Arial")
|
||||||
|
cc.MenuItemFont:setFontSize(24)
|
||||||
|
local menuItemFont = cc.MenuItemFont:create("Back")
|
||||||
|
menuItemFont:setPosition(cc.p(VisibleRect:rightBottom().x - 50, VisibleRect:rightBottom().y + 25))
|
||||||
|
menuItemFont:registerScriptTapHandler(TimelineTestLayer.toExtensionMenu)
|
||||||
|
|
||||||
|
local backMenu = cc.Menu:create()
|
||||||
|
backMenu:addChild(menuItemFont)
|
||||||
|
backMenu:setPosition(cc.p(0, 0))
|
||||||
|
self:addChild(backMenu,10)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimelineTestLayer:creatTitleAndSubTitle(idx)
|
||||||
|
print("set title")
|
||||||
|
local title = cc.Label:createWithTTF(TimelineTestLayer.title(idx), "fonts/Thonburi.ttf", 18)
|
||||||
|
title:setColor(cc.c3b(255,0,0))
|
||||||
|
self:addChild(title, 1, 10000)
|
||||||
|
title:setPosition( cc.p(VisibleRect:center().x, VisibleRect:top().y - 30))
|
||||||
|
local subTitle = nil
|
||||||
|
if "" ~= TimelineTestLayer.subTitle(idx) then
|
||||||
|
local subTitle = cc.Label:createWithTTF(TimelineTestLayer.subTitle(idx), "fonts/Thonburi.ttf", 18)
|
||||||
|
subTitle:setColor(cc.c3b(0,0,0))
|
||||||
|
self:addChild(subTitle, 1, 10001)
|
||||||
|
subTitle:setPosition( cc.p(VisibleRect:center().x, VisibleRect:top().y - 60) )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local TestActionTimeline = class("TestActionTimeline",TimelineTestLayer)
|
||||||
|
TestActionTimeline.__index = TestActionTimeline
|
||||||
|
|
||||||
|
function TestActionTimeline.extend(target)
|
||||||
|
local t = tolua.getpeer(target)
|
||||||
|
if not t then
|
||||||
|
t = {}
|
||||||
|
tolua.setpeer(target, t)
|
||||||
|
end
|
||||||
|
setmetatable(t, TestActionTimeline)
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestActionTimeline:onEnter()
|
||||||
|
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||||
|
|
||||||
|
local node = ccs.NodeReader:getInstance():createNode("ActionTimeline/boy_1.ExportJson")
|
||||||
|
local action = ccs.ActionTimelineCache:getInstance():createAction("ActionTimeline/boy_1.ExportJson")
|
||||||
|
|
||||||
|
node:runAction(action)
|
||||||
|
action:gotoFrameAndPlay(0, 60, true)
|
||||||
|
|
||||||
|
node:setScale(0.4)
|
||||||
|
node:setPosition(0, 0)
|
||||||
|
|
||||||
|
self:addChild(node)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestActionTimeline.restartCallback()
|
||||||
|
ccs.ArmatureDataManager:destroyInstance()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(restartTimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestActionTimeline.create()
|
||||||
|
local layer = TestActionTimeline.extend(cc.Layer:create())
|
||||||
|
|
||||||
|
if nil ~= layer then
|
||||||
|
layer:createMenu()
|
||||||
|
layer:createToExtensionMenu()
|
||||||
|
layer:creatTitleAndSubTitle(timelineSceneIdx)
|
||||||
|
local function onNodeEvent(event)
|
||||||
|
if "enter" == event then
|
||||||
|
layer:onEnter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
layer:registerScriptHandler(onNodeEvent)
|
||||||
|
end
|
||||||
|
|
||||||
|
return layer
|
||||||
|
end
|
||||||
|
|
||||||
|
local TestChangePlaySection = class("TestChangePlaySection",TimelineTestLayer)
|
||||||
|
TestChangePlaySection.__index = TestChangePlaySection
|
||||||
|
|
||||||
|
function TestChangePlaySection.extend(target)
|
||||||
|
local t = tolua.getpeer(target)
|
||||||
|
if not t then
|
||||||
|
t = {}
|
||||||
|
tolua.setpeer(target, t)
|
||||||
|
end
|
||||||
|
setmetatable(t, TestChangePlaySection)
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestChangePlaySection:onEnter()
|
||||||
|
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||||
|
|
||||||
|
local node = ccs.NodeReader:getInstance():createNode("ActionTimeline/boy_1.ExportJson")
|
||||||
|
local action = ccs.ActionTimelineCache:getInstance():createAction("ActionTimeline/boy_1.ExportJson")
|
||||||
|
|
||||||
|
node:runAction(action)
|
||||||
|
action:gotoFrameAndPlay(70, action:getDuration(), true)
|
||||||
|
|
||||||
|
node:setScale(0.2)
|
||||||
|
node:setPosition(150, 100)
|
||||||
|
|
||||||
|
local function onTouchesEnded(touches, event)
|
||||||
|
if action:getStartFrame() == 0 then
|
||||||
|
action:gotoFrameAndPlay(70, action:getDuration(), true)
|
||||||
|
else
|
||||||
|
action:gotoFrameAndPlay(0, 60, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local listener = cc.EventListenerTouchAllAtOnce:create()
|
||||||
|
listener:registerScriptHandler(onTouchesEnded,cc.Handler.EVENT_TOUCHES_ENDED )
|
||||||
|
|
||||||
|
local eventDispatcher = self:getEventDispatcher()
|
||||||
|
eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self)
|
||||||
|
|
||||||
|
self:addChild(node)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestChangePlaySection.restartCallback()
|
||||||
|
ccs.ArmatureDataManager:destroyInstance()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(restartTimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestChangePlaySection.create()
|
||||||
|
local layer = TestChangePlaySection.extend(cc.Layer:create())
|
||||||
|
|
||||||
|
if nil ~= layer then
|
||||||
|
layer:createMenu()
|
||||||
|
layer:createToExtensionMenu()
|
||||||
|
layer:creatTitleAndSubTitle(timelineSceneIdx)
|
||||||
|
local function onNodeEvent(event)
|
||||||
|
if "enter" == event then
|
||||||
|
layer:onEnter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
layer:registerScriptHandler(onNodeEvent)
|
||||||
|
end
|
||||||
|
|
||||||
|
return layer
|
||||||
|
end
|
||||||
|
|
||||||
|
local TestTimelineFrameEvent = class("TestTimelineFrameEvent",TimelineTestLayer)
|
||||||
|
TestTimelineFrameEvent.__index = TestTimelineFrameEvent
|
||||||
|
|
||||||
|
function TestTimelineFrameEvent.extend(target)
|
||||||
|
local t = tolua.getpeer(target)
|
||||||
|
if not t then
|
||||||
|
t = {}
|
||||||
|
tolua.setpeer(target, t)
|
||||||
|
end
|
||||||
|
setmetatable(t, TestTimelineFrameEvent)
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestTimelineFrameEvent:onEnter()
|
||||||
|
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||||
|
|
||||||
|
local node = ccs.NodeReader:getInstance():createNode("ActionTimeline/boy_1.ExportJson")
|
||||||
|
local action = ccs.ActionTimelineCache:getInstance():createAction("ActionTimeline/boy_1.ExportJson")
|
||||||
|
|
||||||
|
node:runAction(action)
|
||||||
|
action:gotoFrameAndPlay(0, 60, true)
|
||||||
|
|
||||||
|
node:setScale(0.2)
|
||||||
|
node:setPosition(150, 100)
|
||||||
|
self:addChild(node)
|
||||||
|
|
||||||
|
local function onFrameEvent(frame)
|
||||||
|
if nil == frame then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local str = frame:getEvent()
|
||||||
|
|
||||||
|
if str == "changeColor" then
|
||||||
|
frame:getNode():setColor(cc.c3b(0, 0, 0))
|
||||||
|
elseif(str == "endChangeColor") then
|
||||||
|
frame:getNode():setColor(cc.c3b(255,255,255))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
action:setFrameEventCallFunc(onFrameEvent)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestTimelineFrameEvent.restartCallback()
|
||||||
|
ccs.ArmatureDataManager:destroyInstance()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(restartTimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestTimelineFrameEvent.create()
|
||||||
|
local layer = TestTimelineFrameEvent.extend(cc.Layer:create())
|
||||||
|
|
||||||
|
if nil ~= layer then
|
||||||
|
layer:createMenu()
|
||||||
|
layer:createToExtensionMenu()
|
||||||
|
layer:creatTitleAndSubTitle(timelineSceneIdx)
|
||||||
|
local function onNodeEvent(event)
|
||||||
|
if "enter" == event then
|
||||||
|
layer:onEnter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
layer:registerScriptHandler(onNodeEvent)
|
||||||
|
end
|
||||||
|
|
||||||
|
return layer
|
||||||
|
end
|
||||||
|
|
||||||
|
local TestTimelinePerformance = class("TestTimelinePerformance",TimelineTestLayer)
|
||||||
|
TestTimelinePerformance.__index = TestTimelinePerformance
|
||||||
|
|
||||||
|
function TestTimelinePerformance.extend(target)
|
||||||
|
local t = tolua.getpeer(target)
|
||||||
|
if not t then
|
||||||
|
t = {}
|
||||||
|
tolua.setpeer(target, t)
|
||||||
|
end
|
||||||
|
setmetatable(t, TestTimelinePerformance)
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestTimelinePerformance:onEnter()
|
||||||
|
cc.SpriteFrameCache:getInstance():addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png")
|
||||||
|
|
||||||
|
for i = 1,100 do
|
||||||
|
local node = ccs.NodeReader:getInstance():createNode("ActionTimeline/boy_1.ExportJson")
|
||||||
|
local action = ccs.ActionTimelineCache:getInstance():createAction("ActionTimeline/boy_1.ExportJson")
|
||||||
|
|
||||||
|
node:runAction(action)
|
||||||
|
action:gotoFrameAndPlay(70, action:getDuration(), true)
|
||||||
|
|
||||||
|
node:setScale(0.1)
|
||||||
|
node:setPosition((i - 1) * 2, 100)
|
||||||
|
self:addChild(node)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestTimelinePerformance.restartCallback()
|
||||||
|
ccs.ArmatureDataManager:destroyInstance()
|
||||||
|
local newScene = TimelineTestScene.create()
|
||||||
|
newScene:addChild(restartTimelineTest())
|
||||||
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TestTimelinePerformance.create()
|
||||||
|
local layer = TestTimelinePerformance.extend(cc.Layer:create())
|
||||||
|
|
||||||
|
if nil ~= layer then
|
||||||
|
layer:createMenu()
|
||||||
|
layer:createToExtensionMenu()
|
||||||
|
layer:creatTitleAndSubTitle(timelineSceneIdx)
|
||||||
|
local function onNodeEvent(event)
|
||||||
|
if "enter" == event then
|
||||||
|
layer:onEnter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
layer:registerScriptHandler(onNodeEvent)
|
||||||
|
end
|
||||||
|
|
||||||
|
return layer
|
||||||
|
end
|
||||||
|
|
||||||
|
local actionlineSceneArr =
|
||||||
|
{
|
||||||
|
TestActionTimeline.create,
|
||||||
|
TestChangePlaySection.create,
|
||||||
|
TestTimelineFrameEvent.create,
|
||||||
|
TestTimelinePerformance.create,
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextTimelineTest()
|
||||||
|
timelineSceneIdx = timelineSceneIdx + 1
|
||||||
|
timelineSceneIdx = timelineSceneIdx % table.getn(actionlineSceneArr)
|
||||||
|
if 0 == timelineSceneIdx then
|
||||||
|
timelineSceneIdx = table.getn(actionlineSceneArr)
|
||||||
|
end
|
||||||
|
return actionlineSceneArr[timelineSceneIdx]()
|
||||||
|
end
|
||||||
|
|
||||||
|
function backTimelineTest()
|
||||||
|
timelineSceneIdx = timelineSceneIdx - 1
|
||||||
|
if timelineSceneIdx <= 0 then
|
||||||
|
timelineSceneIdx = timelineSceneIdx + table.getn(actionlineSceneArr)
|
||||||
|
end
|
||||||
|
|
||||||
|
return actionlineSceneArr[timelineSceneIdx]()
|
||||||
|
end
|
||||||
|
|
||||||
|
function restartTimelineTest()
|
||||||
|
return actionlineSceneArr[timelineSceneIdx]()
|
||||||
|
end
|
||||||
|
|
||||||
|
function runCocoStudioActionTimelineTestScene()
|
||||||
|
local scene = TimelineTestScene.create()
|
||||||
|
scene:runThisTest()
|
||||||
|
cc.Director:getInstance():replaceScene(scene)
|
||||||
|
end
|
|
@ -2,6 +2,7 @@ require "src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest"
|
||||||
require "src/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest"
|
require "src/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest"
|
||||||
require "src/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest"
|
require "src/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest"
|
||||||
require "src/CocoStudioTest/CocoStudioUIEditorTest/CocoStudioUIEditorTest"
|
require "src/CocoStudioTest/CocoStudioUIEditorTest/CocoStudioUIEditorTest"
|
||||||
|
require "src/CocoStudioTest/CocoStudioActionTimelineTest/CocoStudioActionTimelineTest"
|
||||||
|
|
||||||
local LINE_SPACE = 40
|
local LINE_SPACE = 40
|
||||||
local ITEM_TAG_BASIC = 1000
|
local ITEM_TAG_BASIC = 1000
|
||||||
|
@ -35,6 +36,13 @@ local cocoStudioTestItemNames =
|
||||||
runCocoStudioUIEditorTestScene()
|
runCocoStudioUIEditorTestScene()
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
itemTitle = "CocoStudioActionTimelineTest",
|
||||||
|
testScene = function()
|
||||||
|
runCocoStudioActionTimelineTestScene()
|
||||||
|
end
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local CocoStudioTestScene = class("CocoStudioTestScene")
|
local CocoStudioTestScene = class("CocoStudioTestScene")
|
||||||
|
|
|
@ -30,7 +30,7 @@ headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h
|
||||||
|
|
||||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||||
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
# expression, it will be enclosed in "^$", like this: "^Menu*$".
|
||||||
classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode SceneReader GUIReader ActionObject Tween DisplayManager
|
classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode SceneReader GUIReader ActionObject Tween DisplayManager NodeReader ActionTimeline.* .*Frame$ Timeline
|
||||||
|
|
||||||
# what should we skip? in the format ClassName::[function function]
|
# what should we skip? in the format ClassName::[function function]
|
||||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||||
|
@ -52,7 +52,9 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*
|
||||||
GUIReader::[storeFileDesignSize getFileDesignSize getParseCallBackMap getParseObjectMap],
|
GUIReader::[storeFileDesignSize getFileDesignSize getParseCallBackMap getParseObjectMap],
|
||||||
ActionNode::[initWithDictionary],
|
ActionNode::[initWithDictionary],
|
||||||
ActionObject::[initWithDictionary],
|
ActionObject::[initWithDictionary],
|
||||||
BaseData::[copy subtract]
|
BaseData::[copy subtract],
|
||||||
|
NodeReader::[getInstance],
|
||||||
|
ActionTimelineCache::[getInstance]
|
||||||
|
|
||||||
rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance],
|
rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance],
|
||||||
ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance],
|
ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance],
|
||||||
|
|
Loading…
Reference in New Issue