Re: Drawing a rectangular matrix of circles - an NSMatrix?
Re: Drawing a rectangular matrix of circles - an NSMatrix?
- Subject: Re: Drawing a rectangular matrix of circles - an NSMatrix?
- From: Dan Messing <email@hidden>
- Date: Thu, 01 Dec 2005 14:26:26 -0600
I would definitely implement this as a single view, and not multiple
sub-views. As far as I can tell, adding a bunch of sub-views would
only complicate things (especially when drawing the connecting lines)
and add unnecessary overhead. Perhaps I am missing the point though,
why do you feel that using multiple views or an NSMatrix would be
easier? (other than for simply aligning the circles, which shouldn't
be too much of a problem to implement in your custom view).
Dan Messing
Stunt Software
http://www.stuntsoftware.com/
On Dec 1, 2005, at 2:01 PM, email@hidden wrote:
Hi, all.
I am working on a puzzle game, sort of like minesweeper, and I am
trying to figure out how best to draw the display. Should I draw it
all in one NSView's drawRect, should I figure out an NSMatrix, or
should I use a whole passel of much simpler NSView subclasses for
each dot?
The puzzle consists of an n x n matrix of dots, each listing the
number of network links it has to its neighbors. Lines may not
cross, and may go only to the eight neighbors around it.
The problem and solution will be in different windows, but the draw
code will be quite similar.
See <http://homepage.mac.com/fuz/dots.png> for the look I am after.
Eventually, I want the user to be able to click on a dot and drag a
line to the next dot, so I can draw a line. This is not hard a
priori - I have done stuff like this with one big DotView before, but
I am wondering if this is really the best way to handle this
situation. As mentioned above, the draw code would be simpler with a
whole passel of simpler NSViews as subviews of the main view, and
there is always NSMatrix.
Suggestions?
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden