Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Live update in Gideros? — Gideros Forum

Live update in Gideros?

gianmichelegianmichele Member
edited March 2013 in General questions
Hi,

I was looking at Loom Scripting, and while I really don't like the language too much, and hate the cocos 2d api (it's really complete but almost unreadable in both its lua and js version), I have to admit that their live coding and asset update features are really interesting.

http://www.youtube.com/watch?feature=player_embedded&v=iXPaYv_WcU8

Since under the hood I understand that this is LUA, I wonder if we're ever going to get something similar in Gideros.

Any idea?


Comments

  • @gianmichele, most of the dynamic code updating in that demo seems equivalent to the Live Coding demo that I did with Gideros and ZeroBrane Studio (ZBS). You can see the video and a description here:

    http://www.bowerhaus.eu/blog/files/live_coding.html

    The dynamic updating of resources wouldn't be too tricky to arrange and would look quite groovy. If I was going to do it, I would use the Dropbox API and write a Gideros module to check whether any texture files had been changed in a Dropbox folder shared with the desktop. If they had, I would force a reload and dynamically install the new textures into any live bitmaps using Bitmap:setTexture().

    best regards

    PS: if one was only interested in supporting dynamic asset updating in iOS then the Dropbox API interface could probably all be done in Lua using BhWax.

    Likes: deniz

    +1 -1 (+1 / -0 )Share on Facebook
  • Hi Andy,

    I was trying to follow your demo here:

    But I hit a small roadblock. In the video you mention that you use a Gideros Helper library to simplify creating box2d bodies and associating them with graphics but you leave no clue where others can find the library. I have the latest Gideros and I cannot use the same function calls you use in the demo. What am I missing?
  • @Cliff76, you need GiderosCodingEasy by @ar2rsawseen. You can find it here:

    https://github.com/ar2rsawseen/GiderosCodingEasy

    Also, this rather long thread discusses how the GCE library came to be:

    http://www.giderosmobile.com/forum/discussion/1780/extending-gideros/p1

    BTW, I only came across this post by accident. If you put the tags of author's you are trying to communicate with in the post (like @bowerandy) then we'll receive an e-mail saying that a post has been made.

    best regards

    Likes: deniz

    +1 -1 (+1 / -0 )Share on Facebook
  • @bowerandy Thanx a bunch! I think your IDE is awesome, and I'm just getting toe-deep! I finally did manage to find the wrapper library by Googling for your Github repo, reading through the source and noting the references in the project file. I have lots of other questions, though. I tried following your video tutorial and got "attempt to index a global b2..." errors when I modified the built in live code example to use physics from box2d. Not knowing better I attempted to add:
    require "box2d"
    at the top of the file then I later tried coding
    require("box2d")
    next to the require("mob debug") in the not initialized section. Neither approach worked. Below is my modified LiveCodeSimple:init() method:
    function LiveCodeSimple:init(x, y)
      --self.world = b2.World.new(0, 9.81, true)
      application:setBackgroundColor(rgb(108, 225, 255))
      local image=Bitmap.new(Texture.new("zbstudio.png"))
      image:setScale(1.0)
      image:setAnchorPoint(0.5, 0.5)
      image:setPosition(x, y)
      image:setRotation(45)
      self.image=image
      --self.world:createCircle(image, {type="dynamic"})
     
      self:addChild(image)
      stage:addChild(self)
    end
    Finally, Where should I best address issues like the above? I certainly don't want to prolong/abuse this thread. Is there a user forum specific for ZeroBrane? Are there any plans to merge ZeroBrane with Gideros? They smell like they go good together! Thanks for your help!
  • @Cliff76, just to make you aware, ZeroBrane is not my stuff (I just did the demo). It's actually created by a chap called Paul Kulchenko (@paulclinger).

    I think your physics errors are caused by the fact that GiderosCodingEasy used to include the physics stuff when I made the demo. Since then @ar2rsawseen has removed it to a separate file that is in the same repo as GCE. Try including this file just after you require "GiderosCodingEasy.lua".

    I think any questions to do with ZBS or Live Coding can be probably be posted to this forum providing they are concerning Gideros and not one of the other Lua dev environments that ZBS supports.

    best regards
  • @Cliff76, you may want to check a simple live coding example I posted using Gideros and ZBS: http://notebook.kulchenko.com/zerobrane/gideros-live-coding-a-simple-example. You should be able to get it working in no time and then you can transition to the more complex (and more interesting) example that @bowerandy has. Thanks Andy for the shout-out.
Sign In or Register to comment.