Dylan
Dylan

Reputation: 9373

Cocos2d-x: possible to use HTML (UIWebView)?

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?

Upvotes: 4

Views: 3934

Answers (1)

Kazuki Sakamoto
Kazuki Sakamoto

Reputation: 13999

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.

Upvotes: 3

Related Questions