Author Topic: origin problem  (Read 1567 times)

kimo1995

  • Member
  • **
  • Posts: 5
  • Karma: +0/-0
    • View Profile
origin problem
« on: Wed, Mar 11, 2015 »
greetings
am trying to rotate a sprite around some point(not the center)
i read allot of topics about this and it didn't seem to help me
i tried using
Code: [Select]
sprite.origin = flxpoint;
it didn't do any good,also tried setorigintocorner(),also didn't work
it seems that no matter what number i put,its not changing anything
is there a bug or i don't understand how this works?
if so,how can i do this rotation?

kimo1995

  • Member
  • **
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: origin problem
« Reply #1 on: Thu, Mar 12, 2015 »
i used
Code: [Select]
sprite= new FlxSprite(0, 0, Sources.sprite);
and it worked,but i need to use
Code: [Select]
loadRotatedGraphic
:(

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: origin problem
« Reply #2 on: Fri, Mar 13, 2015 »
Well, I wasn't going to respond because I thought someone with more experience here would help.

Does something like this work?

yoursprite.origin.x = 5;

I'm assuming it doesn't, but perhaps you could use getAngle to find the angle between your sprite and the desired point - and then set the sprite's angle equal to that.