2d - Love2D Lua framework - Converting an unorganised rendering table into a map structure -


I am changing a 2D render map which is unrelated in the string table, for example:

"render = {{image, 50,60,2}}"> Where is the image (I am using the Love 2D Lead Framework) 50 x Axis 60 is Y axis 2 image ID (it In the actual table.)

But 100 of them are all unorganized and stuff, and I need to incorporate them into a structured map.

Here's a bit strange: when I put it in an organized string .. this .. the key is a 90 * angle rotates the table on anticlockwise.

is saying that I want the result of

  {{7,6,5}, {6,5,4},}   

I'll get:

  {{5,4}, {6,5}, {7,6},}   

obviously There is no error because it works technically, just rotates in the wrong way. Here is the relevant code:

  Function OrganizeRenderIntoMap () MapString = "" Map2 = {MaxSoFarX = 0 MaxSoFarY = 0 to add to _, v if v [2] & Gt; MaxSoFerX then MaxSOFERX = V [2] otherwise V [3] & gt; MaxSoFarY then has the end end for MaxSoFarY = V [3] currx = 0, MaxSoFarX, 32 Map2 [currx] = {} MapString = MapString .. "{" For Curry = 0, MaxSoFarY, 32. MapString = MapString..GetRenderPos (Curves, Curie) .. "," map2 [curcs] [curry] = gatepressor (cancer, curry) and mapstrings = mapstrings .. "}, \ N" End Return MAPERESTING AND Function (Renderer) in pairs for GetRenderPos (Locale, Loxie) _, v if V [2] == Lock and V [3] == Loki Returns [4] ] End And End And End [4] End And End    

Take a look at me in Section Talk about how to handle "Switched X and Y" problem.

Comments