Colin Holgate wrote:
> 
> >I need to make a grid of squares 50 x 50 and all need to be referenceable as
> >when each one is clicked on it needs to change colour. It needs to be in
> >some kind of array as i need to check the state of the squares surrounding
> >each square that is selected. Is there a way to produce this grid without
> >having to draw out 2500 squares?
> >Any ideas?
> 
> There are so many ways to do this, but if you literally mean that
> it's a 50 x 50 area of solid colors that need to change, an easy and
> fun way would be to use setpixel on a 50x50 pixel bitmap. You then
> place the bitmap onto the stage and scale it up somewhat.
> 
> Here, I went ahead and made a movie:
> 
> http://staging.funnygarbage.com/colin/colorgrid.dir
> 
> The one and only sprite is 400 x 400, with source bitmap of 50 x 50.
> The script on the sprite is this:
> 
> on mouseUp
>    s = the currentspritenum
>    m = the member of sprite s
>    x = (the loch of the clickloc - the left of sprite s)/8
>    y = (the locv of the clickloc - the top of sprite s)/8
>    setpixel member(m),x,y,random(256)-1
> end
> 
> The movie is a D7 one.

and you can use 
member(m).getpixel(x,y)
to get the data back out of the bitmap


-- 
Carl West    [EMAIL PROTECTED]
617.262.8830 x246    

I have no superfluous leisure; my stay must be
stolen out of other affairs; but I will attend you awhile.

           - Isabella, Measure for Measure, Act 3 Scene 1

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to