Nexios

Members
  • Content Count

    4
  • Joined

  • Last visited

About Nexios

  • Rank
    Newbie

Contact Methods

  • Twitter
    @CowLord420
  1. Nexios

    Remove child

    Thank you so much will keep you updated if i make it
  2. Nexios

    Remove child

    ok i have done something else now: var orbit = new Sprite(loader.resources.RedB.texture); stage.addChild(orbit); orbit.anchor.set(0.5,0.5); var orbitLocation = orbit.origin; orbit.pivot.set(Gball.width*25,Gball.height*25); orbit.position.set(widthHalf, heightBotb); console.log(heightBotOrbit); console.log(heightBotb); orbit.scale.set(0.02, 0.02); animate(); function animate() { requestAnimationFrame(animate); // just for fun, let's rotate mr Honeypot a little orbit.rotation -= 0.01; console.log(orbitLocation); // render the container renderer.render(stage); } and now i am trying to figure out how to get the sprites position while it is rotating around the pivot.
  3. Nexios

    Remove child

    So i am trying to orbit a small sphere around a bigger sphere like so: var orbit = new Sprite(loader.resources.RedB.texture); stage.addChild(orbit); orbit.anchor.set(0.1, 0.1); orbit.position.x= Gball.x*1.3; orbit.position.y = Gball.y/3; orbit.scale.set(0.15, 0.15); Gball.addChild(orbit); animate(); function animate() { requestAnimationFrame(animate); // just for fun, let's rotate mr Honeypot a little Gball.rotation -= 0.05; // render the container renderer.render(stage); } now the only problem is that when i click on the button to remove the child, but want him to keep the position he had in the animation: var ballX = orbit.x; var ballY = orbit.y; document.getElementById("bot").addEventListener("click", function () { var orbit = new Sprite(loader.resources.RedB.texture); stage.addChild(orbit); orbit.anchor.set(0.1, 0.1); orbit.position.x= ballX; orbit.position.y = ballY; orbit.scale.set(0.15, 0.15); Gball.removeChild(orbit); return false; }); does anyone know how i might be able to do that?