輕博客網(wǎng)站開發(fā)去了外包簡歷就毀了嗎
實(shí)現(xiàn)原理:cocos本身在平臺中屬于view,所以可以把webview放在底層,以達(dá)到目標(biāo)。
實(shí)現(xiàn)過程:參考?cocos creator(2.4.7版本) videoplayer 可以在上層添加UI控件()
需要增加以下過程:
AppActivity.java@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);myAppActivity = this;viewHandler = new ViewHandler(this);// Workaround in// https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508if (!isTaskRoot()) {// Android launched another instance of the root activity into an existing task// so just quietly finish and go away, dropping the user back into the activity// at the top of the stack (ie: the last state of this task)// Don't need to finish it again since it's finished in super.onCreate .return;}// DO OTHER INITIALIZATION BELOWSDKWrapper.getInstance().init(this);// 增加以下代碼getGLSurfaceView().getHolder().setFormat(PixelFormat.TRANSLUCENT);getGLSurfaceView().setZOrderOnTop(true);}
解決UI控件不能點(diǎn)擊的問題
Cocos2dxWebView.java// 重寫父類public boolean onTouchEvent(MotionEvent event) {return false;}
這個(gè)時(shí)候控件可以點(diǎn)擊了,web view內(nèi)容無法點(diǎn)擊操作了。。。。ps:玩游戲去了,后面再👀