Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Pause Physics — Gideros Forum

Pause Physics

amaximovamaximov Member
edited March 2013 in General questions
Making the mvoe from Corona to Gideros and I am absolutely loving it!!! One question though, how can I pause the box2d physics engine? I couldn't find a "pause" or "start" api call in the docs. IF there is none, is the proper way to "pause" the world in gideros by setting all bodies to "sleep" or "inactive"?
Tagged:

Comments

  • just remove the enterframe event and box2d will get pause automatically

    i am assuming you are using somewhat like world:step(1/60,8,3)

    in the case you are using world:step(dt,8,3) where dt is counted depending upon interval you need to chk after resuming enterframe so dt has not much higher value

    :)
  • at the other hand as long as you dont call world:step(1/60,8,3) box2d will behave like it is paused so you can also use any kind of flags for this.

    :)
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Yes exactly as @hgvyas123 simply create some sort of variable as paused and check
    if not paused then
        world:step(1/60,8,3)
    end
  • Ah, thanks for all the explanations guys. I was expecting a simple pause/play function but I can see how using step gives you much more control. Thanks again!
Sign In or Register to comment.