Trying to combine Joe's constrain to circle demo with tshirtbooth's touch offset

Grubby_NerdblenderGrubby_Nerdblender Member Posts: 22
edited November -1 in Working with GS (Mac)
Hi guys,

I think the title says it pretty well but I'm using Firemaple Game's constrain to circle demo:

http://gamesalad.com/game/2907?GSCVersion=0.9.80

And it's great for what I need except that I want it to work with a touch offset, similar to the way tshirtbooth does it here:

http://gshelper.com/?p=183

I've tried combining the two as best I can, but I'm stuck on how to factor the touch offset in to the circle constraint equations. If anyone can provide an equation then they'll be my hero for life. Or if anyone can point me to a template I'll happily pay for it if necessary. Cheers.

Comments

  • Grubby_NerdblenderGrubby_Nerdblender Member Posts: 22
    Bump - I could really do with a maths ninja if anyone is able to take a look at this. I'm sure it's do-able but I can't quite get my head around the maths.

    To put it basically I'm looking to use the constrain to circle demo, but with an offset for where the screen is touched. At the moment once you drag your finger outside the circle the dot stays constrained within the circle, but then when moving back toward the circle the dot doesn't start moving with you until you get back inside the circle. I want the dot to move with my finger regardless of whether my finger is within the circle or not.

    I hope that makes sense, I didn't intend to write that much!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Did you make 2 threads on this? Tshirt booth answered and gave you the exact expression. Maybe its in another thread.
  • Grubby_NerdblenderGrubby_Nerdblender Member Posts: 22
    JohnPapiomitis said:
    Did you make 2 threads on this? Tshirt booth answered and gave you the exact expression. Maybe its in another thread.

    No I certainly didn't I posted this yesterday and then waited 24 hours to bump it. If somebody else asked this exact same question it's a huge coincidence, but I certainly haven't received any equations from tshirtbooth.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    ahhh okay sorry to call you out tshirt. Thought i was seeing things for a second hehe
  • Grubby_NerdblenderGrubby_Nerdblender Member Posts: 22
    Oh I didn't see your post tshirtbooth, I'm in the UK so I guess I was i bed when you posted it. Thanks for trying for 20 mins, I really appreciate that. Plus I feel better because if it's even getting you confused then I know I'm not missing something obvious :-) Cheers!
  • Rob2Rob2 Member Posts: 2,402
    I managed to combine the two - I expect it was just a missed bracket somewhere - anyway here is project for you

    http://bit.ly/qVa3BD
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Rob2 said:
    I managed to combine the two - I expect it was just a missed bracket somewhere - anyway here is project for you

    http://bit.ly/qVa3BD

    Just downloaded it and tried it myself. I decided to go into the blue dot actor and change the "when touch is pressed" rule to "when mouse button is down". That will make it so that you can click anywhere on the screen and the blue dot will constrain to your finger with the offset but will not leave the circle.

    Anyways, nice work Rob. Just thought I would mention my modification in case it is helpful to anyone.

    cheers
  • Grubby_NerdblenderGrubby_Nerdblender Member Posts: 22
    Rob2 that's superb! Thanks a lot. It is very similar to mine I was just not quite getting the brackets right. I feel like I should repay you, you've save the day when I'd almost given up on it.

    @scitunes thats's what I did so that I can test it on the mac, and it works like a charm.
Sign In or Register to comment.