Question how to rotate an actor on an offset?

The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
edited January 2012 in Working with GS (Mac)
Okay so since we don't have joints, is there a way to rotate an actor on the offset and not the standard middle position?

Comments

  • POMPOM Member Posts: 2,599
    Take a look at this:
    http://gshelper.com/?p=251

    Roy.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    No quite what I meant. A better example would be a hinge type movement so two ends touch and one rotates off that point while staying connected.
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    @ FryingBaconStudios

    "A better example would be a hinge type movement so two ends touch and one rotates off that point while staying connected."

    That is essentially what the above demo is doing - it's just doesn't look like that - the little windows are rotating off their own centre, that is all we are after here (I think!?).

    Try this: (drag the blue bar to move the whole thing)

    http://www.mediafire.com/?ngkjnsbxj5kp8ry

    I think the secret to thinking about all this is that you don't want to rotate an object around a pivot point - you want to move it around a pivot point - ie: the earth is not locked - in any sense - to the sun as it orbits, it is not rotating around the sun it is moving in a circular path around the sun.

    Hope that makes sense !
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Thanx will have to do some experiments with the info.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited January 2012
    FryingBaconStudios -- I stuck a little demo in Gamesalad Creator that might be what you are looking for. It is based upon the "free-yourselves" thread. Do a search for "off-center rotation".

    RThurman
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I'll try to get it but I'm one of those people with the template bug :(
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited January 2012
    Oh...OK

    Here is a link to the demo:
    http://speedy.sh/2djqT/OffCenterRotationExampleForForum.zip

    You can change the location of the actor's pivot point by changing the "offsetX" and "offsetY" attributes. They are offset from the center of the actor. Kind of like local actor coordinates -- with 0,0 at the center of the actor.

    You can also change the screen location (of the pivot point) by changing the "sceneX" and "sceneY" attributes.

    These are the only attributes you need to change -- all else can be left as is, and it will work pretty much anywhere, anytime.

    Hope this helps.
    RThurman
Sign In or Register to comment.