Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
My Ebook Source Code - Gideros Forum

My Ebook Source Code

marbolecmarbolec Member
edited November 2012 in General questions
Here source code of my first app created using Gideros Mobile: https://www.box.com/s/bt76jl092zx6yzgurivt
You can get the iPad version here: bit.ly/Uza6aN (it's in Indonesian language)
It's still far from perfect :p
I got many problems when tried to deploy to android device. Here my problems:
- Scene transition is not smooth
- The background and sprites sometimes goes blank / black.
- How to close the app using the back button? sorry for noob question :p
- On eclipse, its show so many messages like this: called unimplemented openGL ES api :D

Please take a look at the code and help me to fix the problems..

Likes: OZApps, plamen

Tagged:
+1 -1 (+2 / -0 ) Share on Facebook

Comments

  • That is brilliantly done. Congratulations...

    Likes: marbolec

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+1 / -0 ) Share on Facebook
  • ScouserScouser Guru
    Accepted Answer
    @marbolec: To use the back button to close the app. Try something like this:-
    In your sceneController:init function, add the line
    	self:addEventListener(Event.KEY_UP, self.onKeyUp, self)
    Then add this function. It should do what you require
    function sceneController:onKeyUp(event)
    	if event.keyCode == KeyCode.BACK then
    		if application:getDeviceInfo() == "Android" then
    			application:exit()
    		end
    	end
    end

    Likes: marbolec

    +1 -1 (+1 / -0 ) Share on Facebook
  • Thanks @Scouser . Actually I'm not using scenecontroller, just put the next/back button code in every page files. So I just put your code in the main.lua file right?..

    On iOS, I'm not using texture packer and all image/sprite show properly. I tried re-create the code for Android and using texture packer. Works properly on gideros player, but on android device an emulator, some images just show black square :(
  • @marbolec you tried on android emulator? You should try on real device, I don't think that Android emulator is capable of handling OpenGL calls, thus you are getting called unimplemented openGL ES api and lot's of lags.

    It all will work on device if it works in Gideros player ;)

    Likes: marbolec

    Dislikes: anneMurielle

    +1 -1 (+1 / -1 ) Share on Facebook
  • @ar2rsawseen I tried on android device too (LG optimus 2x with froyo) and got the same error. Can you try the code with your device and see the result please? :D
  • ar2rsawseenar2rsawseen Maintainer
    edited November 2012
    @marbolec well I just exported your app and launched it on my LG P500 and it ran pretty well. There was one error while playing more with it, but it was the Lua error and I think it's not android related:
    11-27 12:23:12.779: D/Gideros(23108): *visit(TimerEvent* v)* stack NOT ok begin:0 end:5 delta:0
    11-27 12:23:12.779: D/Gideros(23108): *CppLuaBridge::luaEvent* stack NOT ok begin:0 end:5 delta:0
    11-27 12:23:12.779: D/Gideros(23108): *enterFrame* stack NOT ok begin:0 end:5 delta:0
    11-27 12:23:12.779: D/Gideros(23108): ?:0: attempt to compare number with nil
    11-27 12:23:12.779: D/Gideros(23108): stack traceback:
    11-27 12:23:12.779: D/Gideros(23108): 	[string "compatibility.lua"]:32: in function <[string "compatibility.lua"]:31>
    11-27 12:23:13.359: E/libEGL(23108): call to OpenGL ES API with no current context (logged once per thread)
    But other than that it runs ok and no android errors or images that does not appear.

    One suggestion though, you should use wav files for sounds and not mp3, because in this case mp3 will consume more cpu usage and will not be as effective as wav could be. Mp3 maybe used for long continues sounds as background music ;)

    And I also did not see the need for box2d. Maybe I missed something?

    Do you want me to post a video on how your app runs on my phone?

    Likes: marbolec

    +1 -1 (+1 / -0 ) Share on Facebook
  • Hmm this is weird.. I will try on more devices to make sure.
    Thanks alot for your advice @ar2rsawseen :) you are the best.

    Dislikes: simran

    +1 -1 (+0 / -1 ) Share on Facebook
  • Can you push your project on Github so that everyone can watch all activities on your project ? People can suggest niche improvements using push requests.
Sign In or Register to comment.