Skip to content

Latest commit

 

History

History
107 lines (68 loc) · 3.42 KB

construct_2.md

File metadata and controls

107 lines (68 loc) · 3.42 KB

Construct 2 Engine

Downloads

Open source, clone https://github.com/ouya/ouya-sdk-examples/tree/master/Construct2

Forums

@OUYA - (Construct 2 on OUYA Forums) - http://forums.ouya.tv/categories/construct2-on-ouya

Guide

Examples

[VirtualControllers] - Maps OUYA controllers to virtual controllers.

Resources

Construct 2 - https://www.scirra.com/construct2

Supported Platforms - https://www.scirra.com/manual/168/supported-platforms

PhoneGap - https://build.phonegap.com/

CocoonJS - http://ludei.com/

Construct 2

Construct 2 is an visually programable engine that publishes HTML5.

Publishing to the OUYA requires that you package the generated HTML into PhoneGAP or CocoonJS.

Make your own [JavaScript plugins] with the JavaScript SDK.

PhoneGap

PhoneGap has a [plugin API] that allows adding custom HTML tags with callbacks to interface HTML5 with Java for two-way communication.

With PhoneGap, you can customize your Android.manifest and embed your custom plugins to work with your HTML5 from Construct 2.

Crosswalk Project

https://crosswalk-project.org/

CocoonJS

Setup
  1. Create yourself a free developer account on https://ludei.com
  2. Install CocoonJS Launcher on OUYA. Go to dev portal (create a project) and click 'Compile Launcher' under COMPILATION. You'll get an email in a few mins with zip. Unzip it and adb install debug apk of CocoonJS Launcher.
Hello World
  1. Create an empty project directory

  2. Make index.html:

<html>
<body>
 <canvas/>
 <script>
   var canvas = document.getElementsByTagName('canvas')[0];
   var ctx = canvas.getContext('2d');
   ctx.fillStyle = 'white';
   ctx.font = '6px Arial';
   ctx.fillText('Hello World', 10, 10);
 </script>
 </body>
</html>
  1. Zip it: zip -r hello_world.zip *

  2. Copy it to OUYA: adb push hello_world.zip /mnt/sdcard/

  3. Now go to OUYA / MAKE / SOFTWARE and open CocoonJS Launcher

Pro tip: Use real mouse to work in CocoonJS Launcher as it does not listen to gamepad and using OUYA's touch pad is a real pain.

  1. If this is your first time, you'll need to log in to your free https://ludei.com/ account. Also, click cogwheel at the top right and make sure DEBUG option is checked and ORIENTATION is Landscape.

  2. Click 'YOUR APP', you should see hello_world.zip in 'ZIPS IN SD CARD'. Run it. You'll see 'Hello World' in a really blurry font.

Pro tip: To quickly reload an app after you've made changes click 'fps:NN' box at the top left, click 'Actions' and 'Reload'.

Development cycle
  1. Edit your html/js/css files locally and test them in browser
  2. zip -r <project-name>.zip *
  3. adb push <project-name>zip /mnt/sdcard/ On OUYA first time:
  4. Open Launcher
  5. Go to 'YOUR APP'
  6. Open .zip On OUYA when your app is already open:
  7. Click 'FPS:nn' in the top-left corner, 'ACTIONS', 'RELOAD'.
APK compilation
  1. zip -r <project-name>.zip *
  2. Go to dev portal and 'Compile Project'
  3. Upload your zip
  4. Select 'Ouya' in 'Compile project for'
  5. Agree to their 'Upload Conditions'
  6. Submit

You'll get email in a few minutes with zip. Two apks inside.