[cocos2dx] Removed cocos2dx
@ -1,26 +0,0 @@
|
||||
Spine Runtimes License Agreement
|
||||
Last updated April 5, 2025. Replaces all prior versions.
|
||||
|
||||
Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
|
||||
Integration of the Spine Runtimes into software or otherwise creating
|
||||
derivative works of the Spine Runtimes is permitted under the terms and
|
||||
conditions of Section 2 of the Spine Editor License Agreement:
|
||||
https://esotericsoftware.com/spine-editor-license
|
||||
|
||||
Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
"Products"), provided that each user of the Products must obtain their own
|
||||
Spine Editor license and redistribution of the Products in any form must
|
||||
include this license and copyright notice.
|
||||
|
||||
THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -1,111 +0,0 @@
|
||||
# spine-cocos2dx v3.x & v4.x
|
||||
|
||||
The spine-cocos2dx runtime provides functionality to load, manipulate and render [Spine](http://esotericsoftware.com) skeletal animation data using [cocos2d-x](https://cocos2d-x.org/cocos2dx/). spine-cocos2dx is based on [spine-cpp](../spine-cpp).
|
||||
|
||||
## Licensing
|
||||
|
||||
You are welcome to evaluate the Spine Runtimes and the examples we provide in this repository free of charge.
|
||||
|
||||
You can integrate the Spine Runtimes into your software free of charge, but users of your software must have their own [Spine license](https://esotericsoftware.com/spine-purchase). Please make your users aware of this requirement! This option is often chosen by those making development tools, such as an SDK, game toolkit, or software library.
|
||||
|
||||
In order to distribute your software containing the Spine Runtimes to others that don't have a Spine license, you need a [Spine license](https://esotericsoftware.com/spine-purchase) at the time of integration. Then you can distribute your software containing the Spine Runtimes however you like, provided others don't modify it or use it to create new software. If others want to do that, they'll need their own Spine license.
|
||||
|
||||
For the official legal terms governing the Spine Runtimes, please read the [Spine Runtimes License Agreement](http://esotericsoftware.com/spine-runtimes-license) and Section 2 of the [Spine Editor License Agreement](http://esotericsoftware.com/spine-editor-license#s2).
|
||||
|
||||
## Spine version
|
||||
|
||||
spine-cocos2dx works with data exported from Spine 4.2.xx.
|
||||
|
||||
spine-cocos2dx supports all Spine features.
|
||||
|
||||
## Setup
|
||||
|
||||
The setup for cocos2d-x differs from most other Spine Runtimes because the cocos2d-x distribution includes a copy of the Spine Runtime files. This is not ideal because these files may be old and fail to work with the latest Spine editor. Also it means if cocos2d-x is updated, you may get newer Spine Runtime files which can break your application if you are not using the latest Spine editor. For these reasons, we have requested cocos2d-x to cease distributing the Spine Runtime files, but they continue to do so. The following instructions allow you to use the official Spine cocos2d-x runtime with your cocos2d-x project.
|
||||
|
||||
spine-cocos2dx works with both Cocos2d-x v3 and v4. The setup process is identical in both cases. The preferred way to integrate spine-cocos2dx into your Cocos2d-x project is to use the [Cocos2d-x CMake build system].
|
||||
|
||||
1. [Create a new C++ cocos2d-x project](https://docs.cocos2d-x.org/cocos2d-x/v4/en/editors_and_tools/cocosCLTool.html). Let's assume you created your project in a folder `/path/to/MyGame/` somewhere on your disk.
|
||||
2. Download the Spine Runtimes source using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above. Let's assume you cloned the Spine Runtimes to a folder `/path/to/spine-runtimes/` somewhere on your disk.
|
||||
3. Open `MyGame/CMakeLists.txt` in a text editor and modify it as follows:
|
||||
- After the line `project(${APP_NAME})` add the following line:
|
||||
```
|
||||
include(/path/to/spine-runtimes/spine-cocos2dx/spine-cocos2dx.cmake)
|
||||
```
|
||||
- Before the line `target_link_libraries(${APP_NAME} cocos2d)`add the following line:
|
||||
```
|
||||
target_link_libraries(${APP_NAME} spine-cpp spine-cocos2dx)
|
||||
```
|
||||
4. [Proceed with generating IDE files via CMake](https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/CMake-Guide.html) and build and run your project.
|
||||
|
||||
For reference, have a look at our spine-cocos2dx example project in this repository described below.
|
||||
|
||||
## Example
|
||||
|
||||
The spine-cocos2dx example works on Windows, Linux, macOS, iOS, Linux, and Android, for both cocos2d-x v3 and v4.
|
||||
|
||||
Please [install the reprequisit software](https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/prerequisites.html) as per the Cocos2d-x documentation. Ensure that the following programs are in your `PATH` environment variable and thus executable from the command line:
|
||||
|
||||
- `git`
|
||||
- `cmake`
|
||||
- `python`
|
||||
|
||||
Before you can compile and run the example project for a specific target platform, you need to clone the [Cocos2d-x repository](https://github.com/cocos2d/cocos2d-x) to `spine-runtimes/spine-cocos2dx/example/cocos2d` and download the dependencies:
|
||||
|
||||
```
|
||||
cd spine-runtimes/spine-cocos2dx/example
|
||||
git clone -b v4 --depth 1 https://github.com/cocos2d/cocos2d-x cocos2d
|
||||
python cocos2d/download-deps.py -r yes
|
||||
```
|
||||
|
||||
> **NOTE:** If you want to run the example with Cocos2d-x version 3, replace `-b v4` with `-b v3` in the `git clone` command.
|
||||
|
||||
> **NOTE:** On macOS Big Sur, replace `python` with `python3`.
|
||||
|
||||
You can now use CMake to create IDE projects for the target platform you want to compile and run the example on.
|
||||
|
||||
### macOS
|
||||
|
||||
Execute the following on the command line:
|
||||
|
||||
```
|
||||
cd spine-runtimes/spine-cocos2dx/example
|
||||
mkdir build-macos && cmake . -GXcode -Bbuild-macos -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
open build-macos/spine-cocos2dx-example.xcodeproj
|
||||
```
|
||||
|
||||
This will generate an Xcode project in `build-macos/spine-cocos2dx-example.xcodeproj` and open it in Xcode. To build and run the example, select the `spine-cocos2dx-example` scheme and press `CMD + R`.
|
||||
|
||||
> **NOTE:** Passing `-DCMAKE_OSX_ARCHITECTURES=x86_64` to CMake is currently required, as Cocos2d-X only provides prebuilt x86_64 binaries for its external dependencies.
|
||||
|
||||
### iOS
|
||||
|
||||
Execute the following on the command line:
|
||||
|
||||
```
|
||||
cd spine-runtimes/spine-cocos2dx/example
|
||||
mkdir build-ios && cmake . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -Bbuild-ios
|
||||
open build-ios/spine-cocos2dx-example.xcodeproj
|
||||
```
|
||||
|
||||
This will generate an Xcode project in `build-ios/spine-cocos2dx-example.xcodeproj` and open it in Xcode. To build and run the example, select the `spine-cocos2dx-example` scheme and select a device or simulator to build for and run on. Finally, press `CMD + R` to build and run the example.
|
||||
|
||||
### Android
|
||||
|
||||
Open the project in `proj.android` in Android Studio. Make sure you have NDK version `24.0.8215888` installed via the SDK Manager. Alternatively, you can set the `ndkVersion` property in `proj.android/app/build.gradle` to the NDK version you have installed locally.
|
||||
|
||||
### Windows
|
||||
|
||||
Execute the following on the command line:
|
||||
|
||||
```
|
||||
cd spine-runtimes/spine-cocos2dx/example
|
||||
mkdir build-win
|
||||
cmake . -G "Visual Studio 16 2019" -A Win32 -T host=x86 -Bbuild-win
|
||||
```
|
||||
|
||||
You can then open the file `build-win/spine-cocos2dx-example.sln` with Visual Studio 2019. In the solution explorer, right click the `spine-cocos2dx-example` project, then click `Set as Startup Project` in the context menu. Finally, click the `Local Windows Debugger` button to build and run the example.
|
||||
|
||||
## Notes
|
||||
|
||||
- Images are premultiplied by cocos2d-x, so the Spine atlas images should _not_ use premultiplied alpha.
|
||||
- Two color tinting needs to be enabled on a per-skeleton basis. Call `SkeletonRenderer::setTwoColorTine(true)` or `SkeletonAnimation::setTwoColorTint(true)` after you created the skeleton instance. Note that two color tinting requires a custom shader and vertex format. Skeletons rendered with two color tinting can therefore not be batched with single color tinted skeletons or other 2D cocos2d-x elements like sprites. However, two-color tinted skeletons will be batched if possible when rendered after one another. Attaching a child to a two color tinted skeleton will also break the batch.
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"engine_version": "cocos2d-x-4.0",
|
||||
"project_type": "cpp"
|
||||
}
|
||||
@ -1,163 +0,0 @@
|
||||
#/****************************************************************************
|
||||
# Copyright (c) 2013-2014 cocos2d-x.org
|
||||
# Copyright (c) 2015-2017 Chukong Technologies Inc.
|
||||
#
|
||||
# http://www.cocos2d-x.org
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
# ****************************************************************************/
|
||||
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
set(APP_NAME spine-cocos2dx-example)
|
||||
|
||||
project(${APP_NAME})
|
||||
|
||||
set(BUILD_EXTENSIONS OFF CACHE BOOL "Build extensions" FORCE)
|
||||
|
||||
include(../spine-cocos2dx.cmake)
|
||||
|
||||
if(XCODE)
|
||||
if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET)
|
||||
SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED BUILD_ENGINE_DONE) # to test spine-cocos2dx-example into root project
|
||||
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cocos2d)
|
||||
set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
|
||||
|
||||
include(CocosBuildSet)
|
||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
|
||||
endif()
|
||||
|
||||
# record sources, headers, resources...
|
||||
set(GAME_RES_FOLDER
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Resources"
|
||||
)
|
||||
if(APPLE OR WINDOWS)
|
||||
cocos_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
|
||||
endif()
|
||||
|
||||
# add cross-platforms source files and header files
|
||||
file(GLOB_RECURSE GAME_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Classes/*.cpp")
|
||||
file(GLOB_RECURSE GAME_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/Classes/*.h")
|
||||
set(GAME_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/Classes")
|
||||
|
||||
if(ANDROID)
|
||||
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
|
||||
set(APP_NAME MyGame)
|
||||
list(APPEND GAME_SOURCE
|
||||
proj.android/app/jni/hellocpp/main.cpp
|
||||
)
|
||||
elseif(LINUX)
|
||||
list(APPEND GAME_SOURCE
|
||||
proj.linux/main.cpp
|
||||
)
|
||||
elseif(WINDOWS)
|
||||
list(APPEND GAME_HEADER
|
||||
proj.win32/main.h
|
||||
proj.win32/resource.h
|
||||
)
|
||||
list(APPEND GAME_SOURCE
|
||||
proj.win32/main.cpp
|
||||
proj.win32/game.rc
|
||||
${common_res_files}
|
||||
)
|
||||
elseif(APPLE)
|
||||
if(IOS)
|
||||
list(APPEND GAME_HEADER
|
||||
proj.ios_mac/ios/AppController.h
|
||||
proj.ios_mac/ios/RootViewController.h
|
||||
)
|
||||
set(APP_UI_RES
|
||||
proj.ios_mac/ios/LaunchScreen.storyboard
|
||||
proj.ios_mac/ios/LaunchScreenBackground.png
|
||||
proj.ios_mac/ios/Images.xcassets
|
||||
)
|
||||
list(APPEND GAME_SOURCE
|
||||
proj.ios_mac/ios/main.m
|
||||
proj.ios_mac/ios/AppController.mm
|
||||
proj.ios_mac/ios/RootViewController.mm
|
||||
proj.ios_mac/ios/Prefix.pch
|
||||
${APP_UI_RES}
|
||||
)
|
||||
elseif(MACOSX)
|
||||
set(APP_UI_RES
|
||||
proj.ios_mac/mac/Icon.icns
|
||||
proj.ios_mac/mac/Info.plist
|
||||
)
|
||||
list(APPEND GAME_SOURCE
|
||||
proj.ios_mac/mac/main.cpp
|
||||
proj.ios_mac/mac/Prefix.pch
|
||||
${APP_UI_RES}
|
||||
)
|
||||
endif()
|
||||
list(APPEND GAME_SOURCE ${common_res_files})
|
||||
endif()
|
||||
|
||||
# mark app complie info and libs info
|
||||
set(all_code_files
|
||||
${GAME_HEADER}
|
||||
${GAME_SOURCE}
|
||||
)
|
||||
if(NOT ANDROID)
|
||||
add_executable(${APP_NAME} ${all_code_files})
|
||||
else()
|
||||
add_library(${APP_NAME} SHARED ${all_code_files})
|
||||
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
|
||||
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
|
||||
endif()
|
||||
|
||||
# Link the spine-cpp and spine-cocos2dx library to the app
|
||||
target_link_libraries(${APP_NAME} spine-cpp spine-cocos2dx)
|
||||
|
||||
# Manually link to libz on iOS, the cocos2d-x build only pulls in libz.tbd
|
||||
if(IOS)
|
||||
target_link_libraries(${APP_NAME} z)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${APP_NAME} cocos2d)
|
||||
target_include_directories(${APP_NAME}
|
||||
PRIVATE ${GAME_INCLUDE}
|
||||
PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/audio/include/
|
||||
)
|
||||
|
||||
# mark app resources
|
||||
setup_cocos_app_config(${APP_NAME})
|
||||
if(APPLE)
|
||||
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
|
||||
|
||||
if(MACOSX)
|
||||
set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
|
||||
elseif(IOS)
|
||||
set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist")
|
||||
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
|
||||
endif()
|
||||
|
||||
# For code-signing, set the DEVELOPMENT_TEAM:
|
||||
#set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "GRLXXXX2K9")
|
||||
elseif(WINDOWS)
|
||||
cocos_copy_target_dll(${APP_NAME})
|
||||
endif()
|
||||
|
||||
if(LINUX OR WINDOWS)
|
||||
cocos_get_resource_path(APP_RES_DIR ${APP_NAME})
|
||||
cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
|
||||
endif()
|
||||
@ -1,138 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "AppDelegate.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "AppMacros.h"
|
||||
#include "PhysicsExample.h"
|
||||
#include <spine/Debug.h>
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace std;
|
||||
|
||||
using namespace spine;
|
||||
|
||||
DebugExtension debugExtension(SpineExtension::getInstance());
|
||||
|
||||
AppDelegate::AppDelegate() {
|
||||
}
|
||||
|
||||
AppDelegate::~AppDelegate() {
|
||||
SkeletonBatch::destroyInstance();
|
||||
SkeletonTwoColorBatch::destroyInstance();
|
||||
debugExtension.reportLeaks();
|
||||
}
|
||||
|
||||
bool AppDelegate::applicationDidFinishLaunching() {
|
||||
// initialize director
|
||||
auto director = Director::getInstance();
|
||||
auto glview = director->getOpenGLView();
|
||||
if (!glview) {
|
||||
GLContextAttrs attrs = {8, 8, 8, 8, 0, 0};
|
||||
GLView::setGLContextAttrs(attrs);
|
||||
glview = GLViewImpl::create("Spine Example");
|
||||
director->setOpenGLView(glview);
|
||||
}
|
||||
|
||||
// Set the design resolution
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
|
||||
// a bug in DirectX 11 level9-x on the device prevents ResolutionPolicy::NO_BORDER from working correctly
|
||||
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::SHOW_ALL);
|
||||
#else
|
||||
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
|
||||
#endif
|
||||
|
||||
cocos2d::Size frameSize = glview->getFrameSize();
|
||||
|
||||
vector<string> searchPath;
|
||||
|
||||
// In this demo, we select resource according to the frame's height.
|
||||
// If the resource size is different from design resolution size, you need to set contentScaleFactor.
|
||||
// We use the ratio of resource's height to the height of design resolution,
|
||||
// this can make sure that the resource's height could fit for the height of design resolution.
|
||||
if (frameSize.height > mediumResource.size.height) {
|
||||
// if the frame's height is larger than the height of medium resource size, select large resource.
|
||||
searchPath.push_back(largeResource.directory);
|
||||
director->setContentScaleFactor(
|
||||
MIN(largeResource.size.height / designResolutionSize.height, largeResource.size.width / designResolutionSize.width));
|
||||
} else if (frameSize.height > smallResource.size.height) {
|
||||
// if the frame's height is larger than the height of small resource size, select medium resource.
|
||||
searchPath.push_back(mediumResource.directory);
|
||||
director->setContentScaleFactor(
|
||||
MIN(mediumResource.size.height / designResolutionSize.height, mediumResource.size.width / designResolutionSize.width));
|
||||
} else {
|
||||
// if the frame's height is smaller than the height of medium resource size, select small resource.
|
||||
searchPath.push_back(smallResource.directory);
|
||||
director->setContentScaleFactor(
|
||||
MIN(smallResource.size.height / designResolutionSize.height, smallResource.size.width / designResolutionSize.width));
|
||||
}
|
||||
|
||||
searchPath.push_back("common");
|
||||
|
||||
// set search path
|
||||
FileUtils::getInstance()->setSearchPaths(searchPath);
|
||||
|
||||
// turn on display FPS
|
||||
director->setDisplayStats(true);
|
||||
|
||||
// set FPS. the default value is 1.0/60 if you don't call this
|
||||
director->setAnimationInterval(1.0f / 60);
|
||||
|
||||
// Set the Debug wrapper extension so we know about memory leaks.
|
||||
SpineExtension::setInstance(&debugExtension);
|
||||
|
||||
// create a scene. it's an autorelease object
|
||||
//auto scene = RaptorExample::scene();
|
||||
auto scene = PhysicsExample::scene();
|
||||
|
||||
// run
|
||||
director->runWithScene(scene);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
|
||||
void AppDelegate::applicationDidEnterBackground() {
|
||||
Director::getInstance()->stopAnimation();
|
||||
|
||||
// if you use SimpleAudioEngine, it must be paused
|
||||
// SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
|
||||
}
|
||||
|
||||
// this function will be called when the app is active again
|
||||
void AppDelegate::applicationWillEnterForeground() {
|
||||
Director::getInstance()->startAnimation();
|
||||
|
||||
// if you use SimpleAudioEngine, it must resume here
|
||||
// SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _APPDELEGATE_H_
|
||||
#define _APPDELEGATE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
|
||||
class AppDelegate : private cocos2d::Application {
|
||||
public:
|
||||
AppDelegate();
|
||||
virtual ~AppDelegate();
|
||||
|
||||
virtual bool applicationDidFinishLaunching();
|
||||
virtual void applicationDidEnterBackground();
|
||||
virtual void applicationWillEnterForeground();
|
||||
};
|
||||
|
||||
#endif// _APPDELEGATE_H_
|
||||
@ -1,88 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _APPMACROS_H_
|
||||
#define _APPMACROS_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
|
||||
/* For demonstrating using one design resolution to match different resources,
|
||||
or one resource to match different design resolutions.
|
||||
|
||||
[Situation 1] Using one design resolution to match different resources.
|
||||
Please look into Appdelegate::applicationDidFinishLaunching.
|
||||
We check current device frame size to decide which resource need to be selected.
|
||||
So if you want to test this situation which said in title '[Situation 1]',
|
||||
you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina),
|
||||
or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux plaform
|
||||
and modify "proj.mac/AppController.mm" by changing the window rectangle.
|
||||
|
||||
[Situation 2] Using one resource to match different design resolutions.
|
||||
The coordinates in your codes is based on your current design resolution rather than resource size.
|
||||
Therefore, your design resolution could be very large and your resource size could be small.
|
||||
To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536'
|
||||
and open iphone simulator or create a window of 480x320 size.
|
||||
|
||||
[Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources.
|
||||
*/
|
||||
|
||||
#define DESIGN_RESOLUTION_480X320 0
|
||||
#define DESIGN_RESOLUTION_960x640 1
|
||||
#define DESIGN_RESOLUTION_1024X768 2
|
||||
#define DESIGN_RESOLUTION_2048X1536 3
|
||||
|
||||
/* If you want to switch design resolution, change next line */
|
||||
#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_960x640
|
||||
|
||||
typedef struct tagResource {
|
||||
cocos2d::Size size;
|
||||
char directory[100];
|
||||
} Resource;
|
||||
|
||||
static Resource smallResource = {cocos2d::Size(480, 320), "iphone"};
|
||||
static Resource mediumResource = {cocos2d::Size(960, 640), "iphone-retina"};
|
||||
static Resource largeResource = {cocos2d::Size(1024, 768), "ipad"};
|
||||
static Resource extralargeResource = {cocos2d::Size(2048, 1536), "ipad-retina"};
|
||||
|
||||
#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320)
|
||||
static cocos2d::Size designResolutionSize = cocos2d::Size(480, 320);
|
||||
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_960x640)
|
||||
static cocos2d::Size designResolutionSize = cocos2d::Size(960, 640);
|
||||
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768)
|
||||
static cocos2d::Size designResolutionSize = cocos2d::Size(1024, 768);
|
||||
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536)
|
||||
static cocos2d::Size designResolutionSize = cocos2d::Size(2048, 1536);
|
||||
#else
|
||||
#error unknown target design resolution!
|
||||
#endif
|
||||
|
||||
// The font size 24 is designed for small resolution, so we should change it to fit for current design resolution
|
||||
#define TITLE_FONT_SIZE (cocos2d::Director::getInstance()->getOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24)
|
||||
|
||||
#endif /* _APPMACROS_H_ */
|
||||
@ -1,112 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "BatchingExample.h"
|
||||
#include "SequenceExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
#define NUM_SKELETONS 50
|
||||
|
||||
Cocos2dTextureLoader textureLoader;
|
||||
|
||||
Scene *BatchingExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(BatchingExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool BatchingExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
// Load the texture atlas. Note that the texture loader has to live
|
||||
// as long as the Atlas, as the Atlas destructor will call TextureLoader::unload.
|
||||
_atlas = new (__FILE__, __LINE__) Atlas("spineboy.atlas", &textureLoader, true);
|
||||
CCASSERT(_atlas, "Error reading atlas file.");
|
||||
|
||||
// This attachment loader configures attachments with data needed for cocos2d-x rendering.
|
||||
// Do not dispose the attachment loader until the skeleton data is disposed!
|
||||
_attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas);
|
||||
|
||||
// Load the skeleton data.
|
||||
SkeletonJson *json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader);
|
||||
json->setScale(0.6f);// Resizes skeleton data to 60% of the size it was in Spine.
|
||||
_skeletonData = json->readSkeletonDataFile("spineboy-pro.json");
|
||||
CCASSERT(_skeletonData, json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data file.");
|
||||
delete json;
|
||||
|
||||
// Setup mix times.
|
||||
_stateData = new (__FILE__, __LINE__) AnimationStateData(_skeletonData);
|
||||
_stateData->setMix("walk", "jump", 0.2f);
|
||||
_stateData->setMix("jump", "run", 0.2f);
|
||||
|
||||
int xMin = _contentSize.width * 0.10f, xMax = _contentSize.width * 0.90f;
|
||||
int yMin = 0, yMax = _contentSize.height * 0.7f;
|
||||
for (int i = 0; i < NUM_SKELETONS; i++) {
|
||||
// Each skeleton node shares the same atlas, skeleton data, and mix times.
|
||||
SkeletonAnimation *skeletonNode = SkeletonAnimation::createWithData(_skeletonData, false);
|
||||
skeletonNode->setAnimationStateData(_stateData);
|
||||
|
||||
skeletonNode->setAnimation(0, "walk", true);
|
||||
skeletonNode->addAnimation(0, "jump", true, RandomHelper::random_int(0, 300) / 100.0f);
|
||||
skeletonNode->addAnimation(0, "run", true);
|
||||
|
||||
// alternative setting two color tint for groups of 10 skeletons
|
||||
// should end up with #skeletons / 10 batches
|
||||
// if (j++ < 10)
|
||||
// skeletonNode->setTwoColorTint(true);
|
||||
// if (j == 20) j = 0;
|
||||
// skeletonNode->setTwoColorTint(true);
|
||||
|
||||
skeletonNode->setPosition(Vec2(RandomHelper::random_int(xMin, xMax), RandomHelper::random_int(yMin, yMax)));
|
||||
addChild(skeletonNode);
|
||||
}
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
Director::getInstance()->replaceScene(SequenceExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
BatchingExample::~BatchingExample() {
|
||||
// SkeletonAnimation instances are cocos2d-x nodes and are disposed of automatically as normal, but the data created
|
||||
// manually to be shared across multiple SkeletonAnimations needs to be disposed of manually.
|
||||
|
||||
delete _skeletonData;
|
||||
delete _stateData;
|
||||
delete _attachmentLoader;
|
||||
delete _atlas;
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _BATCHINGEXAMPLE_H_
|
||||
#define _BATCHINGEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
class BatchingExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(BatchingExample);
|
||||
~BatchingExample();
|
||||
|
||||
virtual bool init();
|
||||
|
||||
protected:
|
||||
Atlas *_atlas;
|
||||
AttachmentLoader *_attachmentLoader;
|
||||
SkeletonData *_skeletonData;
|
||||
AnimationStateData *_stateData;
|
||||
};
|
||||
|
||||
#endif// _BATCHINGEXAMPLE_H_
|
||||
@ -1,66 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "CoinExample.h"
|
||||
#include "MixAndMatchExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *CoinExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(CoinExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool CoinExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithBinaryFile("coin-pro.skel", "coin.atlas", 1);
|
||||
skeletonNode->setAnimation(0, "animation", true);
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled())
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(MixAndMatchExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _COINEXAMPLE_H_
|
||||
#define _COINEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class CoinExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(CoinExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
};
|
||||
|
||||
#endif// _COINXAMPLE_H_
|
||||
@ -1,67 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "GoblinsExample.h"
|
||||
#include "RaptorExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *GoblinsExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(GoblinsExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool GoblinsExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithJsonFile("goblins-pro.json", "goblins.atlas", 1.5f);
|
||||
skeletonNode->setAnimation(0, "walk", true);
|
||||
skeletonNode->setSkin("goblin");
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled())
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(RaptorExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _GOBLINSEXAMPLE_H_
|
||||
#define _GOBLINSEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class GoblinsExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(GoblinsExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
};
|
||||
|
||||
#endif// _GOBLINSEXAMPLE_H_
|
||||
@ -1,118 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "IKExample.h"
|
||||
#include "PhysicsExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
// This example demonstrates how to set the position
|
||||
// of a bone based on the touch position, which in
|
||||
// turn will make an IK chain follow that bone
|
||||
// smoothly.
|
||||
Scene *IKExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(IKExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool IKExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
// Load the Spineboy skeleton and create a SkeletonAnimation node from it
|
||||
// centered on the screen.
|
||||
skeletonNode = SkeletonAnimation::createWithJsonFile("spineboy-pro.json", "spineboy.atlas", 0.6f);
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||
addChild(skeletonNode);
|
||||
|
||||
// Queue the "walk" animation on the first track.
|
||||
skeletonNode->setAnimation(0, "walk", true);
|
||||
|
||||
// Queue the "aim" animation on a higher track.
|
||||
// It consists of a single frame that positions
|
||||
// the back arm and gun such that they point at
|
||||
// the "crosshair" bone. By setting this
|
||||
// animation on a higher track, it overrides
|
||||
// any changes to the back arm and gun made
|
||||
// by the walk animation, allowing us to
|
||||
// mix the two. The mouse position following
|
||||
// is performed in the lambda below.
|
||||
skeletonNode->setAnimation(1, "aim", true);
|
||||
|
||||
// Next we setup a listener that receives and stores
|
||||
// the current mouse location. The location is converted
|
||||
// to the skeleton's coordinate system.
|
||||
EventListenerMouse *mouseListener = EventListenerMouse::create();
|
||||
mouseListener->onMouseMove = [this](cocos2d::Event *event) -> void {
|
||||
// convert the mosue location to the skeleton's coordinate space
|
||||
// and store it.
|
||||
EventMouse *mouseEvent = dynamic_cast<EventMouse *>(event);
|
||||
position = skeletonNode->convertToNodeSpace(mouseEvent->getLocationInView());
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this);
|
||||
|
||||
// Position the "crosshair" bone at the mouse
|
||||
// location.
|
||||
//
|
||||
// When setting the crosshair bone position
|
||||
// to the mouse position, we need to translate
|
||||
// from "skeleton space" to "local bone space".
|
||||
// Note that the local bone space is calculated
|
||||
// using the bone's parent worldToLocal() function!
|
||||
//
|
||||
// After updating the bone position based on the
|
||||
// converted mouse location, we call updateWorldTransforms()
|
||||
// again so the change of the IK target position is
|
||||
// applied to the rest of the skeleton.
|
||||
skeletonNode->setPostUpdateWorldTransformsListener([this](SkeletonAnimation *node) -> void {
|
||||
Bone *crosshair = node->findBone("crosshair");// The bone should be cached
|
||||
float localX = 0, localY = 0;
|
||||
crosshair->getParent()->worldToLocal(position.x, position.y, localX, localY);
|
||||
crosshair->setX(localX);
|
||||
crosshair->setY(localY);
|
||||
|
||||
node->getSkeleton()->updateWorldTransform(spine::Physics_Update);
|
||||
});
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
Director::getInstance()->replaceScene(PhysicsExample::scene());
|
||||
return true;
|
||||
};
|
||||
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void IKExample::update(float deltaTime) {
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _IKEXAMPLE_H_
|
||||
#define _IKEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class IKExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(IKExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual void update(float deltaTime);
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
cocos2d::Vec2 position;
|
||||
};
|
||||
|
||||
#endif// _IKEXAMPLE_H_
|
||||
@ -1,87 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "MixAndMatchExample.h"
|
||||
#include "BatchingExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *MixAndMatchExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(MixAndMatchExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
MixAndMatchExample::~MixAndMatchExample() {
|
||||
delete skin;
|
||||
}
|
||||
|
||||
bool MixAndMatchExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithBinaryFile("mix-and-match-pro.skel", "mix-and-match.atlas", 0.5);
|
||||
skeletonNode->setAnimation(0, "dance", true);
|
||||
|
||||
// Create a new skin, by mixing and matching other skins
|
||||
// that fit together. Items making up the girl are individual
|
||||
// skins. Using the skin API, a new skin is created which is
|
||||
// a combination of all these individual item skins.
|
||||
SkeletonData *skeletonData = skeletonNode->getSkeleton()->getData();
|
||||
skin = new (__FILE__, __LINE__) Skin("mix-and-match");
|
||||
skin->addSkin(skeletonData->findSkin("skin-base"));
|
||||
skin->addSkin(skeletonData->findSkin("nose/short"));
|
||||
skin->addSkin(skeletonData->findSkin("eyelids/girly"));
|
||||
skin->addSkin(skeletonData->findSkin("eyes/violet"));
|
||||
skin->addSkin(skeletonData->findSkin("hair/brown"));
|
||||
skin->addSkin(skeletonData->findSkin("clothes/hoodie-orange"));
|
||||
skin->addSkin(skeletonData->findSkin("legs/pants-jeans"));
|
||||
skin->addSkin(skeletonData->findSkin("accessories/bag"));
|
||||
skin->addSkin(skeletonData->findSkin("accessories/hat-red-yellow"));
|
||||
skeletonNode->getSkeleton()->setSkin(skin);
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2 - 200));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled())
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(BatchingExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _MIXANDMATCHEXAMPLE_H_
|
||||
#define _MIXANDMATCHEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class MixAndMatchExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(MixAndMatchExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual ~MixAndMatchExample();
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
spine::Skin *skin;
|
||||
};
|
||||
|
||||
#endif// _MIXANDMATCHXAMPLE_H_
|
||||
@ -1,88 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "PhysicsExample.h"
|
||||
#include "SpineboyExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *PhysicsExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(PhysicsExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool PhysicsExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
// Load the Spineboy skeleton and create a SkeletonAnimation node from it
|
||||
// centered on the screen.
|
||||
skeletonNode = SkeletonAnimation::createWithBinaryFile("celestial-circus-pro.skel", "celestial-circus.atlas", 0.2f);
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, 200));
|
||||
addChild(skeletonNode);
|
||||
|
||||
// Queue the "walk" animation on the first track.
|
||||
// skeletonNode->setAnimation(0, "walk", true);
|
||||
|
||||
// Next we setup a listener that receives and stores
|
||||
// the current mouse location and updates the skeleton position
|
||||
// accordingly.
|
||||
EventListenerMouse *mouseListener = EventListenerMouse::create();
|
||||
mouseListener->onMouseMove = [this](cocos2d::Event *event) -> void {
|
||||
// convert the mosue location to the skeleton's coordinate space
|
||||
// and store it.
|
||||
EventMouse *mouseEvent = dynamic_cast<EventMouse *>(event);
|
||||
Vec2 mousePosition = skeletonNode->convertToNodeSpace(mouseEvent->getLocationInView());
|
||||
if (firstUpdate) {
|
||||
firstUpdate = false;
|
||||
lastMousePosition = mousePosition;
|
||||
return;
|
||||
}
|
||||
Vec2 delta = mousePosition - lastMousePosition;
|
||||
skeletonNode->getSkeleton()->physicsTranslate(-delta.x, -delta.y);
|
||||
lastMousePosition = mousePosition;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this);
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
Director::getInstance()->replaceScene(SpineboyExample::scene());
|
||||
return true;
|
||||
};
|
||||
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PhysicsExample::update(float deltaTime) {
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _PHYSICSEXAMPLE_H_
|
||||
#define _PHYSICSEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class PhysicsExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(PhysicsExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual void update(float deltaTime);
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
bool firstUpdate = true;
|
||||
cocos2d::Vec2 lastMousePosition;
|
||||
};
|
||||
|
||||
#endif// _PHYSICSEXAMPLE_H_
|
||||
@ -1,71 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "RaptorExample.h"
|
||||
#include "TankExample.h"
|
||||
#include <spine/Extension.h>
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *RaptorExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(RaptorExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool RaptorExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithJsonFile("raptor-pro.json", "raptor.atlas", 0.5f);
|
||||
skeletonNode->setAnimation(0, "walk", true);
|
||||
skeletonNode->addAnimation(1, "gun-grab", false, 2);
|
||||
skeletonNode->setTwoColorTint(true);
|
||||
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled()) {
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
skeletonNode->setDebugMeshesEnabled(true);
|
||||
} else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(TankExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _RAPTOREXAMPLE_H_
|
||||
#define _RAPTOREXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class RaptorExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(RaptorExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
float swirlTime;
|
||||
};
|
||||
|
||||
#endif// _RAPTOREXAMPLE_H_
|
||||
@ -1,61 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "SequenceExample.h"
|
||||
#include "IKExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *SequenceExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(SequenceExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool SequenceExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithBinaryFile("dragon-ess.skel", "dragon-pma.atlas", 1);
|
||||
skeletonNode->setAnimation(0, "flying", true);
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
Director::getInstance()->replaceScene(IKExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SEQUENCEEXAMPLE_H_
|
||||
#define _SEQUENCEEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class SequenceExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(SequenceExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,94 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "SkeletonRendererSeparatorExample.h"
|
||||
#include "GoblinsExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *SkeletonRendererSeparatorExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(SkeletonRendererSeparatorExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool SkeletonRendererSeparatorExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
// Spineboy's back, which will manage the animation and GPU resources
|
||||
// will render only the front slots of Spineboy
|
||||
backNode = SkeletonAnimation::createWithJsonFile("spineboy-pro.json", "spineboy.atlas", 0.6f);
|
||||
backNode->setMix("walk", "jump", 0.4);
|
||||
backNode->setAnimation(0, "walk", true);
|
||||
backNode->setSlotsRange(backNode->findSlot("rear-upper-arm")->getData().getIndex(), backNode->findSlot("rear-shin")->getData().getIndex());
|
||||
backNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||
|
||||
// A simple rectangle to go between the front and back slots of Spineboy
|
||||
betweenNode = DrawNode::create();
|
||||
Vec2 rect[4];
|
||||
rect[0] = Vec2(0, 0);
|
||||
rect[1] = Vec2(40, 0);
|
||||
rect[2] = Vec2(40, 200);
|
||||
rect[3] = Vec2(0, 200);
|
||||
betweenNode->drawPolygon(rect, 4, Color4F(1, 0, 0, 1), 1, Color4F(1, 0, 0, 1));
|
||||
betweenNode->setPosition(Vec2(_contentSize.width / 2 + 30, 20));
|
||||
// Spineboy's front, doesn't manage any skeleton, animation or GPU resources, but simply
|
||||
// renders the back slots of Spineboy. The skeleton, animatio state and GPU resources
|
||||
// are shared with the front node!
|
||||
frontNode = SkeletonRendererCocos2dX::createWithSkeleton(backNode->getSkeleton());
|
||||
frontNode->setSlotsRange(frontNode->findSlot("neck")->getData().getIndex(), -1);
|
||||
frontNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||
|
||||
// Add the front, between and back node in the correct order to this scene
|
||||
addChild(backNode);
|
||||
addChild(betweenNode);
|
||||
addChild(frontNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!backNode->getDebugBonesEnabled())
|
||||
backNode->setDebugBonesEnabled(true);
|
||||
else if (backNode->getTimeScale() == 1)
|
||||
backNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(GoblinsExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SkeletonRendererSeparatorExample::update(float deltaTime) {
|
||||
// Test releasing memory.
|
||||
// Director::getInstance()->replaceScene(SpineboyExample::scene());
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SKELETONRENDERERSEPARATOREXAMPLE_H_
|
||||
#define _SKELETONRENDERERSEPARATOREXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class SkeletonRendererSeparatorExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(SkeletonRendererSeparatorExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual void update(float deltaTime);
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *backNode;
|
||||
spine::SkeletonRendererCocos2dX *frontNode;
|
||||
cocos2d::DrawNode *betweenNode;
|
||||
};
|
||||
|
||||
#endif// _SKELETONRENDERERSEPARATOREXAMPLE_H_
|
||||
@ -1,91 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "SpineboyExample.h"
|
||||
#include "SkeletonRendererSeparatorExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *SpineboyExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(SpineboyExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool SpineboyExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithJsonFile("spineboy-pro.json", "spineboy.atlas", 0.6f);
|
||||
|
||||
skeletonNode->setStartListener([](TrackEntry *entry) { log("%d start: %s", entry->getTrackIndex(), entry->getAnimation()->getName().buffer()); });
|
||||
skeletonNode->setInterruptListener([](TrackEntry *entry) { log("%d interrupt", entry->getTrackIndex()); });
|
||||
skeletonNode->setEndListener([](TrackEntry *entry) { log("%d end", entry->getTrackIndex()); });
|
||||
skeletonNode->setCompleteListener([](TrackEntry *entry) { log("%d complete", entry->getTrackIndex()); });
|
||||
skeletonNode->setDisposeListener([](TrackEntry *entry) { log("%d dispose", entry->getTrackIndex()); });
|
||||
skeletonNode->setEventListener([](TrackEntry *entry, spine::Event *event) {
|
||||
log("%d event: %s, %d, %f, %s", entry->getTrackIndex(), event->getData().getName().buffer(), event->getIntValue(), event->getFloatValue(),
|
||||
event->getStringValue().buffer());
|
||||
});
|
||||
|
||||
skeletonNode->setMix("walk", "jump", 0.4);
|
||||
skeletonNode->setMix("jump", "run", 0.4);
|
||||
skeletonNode->setAnimation(0, "walk", true);
|
||||
TrackEntry *jumpEntry = skeletonNode->addAnimation(0, "jump", false, 1);
|
||||
skeletonNode->addAnimation(0, "run", true);
|
||||
|
||||
skeletonNode->setTrackStartListener(jumpEntry, [](TrackEntry *entry) { log("jumped!"); });
|
||||
|
||||
// skeletonNode->addAnimation(1, "test", true);
|
||||
// skeletonNode->runAction(RepeatForever::create(Sequence::create(FadeOut::create(1), FadeIn::create(1), DelayTime::create(5), NULL)));
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled())
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(SkeletonRendererSeparatorExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SpineboyExample::update(float deltaTime) {
|
||||
// Test releasing memory.
|
||||
// Director::getInstance()->replaceScene(SpineboyExample::scene());
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SPINEBOYEXAMPLE_H_
|
||||
#define _SPINEBOYEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class SpineboyExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(SpineboyExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual void update(float deltaTime);
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
};
|
||||
|
||||
#endif// _SPINEBOYEXAMPLE_H_
|
||||
@ -1,66 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "TankExample.h"
|
||||
#include "CoinExample.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace spine;
|
||||
|
||||
Scene *TankExample::scene() {
|
||||
Scene *scene = Scene::create();
|
||||
scene->addChild(TankExample::create());
|
||||
return scene;
|
||||
}
|
||||
|
||||
bool TankExample::init() {
|
||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||
|
||||
skeletonNode = SkeletonAnimation::createWithBinaryFile("tank-pro.skel", "tank.atlas", 0.5f);
|
||||
skeletonNode->setAnimation(0, "shoot", true);
|
||||
|
||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2 + 400, 20));
|
||||
addChild(skeletonNode);
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
EventListenerTouchOneByOne *listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch *touch, cocos2d::Event *event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled())
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(CoinExample::scene());
|
||||
return true;
|
||||
};
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _TANKEXAMPLE_H_
|
||||
#define _TANKEXAMPLE_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include <spine/spine-cocos2dx.h>
|
||||
|
||||
class TankExample : public cocos2d::LayerColor {
|
||||
public:
|
||||
static cocos2d::Scene *scene();
|
||||
|
||||
CREATE_FUNC(TankExample);
|
||||
|
||||
virtual bool init();
|
||||
|
||||
private:
|
||||
spine::SkeletonAnimation *skeletonNode;
|
||||
};
|
||||
|
||||
#endif// _TANKEXAMPLE_H_
|
||||
@ -1,157 +0,0 @@
|
||||
celestial-circus.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
scale: 0.4
|
||||
arm-back-down
|
||||
bounds: 971, 683, 38, 82
|
||||
arm-back-up
|
||||
bounds: 939, 44, 83, 116
|
||||
arm-front-down
|
||||
bounds: 971, 603, 36, 78
|
||||
arm-front-up
|
||||
bounds: 289, 22, 77, 116
|
||||
rotate: 90
|
||||
bench
|
||||
bounds: 586, 47, 189, 48
|
||||
body-bottom
|
||||
bounds: 868, 270, 154, 124
|
||||
body-top
|
||||
bounds: 2, 156, 126, 132
|
||||
offsets: 0, 0, 126, 133
|
||||
rotate: 90
|
||||
chest
|
||||
bounds: 490, 267, 104, 93
|
||||
rotate: 180
|
||||
cloud-back
|
||||
bounds: 804, 563, 202, 165
|
||||
rotate: 90
|
||||
cloud-front
|
||||
bounds: 606, 440, 325, 196
|
||||
rotate: 270
|
||||
collar
|
||||
bounds: 373, 739, 47, 26
|
||||
ear
|
||||
bounds: 106, 737, 20, 28
|
||||
eye-back-shadow
|
||||
bounds: 233, 755, 14, 10
|
||||
eye-front-shadow
|
||||
bounds: 128, 751, 24, 14
|
||||
eye-reflex-back
|
||||
bounds: 787, 758, 8, 7
|
||||
eye-reflex-front
|
||||
bounds: 154, 758, 10, 7
|
||||
eye-white-back
|
||||
bounds: 616, 749, 13, 16
|
||||
eye-white-front
|
||||
bounds: 477, 748, 22, 17
|
||||
eyelashes-down-back
|
||||
bounds: 655, 759, 11, 6
|
||||
eyelashes-down-front
|
||||
bounds: 549, 759, 15, 6
|
||||
eyelashes-top-back
|
||||
bounds: 353, 755, 18, 10
|
||||
eyelashes-top-front
|
||||
bounds: 749, 749, 30, 16
|
||||
face
|
||||
bounds: 775, 277, 91, 102
|
||||
offsets: 2, 0, 93, 102
|
||||
feathers-back
|
||||
bounds: 192, 611, 46, 46
|
||||
feathers-front
|
||||
bounds: 415, 679, 72, 86
|
||||
fringe-middle-back
|
||||
bounds: 794, 509, 33, 52
|
||||
fringe-middle-front
|
||||
bounds: 679, 202, 60, 50
|
||||
fringe-side-back
|
||||
bounds: 407, 5, 27, 94
|
||||
fringe-side-front
|
||||
bounds: 14, 331, 26, 93
|
||||
glove-bottom-back
|
||||
bounds: 14, 681, 51, 41
|
||||
glove-bottom-front
|
||||
bounds: 313, 288, 47, 48
|
||||
hair-back-1
|
||||
bounds: 716, 91, 132, 306
|
||||
rotate: 270
|
||||
hair-back-2
|
||||
bounds: 124, 100, 80, 285
|
||||
rotate: 90
|
||||
hair-back-3
|
||||
bounds: 410, 78, 70, 268
|
||||
rotate: 270
|
||||
hair-back-4
|
||||
bounds: 42, 250, 88, 262
|
||||
rotate: 90
|
||||
hair-back-5
|
||||
bounds: 320, 141, 88, 279
|
||||
rotate: 90
|
||||
hair-back-6
|
||||
bounds: 2, 36, 88, 286
|
||||
rotate: 90
|
||||
hair-hat-shadow
|
||||
bounds: 14, 724, 90, 41
|
||||
hand-back
|
||||
bounds: 2, 42, 60, 47
|
||||
hand-front
|
||||
bounds: 909, 208, 53, 60
|
||||
hat-back
|
||||
bounds: 741, 189, 64, 45
|
||||
hat-front
|
||||
bounds: 926, 396, 96, 56
|
||||
head-back
|
||||
bounds: 777, 2, 102, 86
|
||||
jabot
|
||||
bounds: 692, 384, 70, 55
|
||||
leg-back
|
||||
bounds: 362, 164, 210, 333
|
||||
rotate: 90
|
||||
leg-front
|
||||
bounds: 590, 181, 258, 320
|
||||
rotate: 90
|
||||
logo-brooch
|
||||
bounds: 584, 740, 16, 25
|
||||
mouth
|
||||
bounds: 631, 759, 22, 6
|
||||
neck
|
||||
bounds: 597, 441, 39, 56
|
||||
nose
|
||||
bounds: 556, 750, 6, 7
|
||||
nose-highlight
|
||||
bounds: 166, 761, 4, 4
|
||||
nose-shadow
|
||||
bounds: 778, 757, 7, 8
|
||||
pupil-back
|
||||
bounds: 442, 751, 10, 14
|
||||
pupil-front
|
||||
bounds: 602, 747, 12, 18
|
||||
rope-back
|
||||
bounds: 2, 273, 10, 492
|
||||
rope-front
|
||||
bounds: 2, 273, 10, 492
|
||||
rope-front-bottom
|
||||
bounds: 895, 69, 42, 65
|
||||
skirt
|
||||
bounds: 14, 325, 440, 246
|
||||
rotate: 90
|
||||
sock-bow
|
||||
bounds: 253, 733, 33, 32
|
||||
spine-logo-body
|
||||
bounds: 569, 733, 13, 32
|
||||
star-big
|
||||
bounds: 422, 741, 18, 24
|
||||
star-medium
|
||||
bounds: 1011, 757, 6, 8
|
||||
star-small
|
||||
bounds: 218, 761, 3, 4
|
||||
underskirt
|
||||
bounds: 212, 320, 445, 228
|
||||
rotate: 270
|
||||
underskirt-back
|
||||
bounds: 434, 332, 433, 171
|
||||
rotate: 270
|
||||
wing-back
|
||||
bounds: 137, 137, 146, 252
|
||||
rotate: 270
|
||||
wing-front
|
||||
bounds: 718, 314, 304, 248
|
||||
|
Before Width: | Height: | Size: 784 KiB |
@ -1,19 +0,0 @@
|
||||
coin.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
coin-front-logo
|
||||
bounds: 328, 266, 305, 302
|
||||
coin-front-shine-logo
|
||||
bounds: 635, 2, 282, 282
|
||||
coin-front-shine-spineboy
|
||||
bounds: 635, 286, 282, 282
|
||||
coin-front-spineboy
|
||||
bounds: 21, 266, 305, 302
|
||||
coin-side-round
|
||||
bounds: 2, 120, 144, 282
|
||||
rotate: 90
|
||||
coin-side-straight
|
||||
bounds: 2, 286, 17, 282
|
||||
shine
|
||||
bounds: 286, 192, 72, 245
|
||||
rotate: 90
|
||||
|
Before Width: | Height: | Size: 344 KiB |
@ -1,114 +0,0 @@
|
||||
dragon-pma.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
pma: true
|
||||
front-toe-a
|
||||
bounds: 300, 929, 29, 50
|
||||
front-toe-b
|
||||
bounds: 258, 660, 56, 57
|
||||
head
|
||||
bounds: 2, 719, 296, 260
|
||||
left-front-leg
|
||||
bounds: 99, 660, 84, 57
|
||||
left-wing09
|
||||
bounds: 2, 15, 264, 589
|
||||
rotate: 90
|
||||
right-wing07
|
||||
bounds: 647, 2, 365, 643
|
||||
right-wing08
|
||||
bounds: 2, 281, 365, 643
|
||||
rotate: 90
|
||||
right-wing09
|
||||
bounds: 354, 647, 365, 643
|
||||
rotate: 90
|
||||
tail04
|
||||
bounds: 185, 661, 56, 71
|
||||
rotate: 90
|
||||
tail06
|
||||
bounds: 2, 649, 95, 68
|
||||
thiagobrayner
|
||||
bounds: 2, 981, 350, 31
|
||||
|
||||
dragon-pma_2.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
pma: true
|
||||
back
|
||||
bounds: 647, 57, 190, 185
|
||||
chin
|
||||
bounds: 839, 28, 214, 146
|
||||
rotate: 90
|
||||
left-rear-leg
|
||||
bounds: 736, 244, 206, 177
|
||||
left-wing08
|
||||
bounds: 736, 423, 264, 589
|
||||
right-rear-toe
|
||||
bounds: 944, 312, 109, 77
|
||||
rotate: 90
|
||||
right-wing04
|
||||
bounds: 2, 2, 365, 643
|
||||
rotate: 90
|
||||
right-wing05
|
||||
bounds: 369, 369, 365, 643
|
||||
right-wing06
|
||||
bounds: 2, 369, 365, 643
|
||||
tail03
|
||||
bounds: 647, 275, 73, 92
|
||||
tail05
|
||||
bounds: 944, 251, 52, 59
|
||||
|
||||
dragon-pma_3.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
pma: true
|
||||
chest
|
||||
bounds: 858, 299, 136, 122
|
||||
left-front-thigh
|
||||
bounds: 647, 295, 84, 72
|
||||
left-rear-thigh
|
||||
bounds: 647, 117, 91, 149
|
||||
left-wing07
|
||||
bounds: 736, 423, 264, 589
|
||||
right-front-leg
|
||||
bounds: 647, 14, 101, 89
|
||||
rotate: 90
|
||||
right-front-thigh
|
||||
bounds: 740, 158, 108, 108
|
||||
right-rear-leg
|
||||
bounds: 740, 46, 116, 100
|
||||
right-rear-thigh
|
||||
bounds: 858, 148, 91, 149
|
||||
right-wing01
|
||||
bounds: 2, 2, 365, 643
|
||||
rotate: 90
|
||||
right-wing02
|
||||
bounds: 369, 369, 365, 643
|
||||
right-wing03
|
||||
bounds: 2, 369, 365, 643
|
||||
tail01
|
||||
bounds: 736, 268, 120, 153
|
||||
tail02
|
||||
bounds: 858, 26, 95, 120
|
||||
|
||||
dragon-pma_4.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
pma: true
|
||||
left-wing03
|
||||
bounds: 2, 2, 264, 589
|
||||
rotate: 90
|
||||
left-wing04
|
||||
bounds: 534, 268, 264, 589
|
||||
left-wing05
|
||||
bounds: 268, 268, 264, 589
|
||||
left-wing06
|
||||
bounds: 2, 268, 264, 589
|
||||
|
||||
dragon-pma_5.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
pma: true
|
||||
left-wing01
|
||||
bounds: 268, 2, 264, 589
|
||||
left-wing02
|
||||
bounds: 2, 2, 264, 589
|
||||
|
Before Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 279 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@ -1,105 +0,0 @@
|
||||
goblins.png
|
||||
size: 1024, 128
|
||||
filter: Linear, Linear
|
||||
dagger
|
||||
bounds: 372, 99, 26, 108
|
||||
rotate: 90
|
||||
goblin/eyes-closed
|
||||
bounds: 291, 13, 34, 12
|
||||
goblin/head
|
||||
bounds: 2, 35, 103, 66
|
||||
goblin/left-arm
|
||||
bounds: 900, 23, 37, 35
|
||||
goblin/left-foot
|
||||
bounds: 957, 60, 65, 31
|
||||
rotate: 90
|
||||
goblin/left-hand
|
||||
bounds: 498, 6, 36, 41
|
||||
rotate: 90
|
||||
goblin/left-lower-leg
|
||||
bounds: 747, 55, 33, 70
|
||||
goblin/left-shoulder
|
||||
bounds: 54, 4, 29, 44
|
||||
rotate: 90
|
||||
goblin/left-upper-leg
|
||||
bounds: 587, 28, 33, 73
|
||||
rotate: 90
|
||||
goblin/neck
|
||||
bounds: 455, 6, 36, 41
|
||||
rotate: 90
|
||||
goblin/pelvis
|
||||
bounds: 632, 63, 62, 43
|
||||
rotate: 90
|
||||
goblin/right-arm
|
||||
bounds: 455, 47, 23, 50
|
||||
goblin/right-foot
|
||||
bounds: 889, 62, 63, 33
|
||||
rotate: 90
|
||||
goblin/right-hand
|
||||
bounds: 823, 23, 36, 37
|
||||
goblin/right-lower-leg
|
||||
bounds: 377, 23, 36, 76
|
||||
rotate: 90
|
||||
goblin/right-shoulder
|
||||
bounds: 662, 8, 39, 45
|
||||
goblin/right-upper-leg
|
||||
bounds: 818, 62, 34, 63
|
||||
goblin/torso
|
||||
bounds: 205, 33, 68, 96
|
||||
rotate: 90
|
||||
goblin/undie-straps
|
||||
bounds: 157, 12, 55, 19
|
||||
goblin/undies
|
||||
bounds: 214, 2, 36, 29
|
||||
goblingirl/eyes-closed
|
||||
bounds: 252, 10, 37, 21
|
||||
goblingirl/head
|
||||
bounds: 482, 44, 103, 81
|
||||
goblingirl/left-arm
|
||||
bounds: 861, 25, 37, 35
|
||||
goblingirl/left-foot
|
||||
bounds: 924, 60, 65, 31
|
||||
rotate: 90
|
||||
goblingirl/left-hand
|
||||
bounds: 703, 13, 35, 40
|
||||
goblingirl/left-lower-leg
|
||||
bounds: 712, 55, 33, 70
|
||||
goblingirl/left-shoulder
|
||||
bounds: 939, 12, 28, 46
|
||||
goblingirl/left-upper-leg
|
||||
bounds: 677, 55, 33, 70
|
||||
goblingirl/neck
|
||||
bounds: 541, 7, 35, 41
|
||||
rotate: 90
|
||||
goblingirl/pelvis
|
||||
bounds: 587, 63, 62, 43
|
||||
rotate: 90
|
||||
goblingirl/right-arm
|
||||
bounds: 2, 5, 28, 50
|
||||
rotate: 90
|
||||
goblingirl/right-foot
|
||||
bounds: 854, 62, 63, 33
|
||||
rotate: 90
|
||||
goblingirl/right-hand
|
||||
bounds: 740, 16, 36, 37
|
||||
goblingirl/right-lower-leg
|
||||
bounds: 377, 61, 36, 76
|
||||
rotate: 90
|
||||
goblingirl/right-shoulder
|
||||
bounds: 782, 15, 39, 45
|
||||
goblingirl/right-upper-leg
|
||||
bounds: 782, 62, 34, 63
|
||||
goblingirl/torso
|
||||
bounds: 107, 33, 68, 96
|
||||
rotate: 90
|
||||
goblingirl/undie-straps
|
||||
bounds: 100, 12, 55, 19
|
||||
goblingirl/undies
|
||||
bounds: 969, 22, 36, 29
|
||||
rotate: 90
|
||||
shield
|
||||
bounds: 303, 27, 70, 72
|
||||
rotate: 90
|
||||
spear
|
||||
bounds: 2, 103, 22, 368
|
||||
rotate: 90
|
||||
|
Before Width: | Height: | Size: 161 KiB |
@ -1,350 +0,0 @@
|
||||
mix-and-match.png
|
||||
size: 1024, 512
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
base-head
|
||||
bounds: 185, 123, 95, 73
|
||||
boy/arm-front
|
||||
bounds: 729, 92, 36, 115
|
||||
rotate: 90
|
||||
boy/backpack
|
||||
bounds: 619, 218, 119, 153
|
||||
boy/backpack-pocket
|
||||
bounds: 626, 4, 34, 62
|
||||
rotate: 90
|
||||
boy/backpack-strap-front
|
||||
bounds: 342, 26, 38, 88
|
||||
rotate: 270
|
||||
boy/backpack-up
|
||||
bounds: 750, 12, 21, 70
|
||||
rotate: 90
|
||||
boy/body
|
||||
bounds: 716, 125, 97, 132
|
||||
rotate: 270
|
||||
boy/boot-ribbon-front
|
||||
bounds: 1012, 360, 9, 11
|
||||
boy/collar
|
||||
bounds: 764, 34, 73, 29
|
||||
boy/ear
|
||||
bounds: 878, 128, 19, 23
|
||||
boy/eye-back-low-eyelid
|
||||
bounds: 467, 245, 17, 6
|
||||
boy/eye-back-pupil
|
||||
bounds: 1012, 327, 8, 9
|
||||
boy/eye-back-up-eyelid
|
||||
bounds: 180, 348, 23, 5
|
||||
rotate: 90
|
||||
boy/eye-back-up-eyelid-back
|
||||
bounds: 282, 255, 19, 10
|
||||
boy/eye-front-low-eyelid
|
||||
bounds: 366, 364, 22, 7
|
||||
boy/eye-front-pupil
|
||||
bounds: 1012, 349, 9, 9
|
||||
boy/eye-front-up-eyelid
|
||||
bounds: 155, 340, 31, 6
|
||||
rotate: 270
|
||||
boy/eye-front-up-eyelid-back
|
||||
bounds: 338, 362, 26, 9
|
||||
boy/eye-iris-back
|
||||
bounds: 562, 12, 17, 17
|
||||
boy/eye-iris-front
|
||||
bounds: 807, 73, 18, 18
|
||||
boy/eye-white-back
|
||||
bounds: 317, 359, 20, 12
|
||||
boy/eye-white-front
|
||||
bounds: 499, 358, 27, 13
|
||||
boy/eyebrow-back
|
||||
bounds: 194, 360, 20, 11
|
||||
boy/eyebrow-front
|
||||
bounds: 290, 360, 25, 11
|
||||
boy/hair-back
|
||||
bounds: 929, 249, 122, 81
|
||||
rotate: 90
|
||||
boy/hair-bangs
|
||||
bounds: 2, 2, 70, 37
|
||||
boy/hair-side
|
||||
bounds: 997, 237, 25, 43
|
||||
boy/hand-backfingers
|
||||
bounds: 376, 15, 19, 21
|
||||
boy/hand-front-fingers
|
||||
bounds: 786, 72, 19, 21
|
||||
boy/hat
|
||||
bounds: 68, 89, 93, 56
|
||||
boy/leg-front
|
||||
bounds: 90, 213, 31, 158
|
||||
rotate: 180
|
||||
boy/mouth-close
|
||||
bounds: 187, 350, 21, 5
|
||||
rotate: 90
|
||||
girl-blue-cape/mouth-close
|
||||
bounds: 187, 350, 21, 5
|
||||
rotate: 90
|
||||
girl-spring-dress/mouth-close
|
||||
bounds: 187, 350, 21, 5
|
||||
rotate: 90
|
||||
girl/mouth-close
|
||||
bounds: 187, 350, 21, 5
|
||||
rotate: 90
|
||||
boy/mouth-smile
|
||||
bounds: 171, 342, 29, 7
|
||||
rotate: 90
|
||||
boy/nose
|
||||
bounds: 1005, 225, 17, 10
|
||||
boy/pompom
|
||||
bounds: 157, 40, 48, 43
|
||||
boy/zip
|
||||
bounds: 883, 163, 14, 23
|
||||
girl-blue-cape/back-eyebrow
|
||||
bounds: 137, 52, 18, 12
|
||||
girl-blue-cape/body-dress
|
||||
bounds: 185, 262, 109, 241
|
||||
offsets: 0, 0, 109, 246
|
||||
rotate: 90
|
||||
girl-blue-cape/body-ribbon
|
||||
bounds: 881, 28, 50, 38
|
||||
girl-blue-cape/cape-back
|
||||
bounds: 427, 237, 134, 193
|
||||
rotate: 90
|
||||
girl-blue-cape/cape-back-up
|
||||
bounds: 899, 126, 123, 106
|
||||
rotate: 180
|
||||
girl-blue-cape/cape-ribbon
|
||||
bounds: 427, 353, 50, 18
|
||||
girl-blue-cape/cape-shoulder-back
|
||||
bounds: 510, 3, 49, 59
|
||||
rotate: 90
|
||||
girl-blue-cape/cape-shoulder-front
|
||||
bounds: 310, 51, 62, 76
|
||||
rotate: 270
|
||||
girl-blue-cape/cape-up-front
|
||||
bounds: 388, 72, 98, 117
|
||||
rotate: 90
|
||||
girl-blue-cape/ear
|
||||
bounds: 376, 137, 19, 23
|
||||
girl-spring-dress/ear
|
||||
bounds: 376, 137, 19, 23
|
||||
girl/ear
|
||||
bounds: 376, 137, 19, 23
|
||||
girl-blue-cape/eye-back-low-eyelid
|
||||
bounds: 427, 345, 17, 6
|
||||
girl-spring-dress/eye-back-low-eyelid
|
||||
bounds: 427, 345, 17, 6
|
||||
girl/eye-back-low-eyelid
|
||||
bounds: 427, 345, 17, 6
|
||||
girl-blue-cape/eye-back-pupil
|
||||
bounds: 1012, 338, 8, 9
|
||||
girl-spring-dress/eye-back-pupil
|
||||
bounds: 1012, 338, 8, 9
|
||||
girl/eye-back-pupil
|
||||
bounds: 1012, 338, 8, 9
|
||||
girl-blue-cape/eye-back-up-eyelid
|
||||
bounds: 812, 210, 24, 12
|
||||
girl-spring-dress/eye-back-up-eyelid
|
||||
bounds: 812, 210, 24, 12
|
||||
girl/eye-back-up-eyelid
|
||||
bounds: 812, 210, 24, 12
|
||||
girl-blue-cape/eye-back-up-eyelid-back
|
||||
bounds: 427, 254, 17, 11
|
||||
girl-spring-dress/eye-back-up-eyelid-back
|
||||
bounds: 427, 254, 17, 11
|
||||
girl/eye-back-up-eyelid-back
|
||||
bounds: 427, 254, 17, 11
|
||||
girl-blue-cape/eye-front-low-eyelid
|
||||
bounds: 716, 365, 18, 6
|
||||
girl-spring-dress/eye-front-low-eyelid
|
||||
bounds: 716, 365, 18, 6
|
||||
girl/eye-front-low-eyelid
|
||||
bounds: 716, 365, 18, 6
|
||||
girl-blue-cape/eye-front-pupil
|
||||
bounds: 547, 362, 9, 9
|
||||
girl-spring-dress/eye-front-pupil
|
||||
bounds: 547, 362, 9, 9
|
||||
girl/eye-front-pupil
|
||||
bounds: 547, 362, 9, 9
|
||||
girl-blue-cape/eye-front-up-eyelid
|
||||
bounds: 74, 15, 30, 14
|
||||
girl-spring-dress/eye-front-up-eyelid
|
||||
bounds: 74, 15, 30, 14
|
||||
girl/eye-front-up-eyelid
|
||||
bounds: 74, 15, 30, 14
|
||||
girl-blue-cape/eye-front-up-eyelid-back
|
||||
bounds: 582, 149, 26, 11
|
||||
girl-spring-dress/eye-front-up-eyelid-back
|
||||
bounds: 582, 149, 26, 11
|
||||
girl/eye-front-up-eyelid-back
|
||||
bounds: 582, 149, 26, 11
|
||||
girl-blue-cape/eye-iris-back
|
||||
bounds: 442, 34, 17, 17
|
||||
girl-blue-cape/eye-iris-front
|
||||
bounds: 708, 95, 18, 18
|
||||
girl-blue-cape/eye-white-back
|
||||
bounds: 984, 232, 20, 16
|
||||
girl-spring-dress/eye-white-back
|
||||
bounds: 984, 232, 20, 16
|
||||
girl-blue-cape/eye-white-front
|
||||
bounds: 608, 224, 20, 16
|
||||
girl-spring-dress/eye-white-front
|
||||
bounds: 608, 224, 20, 16
|
||||
girl/eye-white-front
|
||||
bounds: 608, 224, 20, 16
|
||||
girl-blue-cape/front-eyebrow
|
||||
bounds: 424, 172, 18, 12
|
||||
girl-blue-cape/hair-back
|
||||
bounds: 305, 162, 117, 98
|
||||
girl-blue-cape/hair-bangs
|
||||
bounds: 694, 57, 91, 40
|
||||
girl-blue-cape/hair-head-side-back
|
||||
bounds: 397, 2, 30, 52
|
||||
rotate: 90
|
||||
girl-blue-cape/hair-head-side-front
|
||||
bounds: 933, 14, 41, 42
|
||||
rotate: 90
|
||||
girl-blue-cape/hair-side
|
||||
bounds: 203, 11, 36, 71
|
||||
rotate: 270
|
||||
girl-blue-cape/hand-front-fingers
|
||||
bounds: 694, 115, 19, 21
|
||||
girl-spring-dress/hand-front-fingers
|
||||
bounds: 694, 115, 19, 21
|
||||
girl-blue-cape/leg-front
|
||||
bounds: 60, 213, 30, 158
|
||||
rotate: 180
|
||||
girl-blue-cape/mouth-smile
|
||||
bounds: 162, 342, 29, 7
|
||||
rotate: 90
|
||||
girl-spring-dress/mouth-smile
|
||||
bounds: 162, 342, 29, 7
|
||||
rotate: 90
|
||||
girl/mouth-smile
|
||||
bounds: 162, 342, 29, 7
|
||||
rotate: 90
|
||||
girl-blue-cape/nose
|
||||
bounds: 558, 364, 11, 7
|
||||
girl-spring-dress/nose
|
||||
bounds: 558, 364, 11, 7
|
||||
girl/nose
|
||||
bounds: 558, 364, 11, 7
|
||||
girl-blue-cape/sleeve-back
|
||||
bounds: 157, 9, 42, 29
|
||||
girl-blue-cape/sleeve-front
|
||||
bounds: 839, 103, 52, 119
|
||||
girl-spring-dress/arm-front
|
||||
bounds: 122, 260, 17, 111
|
||||
girl-spring-dress/back-eyebrow
|
||||
bounds: 2, 199, 18, 12
|
||||
girl-spring-dress/body-up
|
||||
bounds: 2, 79, 64, 66
|
||||
girl-spring-dress/cloak-down
|
||||
bounds: 459, 18, 50, 50
|
||||
rotate: 180
|
||||
girl-spring-dress/cloak-up
|
||||
bounds: 247, 50, 61, 58
|
||||
offsets: 0, 0, 64, 58
|
||||
rotate: 270
|
||||
girl-spring-dress/eye-iris-back
|
||||
bounds: 875, 109, 17, 17
|
||||
girl-spring-dress/eye-iris-front
|
||||
bounds: 479, 353, 18, 18
|
||||
girl-spring-dress/front-eyebrow
|
||||
bounds: 893, 210, 18, 12
|
||||
girl-spring-dress/hair-back
|
||||
bounds: 834, 224, 147, 93
|
||||
rotate: 90
|
||||
girl-spring-dress/hair-bangs
|
||||
bounds: 914, 57, 91, 40
|
||||
girl-spring-dress/hair-head-side-back
|
||||
bounds: 217, 341, 30, 52
|
||||
rotate: 90
|
||||
girl-spring-dress/hair-head-side-front
|
||||
bounds: 582, 15, 41, 42
|
||||
rotate: 90
|
||||
girl-spring-dress/hair-side
|
||||
bounds: 84, 14, 36, 71
|
||||
rotate: 90
|
||||
girl-spring-dress/leg-front
|
||||
bounds: 30, 213, 30, 158
|
||||
rotate: 180
|
||||
girl-spring-dress/neck
|
||||
bounds: 283, 176, 20, 32
|
||||
girl-spring-dress/shoulder-ribbon
|
||||
bounds: 207, 58, 36, 24
|
||||
girl-spring-dress/skirt
|
||||
bounds: 121, 198, 182, 81
|
||||
rotate: 180
|
||||
girl-spring-dress/underskirt
|
||||
bounds: 8, 147, 175, 65
|
||||
girl/arm-front
|
||||
bounds: 907, 93, 36, 115
|
||||
rotate: 90
|
||||
girl/back-eyebrow
|
||||
bounds: 948, 236, 18, 12
|
||||
girl/bag-base
|
||||
bounds: 418, 52, 62, 58
|
||||
girl/bag-strap-front
|
||||
bounds: 141, 276, 12, 95
|
||||
offsets: 0, 1, 12, 96
|
||||
girl/bag-top
|
||||
bounds: 841, 7, 49, 50
|
||||
girl/body
|
||||
bounds: 476, 154, 97, 132
|
||||
rotate: 270
|
||||
girl/boot-ribbon-front
|
||||
bounds: 968, 235, 13, 13
|
||||
girl/eye-iris-back
|
||||
bounds: 929, 231, 17, 17
|
||||
girl/eye-iris-front
|
||||
bounds: 270, 353, 18, 18
|
||||
girl/eye-white-back
|
||||
bounds: 162, 324, 20, 16
|
||||
girl/front-eyebrow
|
||||
bounds: 527, 359, 18, 12
|
||||
girl/hair-back
|
||||
bounds: 739, 224, 147, 93
|
||||
rotate: 90
|
||||
girl/hair-bangs
|
||||
bounds: 534, 57, 91, 40
|
||||
girl/hair-flap-down-front
|
||||
bounds: 506, 31, 70, 65
|
||||
rotate: 180
|
||||
girl/hair-head-side-back
|
||||
bounds: 155, 276, 30, 52
|
||||
girl/hair-head-side-front
|
||||
bounds: 980, 17, 41, 42
|
||||
rotate: 90
|
||||
girl/hair-patch
|
||||
bounds: 424, 186, 66, 41
|
||||
rotate: 90
|
||||
girl/hair-side
|
||||
bounds: 265, 17, 36, 71
|
||||
rotate: 90
|
||||
girl/hair-strand-back-1
|
||||
bounds: 676, 24, 56, 74
|
||||
offsets: 2, 0, 58, 74
|
||||
rotate: 90
|
||||
girl/hair-strand-back-2
|
||||
bounds: 823, 54, 90, 53
|
||||
offsets: 1, 0, 91, 58
|
||||
girl/hair-strand-back-3
|
||||
bounds: 610, 138, 92, 79
|
||||
girl/hair-strand-front-1
|
||||
bounds: 157, 83, 38, 94
|
||||
rotate: 90
|
||||
girl/hair-strand-front-2
|
||||
bounds: 2, 27, 70, 50
|
||||
girl/hair-strand-front-3
|
||||
bounds: 74, 50, 44, 81
|
||||
rotate: 270
|
||||
girl/hand-front-fingers
|
||||
bounds: 162, 124, 19, 21
|
||||
girl/hat
|
||||
bounds: 282, 78, 93, 82
|
||||
girl/leg-front
|
||||
bounds: 2, 213, 30, 158
|
||||
girl/pompom
|
||||
bounds: 626, 40, 48, 43
|
||||
girl/scarf
|
||||
bounds: 499, 98, 119, 51
|
||||
girl/scarf-back
|
||||
bounds: 620, 85, 72, 51
|
||||
girl/zip
|
||||
bounds: 455, 173, 19, 25
|
||||
|
Before Width: | Height: | Size: 343 KiB |
@ -1,88 +0,0 @@
|
||||
raptor.png
|
||||
size: 1024, 512
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
back-arm
|
||||
bounds: 130, 32, 46, 25
|
||||
back-bracer
|
||||
bounds: 215, 11, 39, 28
|
||||
back-hand
|
||||
bounds: 847, 25, 36, 34
|
||||
back-knee
|
||||
bounds: 2, 8, 49, 67
|
||||
back-thigh
|
||||
bounds: 327, 8, 39, 24
|
||||
eyes-open
|
||||
bounds: 232, 309, 47, 45
|
||||
front-arm
|
||||
bounds: 421, 99, 48, 26
|
||||
front-bracer
|
||||
bounds: 885, 30, 41, 29
|
||||
front-hand
|
||||
bounds: 784, 184, 41, 38
|
||||
front-open-hand
|
||||
bounds: 771, 310, 43, 44
|
||||
front-thigh
|
||||
bounds: 635, 192, 57, 29
|
||||
gun
|
||||
bounds: 636, 83, 107, 103
|
||||
gun-nohand
|
||||
bounds: 174, 83, 105, 102
|
||||
head
|
||||
bounds: 291, 71, 136, 149
|
||||
rotate: 270
|
||||
lower-leg
|
||||
bounds: 930, 123, 73, 98
|
||||
mouth-grind
|
||||
bounds: 798, 29, 47, 30
|
||||
mouth-smile
|
||||
bounds: 749, 29, 47, 30
|
||||
neck
|
||||
bounds: 281, 333, 18, 21
|
||||
raptor-back-arm
|
||||
bounds: 470, 11, 82, 86
|
||||
rotate: 180
|
||||
raptor-body
|
||||
bounds: 2, 121, 632, 233
|
||||
raptor-front-arm
|
||||
bounds: 415, 18, 81, 102
|
||||
raptor-front-leg
|
||||
bounds: 525, 163, 191, 257
|
||||
rotate: 90
|
||||
raptor-hindleg-back
|
||||
bounds: 746, 139, 169, 215
|
||||
rotate: 180
|
||||
raptor-horn
|
||||
bounds: 2, 274, 182, 80
|
||||
raptor-horn-back
|
||||
bounds: 752, 61, 176, 77
|
||||
raptor-jaw
|
||||
bounds: 553, 2, 126, 138
|
||||
rotate: 270
|
||||
raptor-jaw-tooth
|
||||
bounds: 687, 223, 37, 48
|
||||
raptor-mouth-inside
|
||||
bounds: 178, 12, 36, 41
|
||||
raptor-saddle-strap-back
|
||||
bounds: 693, 7, 54, 74
|
||||
raptor-saddle-strap-front
|
||||
bounds: 2, 77, 57, 95
|
||||
raptor-saddle-w-shadow
|
||||
bounds: 2, 69, 162, 171
|
||||
rotate: 90
|
||||
raptor-tail-shadow
|
||||
bounds: 150, 25, 189, 63
|
||||
raptor-tongue
|
||||
bounds: 63, 13, 86, 64
|
||||
stirrup-back
|
||||
bounds: 341, 34, 44, 35
|
||||
stirrup-front
|
||||
bounds: 185, 304, 45, 50
|
||||
stirrup-strap
|
||||
bounds: 533, 221, 49, 46
|
||||
rotate: 90
|
||||
torso
|
||||
bounds: 930, 30, 54, 91
|
||||
visor
|
||||
bounds: 917, 223, 131, 84
|
||||
rotate: 90
|
||||
|
Before Width: | Height: | Size: 409 KiB |
@ -1,98 +0,0 @@
|
||||
spineboy.png
|
||||
size: 1024, 256
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
crosshair
|
||||
bounds: 263, 11, 45, 45
|
||||
eye-indifferent
|
||||
bounds: 214, 11, 47, 45
|
||||
eye-surprised
|
||||
bounds: 965, 33, 47, 45
|
||||
rotate: 90
|
||||
front-bracer
|
||||
bounds: 2, 5, 29, 40
|
||||
rotate: 90
|
||||
front-fist-closed
|
||||
bounds: 505, 3, 38, 41
|
||||
rotate: 90
|
||||
front-fist-open
|
||||
bounds: 790, 9, 43, 44
|
||||
rotate: 90
|
||||
front-foot
|
||||
bounds: 149, 21, 63, 35
|
||||
front-shin
|
||||
bounds: 505, 43, 41, 92
|
||||
rotate: 90
|
||||
front-thigh
|
||||
bounds: 359, 14, 23, 56
|
||||
rotate: 90
|
||||
front-upper-arm
|
||||
bounds: 955, 8, 23, 49
|
||||
rotate: 90
|
||||
goggles
|
||||
bounds: 180, 58, 131, 83
|
||||
gun
|
||||
bounds: 313, 39, 105, 102
|
||||
head
|
||||
bounds: 29, 83, 136, 149
|
||||
rotate: 90
|
||||
hoverboard-board
|
||||
bounds: 180, 143, 246, 76
|
||||
hoverboard-thruster
|
||||
bounds: 790, 57, 30, 32
|
||||
hoverglow-small
|
||||
bounds: 826, 54, 137, 38
|
||||
mouth-grind
|
||||
bounds: 707, 8, 47, 30
|
||||
mouth-oooo
|
||||
bounds: 658, 8, 47, 30
|
||||
mouth-smile
|
||||
bounds: 548, 11, 47, 30
|
||||
muzzle-glow
|
||||
bounds: 997, 194, 25, 25
|
||||
muzzle-ring
|
||||
bounds: 2, 114, 25, 105
|
||||
muzzle01
|
||||
bounds: 965, 82, 67, 40
|
||||
rotate: 90
|
||||
muzzle02
|
||||
bounds: 953, 151, 68, 42
|
||||
rotate: 90
|
||||
muzzle03
|
||||
bounds: 420, 31, 83, 53
|
||||
muzzle04
|
||||
bounds: 2, 36, 75, 45
|
||||
muzzle05
|
||||
bounds: 79, 43, 68, 38
|
||||
neck
|
||||
bounds: 997, 171, 18, 21
|
||||
portal-bg
|
||||
bounds: 563, 86, 133, 133
|
||||
portal-flare1
|
||||
bounds: 79, 11, 56, 30
|
||||
portal-flare2
|
||||
bounds: 836, 21, 57, 31
|
||||
portal-flare3
|
||||
bounds: 895, 22, 58, 30
|
||||
portal-shade
|
||||
bounds: 428, 86, 133, 133
|
||||
portal-streaks1
|
||||
bounds: 698, 91, 126, 128
|
||||
portal-streaks2
|
||||
bounds: 826, 94, 125, 125
|
||||
rear-bracer
|
||||
bounds: 756, 2, 28, 36
|
||||
rear-foot
|
||||
bounds: 599, 14, 57, 30
|
||||
rear-shin
|
||||
bounds: 599, 46, 38, 89
|
||||
rotate: 90
|
||||
rear-thigh
|
||||
bounds: 310, 9, 28, 47
|
||||
rotate: 90
|
||||
rear-upper-arm
|
||||
bounds: 417, 9, 20, 44
|
||||
rotate: 90
|
||||
torso
|
||||
bounds: 698, 40, 49, 90
|
||||
rotate: 90
|
||||
|
Before Width: | Height: | Size: 236 KiB |
@ -1,55 +0,0 @@
|
||||
tank.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
antenna
|
||||
bounds: 804, 452, 11, 152
|
||||
cannon
|
||||
bounds: 2, 322, 466, 29
|
||||
cannon-connector
|
||||
bounds: 647, 423, 56, 68
|
||||
ground
|
||||
bounds: 817, 92, 512, 177
|
||||
rotate: 90
|
||||
guntower
|
||||
bounds: 2, 2, 365, 145
|
||||
machinegun
|
||||
bounds: 773, 438, 166, 29
|
||||
rotate: 90
|
||||
machinegun-mount
|
||||
bounds: 773, 388, 36, 48
|
||||
rock
|
||||
bounds: 707, 314, 290, 64
|
||||
rotate: 90
|
||||
smoke-glow
|
||||
bounds: 647, 372, 50, 50
|
||||
smoke-puff01-bg
|
||||
bounds: 557, 57, 92, 62
|
||||
smoke-puff01-fg
|
||||
bounds: 651, 60, 88, 59
|
||||
smoke-puff02-fg
|
||||
bounds: 463, 85, 92, 62
|
||||
smoke-puff03-fg
|
||||
bounds: 369, 85, 92, 62
|
||||
smoke-puff04-fg
|
||||
bounds: 815, 42, 78, 48
|
||||
tank-bottom
|
||||
bounds: 2, 353, 643, 138
|
||||
tank-bottom-shadow
|
||||
bounds: 2, 149, 646, 171
|
||||
tank-top
|
||||
bounds: 2, 493, 704, 111
|
||||
tread
|
||||
bounds: 647, 355, 48, 15
|
||||
tread-inside
|
||||
bounds: 996, 590, 13, 14
|
||||
wheel-big
|
||||
bounds: 650, 216, 96, 96
|
||||
wheel-big-overlay
|
||||
bounds: 650, 121, 93, 93
|
||||
wheel-mid
|
||||
bounds: 745, 146, 68, 68
|
||||
wheel-mid-overlay
|
||||
bounds: 745, 76, 68, 68
|
||||
wheel-small
|
||||
bounds: 773, 350, 36, 36
|
||||
|
Before Width: | Height: | Size: 444 KiB |
@ -1,8 +0,0 @@
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
/.externalNativeBuild
|
||||
@ -1,2 +0,0 @@
|
||||
/build
|
||||
/.externalNativeBuild
|
||||
@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.esotericsoftware.spine"
|
||||
android:installLocation="auto">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000" />
|
||||
|
||||
<application
|
||||
android:label="@string/app_name"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
|
||||
<!-- Tell Cocos2dxActivity the name of our .so -->
|
||||
<meta-data android:name="android.app.lib_name"
|
||||
android:value="MyGame" />
|
||||
|
||||
<activity
|
||||
android:name="org.cocos2dx.cpp.AppActivity"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity="" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -1,99 +0,0 @@
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
ndkVersion "24.0.8215888"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.esotericsoftware.spine"
|
||||
minSdkVersion PROP_MIN_SDK_VERSION
|
||||
targetSdkVersion PROP_TARGET_SDK_VERSION
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
targets 'MyGame'
|
||||
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
|
||||
cppFlags "-frtti -fexceptions -fsigned-char"
|
||||
}
|
||||
}
|
||||
|
||||
ndk {
|
||||
abiFilters = []
|
||||
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
java.srcDir "src"
|
||||
res.srcDir "res"
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
assets.srcDir "../../Resources"
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path "../../CMakeLists.txt"
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
||||
release {
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
storeFile file(RELEASE_STORE_FILE)
|
||||
storePassword RELEASE_STORE_PASSWORD
|
||||
keyAlias RELEASE_KEY_ALIAS
|
||||
keyPassword RELEASE_KEY_PASSWORD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
debuggable false
|
||||
jniDebuggable false
|
||||
renderscriptDebuggable false
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
debug {
|
||||
debuggable true
|
||||
jniDebuggable true
|
||||
renderscriptDebuggable true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
def project_root_folder = "${projectDir}/../.."
|
||||
def dest_assets_folder = "${projectDir}/assets"
|
||||
|
||||
// delete previous files first
|
||||
delete dest_assets_folder
|
||||
def targetName = variant.name.capitalize()
|
||||
def copyTaskName = "copy${targetName}ResourcesToAssets"
|
||||
|
||||
tasks.register(copyTaskName) {
|
||||
copy {
|
||||
from "${buildDir}/../../../Resources"
|
||||
into "${buildDir}/intermediates/assets/${variant.dirName}"
|
||||
exclude "**/*.gz"
|
||||
}
|
||||
}
|
||||
tasks.getByName("pre${targetName}Build").dependsOn copyTaskName
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation project(':libcocos2dx')
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include "AppDelegate.h"
|
||||
|
||||
#define LOG_TAG "main"
|
||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
||||
|
||||
namespace {
|
||||
std::unique_ptr<AppDelegate> appDelegate;
|
||||
}
|
||||
|
||||
void cocos_android_app_init(JNIEnv *env) {
|
||||
LOGD("cocos_android_app_init");
|
||||
appDelegate.reset(new AppDelegate());
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Proguard Cocos2d-x for release
|
||||
-keep public class org.cocos2dx.** { *; }
|
||||
-dontwarn org.cocos2dx.**
|
||||
-keep public class com.chukong.** { *; }
|
||||
-dontwarn com.chukong.**
|
||||
-keep public class com.huawei.android.** { *; }
|
||||
-dontwarn com.huawei.android.**
|
||||
|
||||
# Proguard Apache HTTP for release
|
||||
-keep class org.apache.http.** { *; }
|
||||
-dontwarn org.apache.http.**
|
||||
|
||||
# Proguard Android Webivew for release. uncomment if you are using a webview in cocos2d-x
|
||||
#-keep public class android.net.http.SslError
|
||||
#-keep public class android.webkit.WebViewClient
|
||||
|
||||
#-dontwarn android.webkit.WebView
|
||||
#-dontwarn android.net.http.SslError
|
||||
#-dontwarn android.webkit.WebViewClient
|
||||
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 18 KiB |
@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">spine-cocos2dx-example</string>
|
||||
</resources>
|
||||
@ -1,58 +0,0 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2015-2016 Chukong Technologies Inc.
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
package org.cocos2dx.cpp;
|
||||
|
||||
import android.os.Bundle;
|
||||
import org.cocos2dx.lib.Cocos2dxActivity;
|
||||
import android.os.Build;
|
||||
import android.view.WindowManager;
|
||||
import android.view.WindowManager.LayoutParams;
|
||||
|
||||
public class AppActivity extends Cocos2dxActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.setEnableVirtualButton(false);
|
||||
super.onCreate(savedInstanceState);
|
||||
// Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508
|
||||
if (!isTaskRoot()) {
|
||||
// Android launched another instance of the root activity into an existing task
|
||||
// so just quietly finish and go away, dropping the user back into the activity
|
||||
// at the top of the stack (ie: the last state of this task)
|
||||
// Don't need to finish it again since it's finished in super.onCreate .
|
||||
return;
|
||||
}
|
||||
// Make sure we're running on Pie or higher to change cutout mode
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
// Enable rendering into the cutout area
|
||||
WindowManager.LayoutParams lp = getWindow().getAttributes();
|
||||
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||
getWindow().setAttributes(lp);
|
||||
}
|
||||
// DO OTHER INITIALIZATION BELOW
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
|
||||
# Android SDK version that will be used as the compile project
|
||||
PROP_COMPILE_SDK_VERSION=28
|
||||
|
||||
# Android SDK version that will be used as the earliest version of android this application can run on
|
||||
PROP_MIN_SDK_VERSION=16
|
||||
|
||||
# Android SDK version that will be used as the latest version of android this application has been tested on
|
||||
PROP_TARGET_SDK_VERSION=28
|
||||
|
||||
|
||||
# List of CPU Archtexture to build that application with
|
||||
# Available architextures (armeabi-v7a | arm64-v8a | x86)
|
||||
# To build for multiple architexture, use the `:` between them
|
||||
# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86
|
||||
PROP_APP_ABI=armeabi-v7a
|
||||
|
||||
# uncomment it and fill in sign information for release mode
|
||||
#RELEASE_STORE_FILE=file path of keystore
|
||||
#RELEASE_STORE_PASSWORD=password of keystore
|
||||
#RELEASE_KEY_ALIAS=alias of key
|
||||
#RELEASE_KEY_PASSWORD=password of key
|
||||
|
||||
android.injected.testOnly=false
|
||||
@ -1,7 +0,0 @@
|
||||
#Tue Mar 14 17:40:59 CST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||
|
||||
164
spine-cocos2dx/example/proj.android/gradlew
vendored
@ -1,164 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
90
spine-cocos2dx/example/proj.android/gradlew.bat
vendored
@ -1,90 +0,0 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@ -1,4 +0,0 @@
|
||||
include ':libcocos2dx'
|
||||
project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx')
|
||||
include ':spine-cocos2dx-example'
|
||||
project(':spine-cocos2dx-example').projectDir = new File(settingsDir, 'app')
|
||||
@ -1,36 +0,0 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2010-2013 cocos2d-x.org
|
||||
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class RootViewController;
|
||||
|
||||
@interface AppController : NSObject <UIApplicationDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, readonly) RootViewController *viewController;
|
||||
|
||||
@end
|
||||
@ -1,153 +0,0 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2010-2013 cocos2d-x.org
|
||||
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import "AppController.h"
|
||||
#import "cocos2d.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "RootViewController.h"
|
||||
|
||||
@implementation AppController
|
||||
|
||||
@synthesize window;
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Application lifecycle
|
||||
|
||||
// cocos2d application instance
|
||||
static AppDelegate s_sharedApplication;
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
cocos2d::Application *app = cocos2d::Application::getInstance();
|
||||
|
||||
// Initialize the GLView attributes
|
||||
app->initGLContextAttrs();
|
||||
cocos2d::GLViewImpl::convertAttrs();
|
||||
|
||||
// Override point for customization after application launch.
|
||||
|
||||
// Add the view controller's view to the window and display.
|
||||
window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
|
||||
|
||||
// Use RootViewController to manage CCEAGLView
|
||||
_viewController = [[RootViewController alloc]init];
|
||||
_viewController.wantsFullScreenLayout = YES;
|
||||
|
||||
|
||||
// Set RootViewController to window
|
||||
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
|
||||
{
|
||||
// warning: addSubView doesn't work on iOS6
|
||||
[window addSubview: _viewController.view];
|
||||
}
|
||||
else
|
||||
{
|
||||
// use this method on ios6
|
||||
[window setRootViewController:_viewController];
|
||||
}
|
||||
|
||||
[window makeKeyAndVisible];
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:true];
|
||||
|
||||
//Launching the app with the arguments -NSAllowsDefaultLineBreakStrategy NO to force back to the old behavior.
|
||||
if ( [[UIDevice currentDevice].systemVersion floatValue] >= 13.0f)
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSAllowsDefaultLineBreakStrategy"];
|
||||
}
|
||||
|
||||
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
|
||||
cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView((__bridge void *)_viewController.view);
|
||||
cocos2d::Director::getInstance()->setOpenGLView(glview);
|
||||
|
||||
//run the cocos2d-x game scene
|
||||
app->run();
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
/*
|
||||
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
*/
|
||||
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
||||
/* cocos2d::Director::getInstance()->pause(); */
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
/*
|
||||
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
*/
|
||||
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
||||
/* cocos2d::Director::getInstance()->resume(); */
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
/*
|
||||
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
|
||||
*/
|
||||
cocos2d::Application::getInstance()->applicationDidEnterBackground();
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
/*
|
||||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
|
||||
*/
|
||||
cocos2d::Application::getInstance()->applicationWillEnterForeground();
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
/*
|
||||
Called when the application is about to terminate.
|
||||
See also applicationDidEnterBackground:.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Memory management
|
||||
|
||||
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
|
||||
/*
|
||||
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
#if __has_feature(objc_arc)
|
||||
#else
|
||||
- (void)dealloc {
|
||||
[window release];
|
||||
[_viewController release];
|
||||
[super dealloc];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@end
|
||||
@ -1,157 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-29.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-57.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-57@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-20.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-29.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-40.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-50.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-50@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-72.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-72@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 32 KiB |
@ -1,6 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||