|
-
Objects _y value depending on mouse pos and stage height
Example 1
If the _y position of the mouse is 0, the stage height is 100 and the object height is 200, then the position of the object would be _y= 0;
Example 2
If the _y position of the mouse is 50, the stage height is 100 and the object height is 200, then the position of the object would be _y= 100;
Example 3
If the _y position of the mouse is 100, the stage height is 100 and the object height is 200, then the position of the object would be _y= -100;
The equation for the above is:
_y.object = (object_height%stage_width-_ymouse)-2;
The problem is the above equation dosen't work for different stage heights and object heights.
Anyone know of a universal equation?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|