Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ncar!midway!arthur!francis From: francis@arthur.uchicago.edu (Francis Stracke) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW MacApp view question Message-ID: <1990Sep26.222213.17059@midway.uchicago.edu> Date: 26 Sep 90 22:22:13 GMT References: <90266.145525TAB113@psuvm.psu.edu> Sender: news@midway.uchicago.edu (News Administrator) Organization: Mathematics Department, University of Chicago Lines: 20 In article <90266.145525TAB113@psuvm.psu.edu> writes: > I'm writing a game in which the game board is comprised to hexogonal tiles. >Each tile will be an object, TTIle, which is a subclass of TPicture. My >problem is in putting these tiles together. Because the tiles are 6 sided, >flat sides on bottom and top, there are 4 triangles of white "dead space". >Thus, when one tile is layed down and to the right of the first tile, the >second tile's "dead space" covers the first tile! > > Does anyone have any ideas on how to place these irregular shaped PICT's >down without them interfering with each other. Thanks. Two ways: (1) Don't use the PICTs directly; copy them to an offscreen bitmap when you initialize, then copyMask from there to the screen, to clip drawing to the hexagonal region. This is fast, but memory-intensive if you have many different tiles. (2) Set the clipRgn of the window to be just the hexagon of the tile you want to draw. You can define a hexagonal region at initialization, then use OffsetRgn to put it where you want it.