TOUCH (PRECISION) PROBLEM???

onuferonufer Member Posts: 17
edited November -1 in Working with GS (Mac)
The idea is, that I want to slide long bar with touch. Only two directions, horizontaly, left or right.

http://imageshack.us/photo/my-images/233/exampleui.png/

When you use smaller objects, behavior for touch works great. You set it to: constrain, or change self.position (x,y) to touch or mouse possition (x,y) and it's done. But with bigger objects there is a problem... Because this behavior makes your actor to center where mouse or touch position is. I don't want my actor to "jump" suddenly and change it's possition. I want it to stay where it is, when press is made, and move only during slide with mouse or touch.

And... Because I want my actor to be bigger than the scene. I want it to wrap too ;-)

Is this possible in GS to do that? I looked for such thread but couldn't find discussion similar to my problem.

Summarising. The problem is: HOW TO make bigger actors to follow touch, but not to "jump" (center) to the press point. How to slide bigger actors without such effect?

Comments

  • LumpAppsLumpApps Member Posts: 2,881
    Have a look at the third paragraph on this page: http://gamesalad.com/wiki/how_tos:gsc_mouse_movement
    (Following the Mouse Position With an Offset)
  • onuferonufer Member Posts: 17
    Nope. That doesn't work for me. Or... I don't understand smthing ;-) When I am doing behavior of my actor according to this sheme, my strip actor "glues" to the mouse arrow. Even when I release mouse button, after first "click", it endlessly follows mouse position. And I want this "slideable colored strip" to stay in possition after player releases touch. Here is illustration how it looks now:



    When I was trying to do smthing about that and add condition to the last rule from your example (this: "following mouse possition with an offset") which with my innovation was:

    when Attribute: self.grabbed=true and touch is pressed and touch is inside
    THEN Constrain Attribute: self.Position.X = game.mouse.Position.X - self.OffsetX,

    Everything returned to the effect I gained before. Which means that my "strip actor" is "jumping" to the mouse position. As you can see below (watch the red square;-):



    And idea is to make draggable, slideable strip, moved by touch, but it should stay in position before touching finger (pressed mouse) is moving ;/
Sign In or Register to comment.