learn java
The moose likes Beginning Java and the fly likes Need Simple formula tweaked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need Simple formula tweaked" Watch "Need Simple formula tweaked" New topic

Need Simple formula tweaked

richard gallagher

Joined: Mar 15, 2008
Posts: 9

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.


I agree. Here's the link: http://aspose.com/file-tools
subject: Need Simple formula tweaked