4

I'm trying out cocos2d-x and got to the point where I can build the Javascript samples for Android and run them inside a browser as well.

Now I want to create my own game, but coming from a HTML background, I'd rather use HTML tags with CSS than use Javascript to setup the user interface.

I've read about UIWebView which can display HTML-pages in an app, but I was wondering if anyone has ever done this in combination with Cocos2D-x ? And could this be transparent, to overlay a normal cocos2d-x screen in the app then? If so, how could this be done?

Dylan
  • 9,129
  • 20
  • 96
  • 153
  • have you posted this question on their forums or something similar? An interesting question but this might be closed because it seems very specific to that particular platform/sdk. – cbrulak Jan 02 '14 at 19:41

1 Answers1

3

You can use CCXWebview for that with Cocos2d-x. This extension is based on Cocos2d-x 2.0.4 and it seems to work also on Cocos2d-x 2.x with some modification.

However, if you want to use Cocos2d-x 3.0 for Android, you cannot use it because Cocos2d-x 3.0 uses NativeActivity, thus you cannot combine Android WebView on the Cocos2d-x screen.

EDITED

only problem is that I have little knowledge of Java or C++ ... It would take me years to figure the Java and C++ things out :)

So why are you sticking to use Cocos2d-x??? Why don't you use Cocos2d-html5? It has same functionality as Cocos2d-x JavaScript binding and it uses HTML5 Canvas, so you can use DOM with it.

https://twitter.com/hyperandroid/status/311534580962295809 :

Cocoonjs can run Cocos2d-html5 games too.

Kazuki Sakamoto
  • 13,929
  • 2
  • 34
  • 96
  • Thanks, only problem is that I have little knowledge of Java or C++. It took me weeks to just be able to compile the Javascript-binding examples in both Eclipse and Intellij IDEA (on Windows). It would take me years to figure the Java and C++ things out :) – Dylan Jan 10 '14 at 23:21
  • Well, the ultimate goal is to create apps for Android and iOS, and as far as I understand it, using DOM will not be possible when compiling into an app. I have looked at CocoonJS, but I don't like their compile-in-the-cloud-only strategy, and their pricing is also uncertain... So I was hoping for an 'easy' hybrid solution with cocos2d-x... – Dylan Jan 12 '14 at 19:40
  • 1
    CCXWebview is one of the most easist hybrid solution with cocos2d-x. – Kazuki Sakamoto Jan 12 '14 at 23:22
  • excuse me, is CCXWebview compatible with Cocos2dx JS? – heximal Jun 15 '16 at 04:37