Jump to content

Search the Community

Showing results for tags 'box2d'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Personal Website



Company Website



Found 1 result

  1. Hello, It's my first time posting here, so apology if it's not done correctly. I have a problem. I have a game where I interpolate, via TweenLite, the position of a sprite. I interpolate the position of its box2D body to be precise. Even though the tweening in itself works fine, once I kill the tween, it puts back my object at its initial position and I can't figure out why. I am sure it's something stupid, like a param to pass, but can't find it in the doc. Maybe there are issues when tweening with box2D ? Thanks for your help. Code: var fromX = ((BALL_SIZE * BALL_SCALE) / SCALE) var toX = ((STAGE_WIDTH - (BALL_SIZE * BALL_SCALE)) / SCALE) g_tween = TweenLite.fromTo(g_ball.sprite.body.GetPosition(), 3.0, {x:fromX}, {x:toX, ease:Linear.easeNone, onComplete:onTweenComplete, onReverseComplete:onReverseComplete}); function onTweenComplete() { g_tween.reverse() } function onReverseComplete() { g_tween.play() } // *********** // Callback when user click on the screen // The game release the ball if it hasn't been released yet // *********** function onMouseDown(event) { //var newBall = new Ball() //g_sprites.push(newBall) var x = g_ball.sprite.body.GetPosition().x console.log("x: " + x) g_tween.kill() g_ball.sprite.body.GetPosition().x = x console.log("g_ball.sprite.body.GetPosition().x: " + g_ball.sprite.body.GetPosition().x) g_world.SetGravity(new box2d.b2Vec2(0, 30)) }