I'm making an OS with an app store and recycle bin, and I need a script to have the apps be able to be dragged in a grid. Is that possible?
Offline
Yeah.
when [icon] clicked set [offsetx v] to ((mouse x) - (x position)) set [offsety v] to ((mouse y) - (y position)) repeat until <not <mouse down?>> go to x: ((mouse x) + (offsetx)) y: ((mouse y) + (offsety)) end go to x: ((round ((x position) / (grid cell width))) * (grid cell width)) y: ((round ((y position) / (grid cell height))) * (grid cell height))That should work.
Last edited by BirdByte (2012-09-04 12:23:34)
Offline
BirdByte wrote:
Yeah.
when [icon] clicked set [offsetx v] to ((mouse x) - (x position)) set [offsety v] to ((mouse y) - (y position)) repeat until <not <mouse down?>> go to x: ((mouse x) + (offsetx)) y: ((mouse y) + (offsety)) end go to x: ((round ((x position) / (grid cell width)) * (grid cell width)) y: ((round ((y position) / (grid cell height)) * (grid cell height))That should work.![]()
Hmmm... can you fix the go to x: block? It doesn't seem to work...
Offline
Yes, that's possible.
Assuming you're using a 40pixel per box type of grid:
when gf clicked forever go to [mouse-pointer v] go to x: ((round ((x position) / (40))) * (40)) y: ((round ((y position) / (40))) * (40)) end
Last edited by fg123 (2012-09-04 12:28:53)
Offline
fg123 wrote:
Yes, that's possible.
Assuming you're using a 20pixel per box type of grid:when gf clicked forever go to [mouse-pointer v] go to x: (round((x position) / (20)) * (20) y: (round((y position) / (20)) * (20) end
I want it dragged, not going to the mouse.
And so many errors that I was going to fix. Darn 180 second rule.
And it was at BirdByte.
Offline
fg123 wrote:
Oh right, I didn't see BirdByte's post. Yea, his version will work. Just on a different principle. Mine is the super basic version, but yea.
Yea, I made a quick, fail test on that. It failed but worked.
Offline
[offtopic]
@ firedrake: we must all have some sympathy for BirdByte about the new scratcher status.
[/offtopic]
Just done a test and fg123's script works.
Last edited by JH1010 (2012-09-04 14:55:39)
Offline
JH1010 wrote:
[offtopic]
@ firedrake: we must all have some sympathy for BirdByte about the new scratcher status.
[/offtopic]
Just done a test and fg123's script works.
I don't want it going to the mouse in a grid. And BB isn't a New Scratcher anymore.
Offline
Firedrake969 wrote:
JH1010 wrote:
[offtopic]
@ firedrake: we must all have some sympathy for BirdByte about the new scratcher status.
[/offtopic]
Just done a test and fg123's script works.I don't want it going to the mouse in a grid. And BB isn't a New Scratcher anymore.
What do you want then?
Offline
zammer990 wrote:
Firedrake969 wrote:
JH1010 wrote:
[offtopic]
@ firedrake: we must all have some sympathy for BirdByte about the new scratcher status.
[/offtopic]
Just done a test and fg123's script works.I don't want it going to the mouse in a grid. And BB isn't a New Scratcher anymore.
What do you want then?
Nothing now. I know what I need.
Offline