You are not logged in.
Pages: 1
:(This script will not work....
what i need is to be able to click on my air balloon...
and drag it any where i want to drag it.
Need help
Thanks
From Edy
edy@gwi.net
/*
** Usage:
** move_to_mouse()
**
** Arguments:
** none
**
** Returns:
** nothing, but moves the calling instance
** to the position of the mouse
**
** GMLscripts.com
*/
{
x = mouse_x;
y = mouse_y;
Offline
Here's a simple drag-able object:
// CREATE
drag = false;
dx = 0;
dy = 0;
// STEP
if (drag) {
x = mouse_x + dx;
y = mouse_y + dy;
}
// MOUSE LEFT PRESSED
drag = true;
dx = x - mouse_x;
dy = y - mouse_y;
// GLOBAL MOUSE LEFT RELEASED
drag = false;
Abusing forum power since 1986.
Offline
i do understand that the four sections of that code go into the
Create, Step, Mouse Left Pressed, and Global Mouse Left Released
events
the whole script will not work
Code:
// CREATE
drag = false;
dx = 0;
dy = 0;
Code:
// STEP
if (drag) {
x = mouse_x + dx;
y = mouse_y + dy;
}
Code:
// MOUSE LEFT PRESSED
drag = true;
dx = x - mouse_x;
dy = y - mouse_y;
Code:
// GLOBAL MOUSE LEFT RELEASED
drag = false;
Offline
Abusing forum power since 1986.
Offline
i must of put something under the code script
xot
thanks for your help i will be making puzzles,
from the photos i take, in my state Maine.
when i get done, i will send you the puzzles.
don't no if you ever been to Maine or not,
but you will see some great photos by putting
the puzzle together.
thanks again have yourself a Sun Shinny day
From Darcy / Edy
Offline
Pages: 1