How do I get the Z width of a specific xy Array position?

0 favourites
  • 3 posts
From the Asset Store
Vector illustration of a UFO with an alien in three different positions.
  • Hello,

    i have a 3 dimensional array like this:

    {
    "c2array":true,
    "size":[3,3,3],
    "data":[
    	[
    		["Students"],
    		["Simon"],
    		["Sarah"]
    	],[
    		["Proben"],
    		["Brüche zu Dezimalbrüchen 1","Mathe","Dezimalbrüche"],
    		["Geometrische Flächen","Mathe","Geometrie"]
    	],[
    		["Themen"],
    		["Dezimalbrüche","Mathe"],
    		["Geometrie","Mathe"]
    	]
    ]
    }
    [/code:2lualsp3]
    
    How can i get the "depth" of i.e. "Geometrische Flächen"
    or
    how can i get the "height" of i.e. "Students" ?
    
    Is there a possibility to do sth. like this: myArray.At(0).lengthor myArray.At(1,1).length.
    
    Thank you
  • The z depth of any given x/y will always be the same as the total depth of the array, even if there is no data in the cells. An empty cell will contain 0 though, so you can make a function loop to check how many cells in that particular row/column are not equal to zero and return the result.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • May i suggest the 3D Dictionary plugin by Kevin Khantzis ? It is heaven to work with.

    forum/plugin-storage-3d-dictionary_t125861

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)