Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: rectangle ordering Date: Tue, 16 Jun 1998 22:20:43 +0100 Organization: Sony Computer Entertainment Europe Lines: 21 Message-ID: <3586E1AB.4093235@scee.sony.co.uk> References: <3586AEC1.2E8A@livemedia.co.uk> NNTP-Posting-Host: camfw01.millennium.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) Charlie wrote: > > I'm drawing several rectangles, and I guess I'm expecting them to appear > on top of each other depending on the order I draw them, with the one I > draw first being at the back, and so on. I'm putting them all at the > front of the OT (ie =0). > But ... the one I draw first is at the front, and subsequent ones behind > it.. is this normal ? ... am I doing something wrong ? ... Can I get it > to do it the other way around ? When you insert a sprite into the OT at a certain priority, that sprite is joined to the HEAD of the linked list that makes up the OT. Therefore what gets drawn first is what is at the start of the list. If you want it the other way around, then insert your rects backwards. If you can't do this, then insert the 'nearer' rects at lower priorities, and the 'further' rects at higher priorities. There's a related post from me somewhere which explains priorities in some detail. Cheers, James