Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7749841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:08:18+00:00 2026-06-01T11:08:18+00:00

My problem is I Have an isometric grid, just based on the X,Y values:

  • 0

My problem is I Have an isometric grid, just based on the X,Y values:
Each time you click a button for instance road than this item is pushed to an array()

 //
 addChild(roadTiles);
 gameAssets.push(roadTiles);
 arrangeAssets();
 //

My arrangeAssets method just checks the array “no point posting as it fails most of the time.gennerally some items update but not all.
So im hoping some one has a solution to check X,Y value then setChildIndex of Array.
I have looked, keep getting reffered to 3rd party as3 engines which im not interested in as i want to make my own and have better understanding.

enter image description here

or is this not possible as im only using an X,Y grid

    arrangeAssets();{
var i:int = gameAssets.length;
while(i--){
    if (getChildIndex(sortedItems[i]) != i) {
        gameAssets.sortOn("y", Array.NUMERIC);
        setChildIndex(gameAssets[i], i);
    }
    }

I only add the items on top of the grass grid into the array.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:08:19+00:00Added an answer on June 1, 2026 at 11:08 am

    assuming that the left most point is x: 0, y:0 the tiles are covering each other going from a high x and low y to a low x and high y values.

    I would add a weight variable (call it what you like), and calculate it from (totalx - x) * y

    this would have the top-most corner have a value of 0, and the bottom most have the highest value. every row (diagonal really) would be the same.

    Then sort on the weight and you have a list of items in the relative z stack.

    this doesn’t really address the setchildIndex, because you can’t have two items there. a hack would be to remove all and add them back in the order. (you could have a temp child, that you add as children to, that way you don’t have to remove the children as it is done automatically)

    I found this image that shows the weight as _yfrom http://www.kirupa.com/developer/isometric/depth_sorting.htm

    enter image description here enter image description here

    the _y is the same because (totalx - x) * y values horizontally are the same

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen that a few instances of this problem have been raised already. However,
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem I have timestamped data, which I need to search based on the timestamp
I have this problem: have two entyties with one to one relationship, boot of
Am updating a 2D game I made to have an isometric view, problem is
I have a visual studio (2005) solution file with 70 projects. Each time I
Problem: I have N (~100k-1m) strings each D (e.g. 2000) characters long and with
Problem: I have a gtk.Dialog. Whenever the 'minimize' button on the dialog is clicked,
Problem: Have made a small mail program which works perfectly on my developer pc
Problem: I have an address field from an Access database which has been converted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.