2.3.0 • Published 2 years ago
ccrn v2.3.0
Cocos Creator Game Importer for React Native
A CLI tool to import Cocos Creator games into React Native app natively (not using webview)
Prerequisite
- Install node.js v9.11.2 +
- Install cocoapods/xcodeproj
Install
npm install ccrn -g
Commands
ccrn init
: init the engine & dependencies
ccrn run-ios
: import the engine to your xcode workspace
ccrn run-android
: import the engine to your Android project
ccrn run
: run for both platform
Usages
At root folder of your React Native project, run ccrn run
to import both Android and IOS project
Use CCRNModule in your ts file
import React from 'react';
import {View, Button} from 'react-native';
import CCRNModule from './ts/CCRNModule';
function App(): JSX.Element {
return (
<View>
<Button
onPress={() => {
CCRNModule.startGame("happy-pop");
}}
title={'happy-pop-1'}
/>
<Button
onPress={() => {
CCRNModule.startGame("space-shooter");
}}
title={'space-shooter'}
/>
</View>
);
}
export default App;