## Isometric z-soring by coordinates, not x/y

Greetings, I have an isometric game and wish to do a zsoring based on i,j and sizeI and sizeJ of the "buildings". There is no Z axis in the game.

If there is anyone that is using this, you could copy paste your sort() function and I will adapt it.

So far this gives me limited success:

private function sortingFunction( a:IRenderable, b:IRenderable ):int
{
if( a.top > b.bottom && a.left > b.right ){trace( "> , >" ); return 1; }
if( a.top > b.bottom && a.left < b.right ){trace( "> , <" ); return -1; }
if( a.top > b.bottom && a.left == b.right ){trace( "> , =" ); return 1; }

if( a.top < b.bottom && a.left > b.right ){trace( "< , >" ); return 1; }
if( a.top < b.bottom && a.left < b.right ){trace( "< , <" ); return -1; }
if( a.top < b.bottom && a.left == b.right ){trace( "< , =" ); return -1; }

if( a.top == b.bottom && a.left > b.right ){trace( "= , >" ); return 1; }
if( a.top == b.bottom && a.left < b.right ){trace( "= , <" ); return -1; }

return 0;
}

I think you can understand all of this code.

Thanx!
{"ft_lang_label":"__label__en","ft_lang_prob":0.51444167,"math_prob":0.9259621,"size":1255,"snap":"2020-10-2020-16","text_gpt3_token_len":376,"char_repetition_ratio":0.16866507,"word_repetition_ratio":0.27710843,"special_character_ratio":0.374502,"punctuation_ratio":0.24738675,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.965462,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-01T20:09:10Z\",\"WARC-Record-ID\":\"<urn:uuid:eeb69de7-d457-4e12-aa46-4401601ce882>\",\"Content-Length\":\"71427\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dbe6bd46-06de-4461-8b3d-5d77b936dace>\",\"WARC-Concurrent-To\":\"<urn:uuid:9dae2153-378e-4fb1-bf96-4751e01415a0>\",\"WARC-IP-Address\":\"70.42.23.51\",\"WARC-Target-URI\":\"http://board.flashkit.com/board/showthread.php?821119-Any-iPhone-games-made-with-Flash-since-the-dust-settled&goto=nextoldest\",\"WARC-Payload-Digest\":\"sha1:A7HJQLUTY3DKYFHXJQXZ3WWWZHSJHUBP\",\"WARC-Block-Digest\":\"sha1:TT6U5IUSJEV7WJYCFIVGROKNI3YI7MTL\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585370506121.24_warc_CC-MAIN-20200401192839-20200401222839-00271.warc.gz\"}"}