[Ohrrpgce] SVN: james/2512 New commands "set sort order" and "sort children" for easy custom sortin
James Paige
Bob at HamsterRepublic.com
Fri Jan 30 13:39:27 PST 2009
On Sat, Jan 31, 2009 at 07:15:50AM +1300, Ralph Versteegen wrote:
> > New commands "set sort order" and "sort children" for easy custom sorting
> > of sibling slices without need for fancy looping voodoo. Added examples
> > to the docs.
>
> Great! I was just ranting to IM how without an easy way to draw by Y
> and Z values instead of rearranging children, sprites wouldn't be any
> better than NPC's for my needs; I hadn't noticed these.
>
> Firstly, EGADS! "Y sort children" and "sort children" do NOT perform
> stable sorts as advertised in the wiki!
Oops! What did I do wrong? Sorting is not my speciality :P
> However, I think that wiping the sort value for sprites while sorting
> them is a bad idea. Whether it's wiped MUST be an optional argument to
> sortchildren. I really think it shouldn't by default. You'd only want
> to wipe the sort values if you're using sort children as a hack to get
> around the difficulty of using nextsibling.
Hmmm... I guess it could persist.
In that case we will also need a command to read the sort value.
I guess my reason for making sort order a temporary value is because I
wanted it to /only/ be used for sorting, and not used for manual depth
control... but I don't have a good argument for forcing that limitation,
so I am willing to change it.
> Also, what about options (similar to fill parent) which automatically
> sort children by Y or Z every time they are drawn? With a suitable
> stable sort algorithm, sorting an already sorted list would be quick.
Huh, that is kinda interesting. I can see how it could save some work.
---
James Paige
More information about the Ohrrpgce
mailing list