Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So, I finally managed to resolve my issue, and it was way easier than I thought. Instead of going with the c++ source modifications, I found a function in the Cocos2dxHelper java class which is the nativeSetApkPath. After investigating the use of it, it turned out that Cocos2dx handles the apk package as a zip file. Since my obb is just a renamed zip file after all, I could use it without any problem. All of my assets were loaded fine, except the sounds. Which requires another quick fix.</p> <p>Most of the credit goes to a forum post (<a href="http://www.cocos2d-x.org/boards/6/topics/11243">http://www.cocos2d-x.org/boards/6/topics/11243</a>) and to Irwin Billing, since that was a base I could use for my modifications in the Cocos2dxMusic.java and Cocos2dxSound.java classes.</p> <p>Also, I had to be sure that the sound assets were not compressed in the zip file (according to the documentations provided by Google).</p> <p>For that I used the following command on my Mac:</p> <pre><code>zip -rn .ogg:.mp3:.wav assets.zip assets/ </code></pre> <p>The last thing I'd like to mention is the folder structure. I copypasted and zipped the assets folder, so I have a folder inside my zip file. Which is great, since the apk works the same way, I had to do no more modifications. </p> <p>Finally my modified source files, just dont forget to go through it, and change some values Cocos2dxHelper.java: <a href="http://pastebin.com/RqeYkTkP">http://pastebin.com/RqeYkTkP</a></p> <p>Cocos2dxMusic.java: <a href="http://pastebin.com/RXjwmEyb">http://pastebin.com/RXjwmEyb</a></p> <p>Cocos2dxSound.java: <a href="http://pastebin.com/1GfDB6jb">http://pastebin.com/1GfDB6jb</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload