的Cocos2D-X:可以使用HTML(UIWebView的)? [英] Cocos2d-x: possible to use HTML (UIWebView)?
问题描述
我想了的cocos2d-X
,得到的地步,我可以建立Javascript的样本为Android和浏览器内运行它们。
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.
现在我要创造我自己的比赛,但是从HTML背景的,我宁愿使用的HTML标签的CSS不是使用JavaScript来设置用户界面。
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.
我读过有关的UIWebView可以显示的HTML页面中的应用程序,但我想知道是否有人曾经做过这种结合的Cocos2D-X?而这会是透明的,叠加的应用程序正常的cocos2d-X的屏幕呢? 如果是这样,怎么会这样呢?
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?
推荐答案
您可以使用 CCXWebview 为用的Cocos2D-X。这个扩展是基于cocos2d的-X 2.0.4,它似乎也工作的Cocos2D-X 2.x的一些修改。
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.
不过,如果你想使用的Cocos2D-X 3.0 Android版,您不能使用它,因为的Cocos2D-X 3.0使用NativeActivity的,所以你不能合并的Android的WebView中的Cocos2D-X的屏幕上。
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
唯一的问题是,我有Java或C知之甚少++ ...这将需要好几年推测的Java和C ++的事情了:)
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 :)
那么,为什么你坚持使用的Cocos2D-X ???你为什么不使用的Cocos2D-HTML5?它具有相同的功能的Cocos2D-X的JavaScript绑定和它使用HTML5的画布,所以你可以使用DOM它。
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可以运行的Cocos2D-HTML5游戏了。
Cocoonjs can run Cocos2d-html5 games too.
这篇关于的Cocos2D-X:可以使用HTML(UIWebView的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!