Cocos2d-x: can I use HTML (UIWebView)?

I am testing cocos2d-xand getting to the point where I can create Javascript samples for Android and run them in a browser.

Now I want to create my own game, but based on the HTML background, I would rather use HTML tags with CSS than use Javascript to customize the user interface.

I read about a UIWebView that can render HTML pages in an application, but I was wondering, has anyone ever done this in conjunction with Cocos2D-x? And can it be transparent, then to overlay the regular cocos2d-x screen in the application? If so, how can this be done?

+4
source share
1 answer

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

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

EDITED

the only problem is that I have little knowledge of Java or C ++ ... It took me years to understand what Java and C ++ are :)

So why do you stick with using Cocos2d-x ??? Why aren't you using Cocos2d-html5? It has the same functionality as Cocos2d-x JavaScript bindings and uses HTML5 Canvas, so you can use the DOM with it.

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

Cocoonjs Cocos2d-html5.

+3

All Articles