Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Simple formula tweaked

 
richard gallagher
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

This is a simple formula to move images on a screen left or right.
- The mouse is clicked on screen.
- Clicking on left half of screen gives negative value.
- Clicking on right half of screen gives positive value.



-The value newOffset is called in the renderer to create the shift in display.



Problem - If the user is as far left as can go (determined by "offsetX = Math.round(Main.newOffsetX);", the newOffset value is still modified. Likewise, clicking when the screen is as far right as it can go still modifies the newOffset value. I would appreciate help to stop this happening.

This is just the start of what im trying to do, and am aware of future issues, like different screen sizes.

Thankyou,

rg.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic