Jump to content

CocoonJS + Pixi.js - example project


benny!
 Share

Recommended Posts

Hi all,

 

after releasing my first CocoonJS port using Pixi called Yummy Plate, I thought I share some experience I made with it.

 

The experience below is based on the following versions:

 

- Pixi.js V1.2&1.3

- CocoonJS version 1.4.4.

 

 

1.) Setting Canvas To Fullscreen Mode

 

You have to keep an eye on what renderer you use in PIXI. WebGL or Canvas.

 

CanvasRenderer:

Not a problem - simple use e.g. canvas.style.cssText="idtkscale:ScaleAspectFill;" to scale up your canvas in CocoonJS environment.

 

WebGLRenderer:

Make sure to place all game objects in a display container which is scaled up to window.innerWidth and window.innerHeight. Refer to this thread for more details.

 

 

I choosed the CanvasRenderer using CocoonJS' screencanvas. This accelerates and optimizes the canvas operations anyway. Performance-wise it worked very well as far as I could test it.

 

 

2.) Touch input

 

Current version of CocoonJS seems to have some problems with the way Pixi.js processes the touch events. For Yummy Plate it was not the big deal. However, the guys from Ludei are already working on the problem. Read this thread for more information.

 

 

3.) Bitmap Font Loader

 

Yummy Plate uses bitmap fonts. Loading bitmap fonts requires XML parsing. Unfortunately, there is no XML parser available in the current CocoonJS version. What I did, was convertig the XML generated bitmap font file into JSON format and replaces the bitmap font loaded with the json loader.

 

 

Apart from above's points - converting the project to a native (android) application was really advanced. Thanks to Ludei, I could also test some of their premium features, and so far I really have to say that I like the CocoonJS environment.

 

 

Feel free to check out Yummy Plate by yourself if you have an android device:

 

en_generic_rgb_wo_45.png

 

A nice rating is always welcome ;-)

 

Best,

benny!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...