You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • I have just done an experiment with my stopwatch touch app.

    I have changed my on(touch) handler to clip the xy.x and xy.y values to within the values of 0->g.getWidth() and 0->g.getHeight().

    Bangle.on('touch', function(button, xy) {
      var x = xy.x;
      var y = xy.y;
    
      // adjust for outside the dimension of the screen
      if (y > h) { print("y adjusted to h"); y = h; }
      if (y < 0) { print("y adjusted to 0"); y = 0; }
      if (x > w) { print("x adjusted to w"); x = w; }
      if (x < 0) { print("x adjusted to 0"); x = 0; }
    
       etc
    

    Remember when we create buttons we are going to do it on the basis of how wide / high the screen is. So this is on the basis of what is returned from g.getWidth() g.getHeight().

    I now find my play button is a lot more responsive near the right edge of the screen.

About

Avatar for HughB @HughB started