|
-
Jan 4th, 2007, 03:54 AM
#1
Thread Starter
Hyperactive Member
-
Jan 4th, 2007, 06:58 AM
#2
Re: [Dx7] Z ordering (Am I going insane?)
You needed to have a proper order of drawing the sprites. The ones behind in the background should be first while the foreground is last.
-
Jan 4th, 2007, 09:06 AM
#3
Thread Starter
Hyperactive Member
Re: [Dx7] Z ordering (Am I going insane?)
Did you even look at my code? Look at my rendering function
-
Jan 4th, 2007, 04:52 PM
#4
Hyperactive Member
Re: [Dx7] Z ordering (Am I going insane?)
 Originally Posted by singularis
Did you even look at my code? Look at my rendering function
I have. DoOrdering isn't going to work the way you want it to work. Since you reset County (County as in a small regional area or Count of position due to its Y value?) each go around, there is a good chance that your z-order gets hosed for that first element. What kind of sort are you wanting/trying to use?
Also, you may be better of assigning an arbitrary z-order to each element in your "Things" array and then swap the values between objects depending on some arbitrary condition--such as .GetPosY + 70.
-
Jan 5th, 2007, 06:14 AM
#5
Thread Starter
Hyperactive Member
Re: [Dx7] Z ordering (Am I going insane?)
Since you reset County (County as in a small regional area or Count of position due to its Y value?) each go around, there is a good chance that your z-order gets hosed for that first element.
Could you expand on that please, I do not understand. Why the first element?
EDIT: I have just seen this -> http://www.vbforums.com/showthread.php?t=444394
Last edited by singularis; Jan 8th, 2007 at 02:37 AM.
-
Jan 9th, 2007, 09:17 AM
#6
Thread Starter
Hyperactive Member
Re: [Dx7] Z ordering (Am I going insane?)
It turns out my sorting alogaritm was fine, the only problem was in my drawing function not drawing all the objects correctly so I changed it from this:
Code:
for i = 0 to 10
draw object(object(i).z)
next i
to this:
Code:
for i = 0 to 10
for c = 0 to 10
if c = object(i).z then draw object(i)
next c
next i
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|