I'm working on a project where people can snap certain objects to a grid, and the grid point is indicated by a stamped dot (square sprite with a dot drawn on it). At the beginning, the user chooses their canvas size (height and width) so they could have 20 dots by 50 dots.
What I want to do is that if the user chooses a 4X4 square, the dot sprite will stamp 16 very large dots on the screen, making it as big as possible on the screen so it can easily be seen. However, if the user were to choose a 100X100 grid, the sprite would draw smaller dots and scale it again so that the dots spread as far a possible across the stage...
The calculation for this stumps me. Any discussion and help would be good
let us assume the dot stamping sprite is normally 10X10 pixils in size.
Last edited by sparks (2010-07-24 07:26:14)
Offline
Here is a snap to grid script:
Not sure what you mean by the other part though.
Change all the 20s to what you want.
Offline
Ok, this is what I came up with.
http://scratch.mit.edu/projects/JSOlabs/1210204
I it's not what you're looking for, then I probably just misunderstood your problem xD Just tell me
Offline
Look at my game on advance wars. It has a sensing script and may come in handy...
Link:
http://scratch.mit.edu/projects/johnnydean1/1092100
Last edited by johnnydean1 (2010-07-24 08:16:00)
Offline
That is almost exatly what I need, the one problem is that as it's supposed to be simulating a stripboard, the gap between each hole needs to be the same distance from it's neighbors as the others, wheras in the case of your project, if you do something like 10X2, the gaps between the rows and the gap between the columns are different...
Last edited by sparks (2010-07-24 08:23:54)
Offline
Oh, so it should not always fill the whole screen? It's an easy fix actually.
http://scratch.mit.edu/projects/JSOlabs/1210255
Is this better?
Offline