✖ Image sequence control question !☂? ✖

CloudsClouds Member Posts: 1,599
edited February 2012 in Working with GS (Mac)
Hi fellow Salad tossers 8-X

I have a bunch of images that I need to step through based on where the 'touch' is on the screen . . .

So, for example, if you touch at X = 100 then the actor shows frame 100 . . . . so far so good, got that bit working.

Then when you drag your finger (for example) left to right across the screen the frame that is being displayed changes based on the X position . . . got that bit working too.

So now I can drag my finger to the left and to the right and get the image sequence to play backwards and forwards.

But when I take my finger off the screen and touch somewhere else I want the image sequence to then only add the new swipe amount onto the frame counts.

Damn, that sounds very confusing the way I have explained it . . . basically I want to swipe left to right and right to left and as I I do I want the image sequence to change based on how much I have swiped (not sure that sounds any clearer !)

Anyhow if anyone understood that and has got any advice that would be really cool !!


Cheers in advance.


Tynan.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Im pretty tired and not really get what your asking :( Ill read threw it a couple more times though and see if i can help.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @JohnPapiomitis

    Cheers John, yes I've not explained it very well, might be easier to upload an example of what I am trying to achieve . . .
  • CloudsClouds Member Posts: 1,599
    Imagine it like this . . .

    You have a 3D box or a globe or something similar . . . .

    I want to be able to click on the object and rotate it clockwise when I drag right and counter clockwise when I drag left . . . . that part is easy enough.

    But - for instance - once I have dragged my mouse/finger all the way to the left, I want to be able to lift my finger up go back the the centre of the screen (or wherever) and then once again click/touch on the object and rotate it some more with it's rotation picking up where I left off.

    So far I have managed most of what I need, but I can't seem to find an obvious way of doing the last part, at the moment.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    ...
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Ahh i see what you mean now. I would think you would need to add some kind of offset between the new rotation and the mouse position
  • CloudsClouds Member Posts: 1,599
    @Johnpapiomitis

    Cheers John, I suspect you are right and it needs to have an offset of somekind, I did try doing that initially but couldn't get it to work at all . . . . might need to give the offset idea another go . . . . . ?
  • MotherHooseMotherHoose Member Posts: 2,456
    edited February 2012
    @Tynan …weird and beautiful!!!

    1. I managed to get control with a gameAttribute Index type to store the last image name
    … (also works with text-type … but think that text-type allocates more bits/bytes to game RAM
    … …plus to get correctImage … you have to use floor(self.Image) when you change it)
    2. then added before the Constrains in the mouseDown rule … changeAttribute: self.Image To: game.lastImage
    … eventually enclosed the Constrains in a Timer: After: 0.02 seconds … I got good at swinging box around!

    3. then added to that actor1 …
    Rule: when
    Event: mouse is up
    --changeAttribute: game.lastImage To: self.image

    @};- MH

    PS the weird is that when you have a textActor to show self.Image … the names have decimal places added to the images project names/#
  • CloudsClouds Member Posts: 1,599
    @MotherHoose

    Cheers for the input, I will try out your method when I get the chance tonight !!!
  • CloudsClouds Member Posts: 1,599
    @MotherHoose & JohnPapiomitis

    Cheers for the input, it's now working (used the offset idea).

    :-bd
Sign In or Register to comment.