Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!lll-winken!arisia!sgi!shinobu!odin!sgi.com!mtoy From: mtoy@sgi.com (Michael Toy) Newsgroups: comp.sys.mac.programmer Subject: Re: Marquee Help? Message-ID: <2495@odin.SGI.COM> Date: 5 Jan 90 19:20:27 GMT References: <18304@dartvax.Dartmouth.EDU> Sender: news@odin.SGI.COM Reply-To: mtoy@sgi.com (Michael Toy) Organization: Silicon Graphics, Entry Systems Division Lines: 27 One way to get something marquee like, would be to use a set of patterns of diagonal stripes the following example will draw a cheap marquee rectangle, looping forever: char p0[] = { 0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11 }; char p1[] = { 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11, 0x88 }; char p2[] = { 0x22, 0x11, 0x88, 0x44, 0x22, 0x11, 0x88, 0x11 }; char p3[] = { 0x11, 0x88, 0x44, 0x22, 0x11, 0x88, 0x11, 0x22 }; marqueeRect(Rect *pRect) { int patNum = 0; char *patterns[4]; patterns[0] = p0; patterns[1] = p2; patterns[2] = p2; patterns[3] = p3; PenMode(patXor); /* I'm not sure this is either the correct function or parameter name */ for (;;) { long t = TickCount(); PenPat(patterns[patNum++]); patNum &= 3; FrameRect(pRect); /* Draw a rectangle */ while (TickCount() - t < 4) /* Wait a bit */ ; FrameRect(pRect); /* Undraw the rectangle */ } PenNormal(); }