In short it works so that i have handcards in table, say:
Code: Select all
t_handcards = { "c1", "c2", "c5"}
in this example, original hand had been c1 to c5, but now c3 and c4 have been discarded, leaving empty space in their place, and then i enter this hand into my subroutine which goes roughly:
Code: Select all
n=0
foreach(t_handcards, function(index, value)
layertofront(value)
movelayer(value, #USELAYERPOSITION, #USELAYERPOSITION, x + (spacebetweencards * n), y)
n=n + 1
endfunction)
What I was expecting to happen, was that leftmost card would seemingly be beneath every other card, and right most card, would be the top card.
Since idea is that left most card is put into its place first, and moved to front, and right after the next card is moved to its place, and once again moved to front (making the previous card obviously not the front card anymore).
But now in practice i notice that while right most card correctly is always the top most card, the order of the rest of the cards is not as i expected, but it could be that from rest of the cards, for example middle one might be the one on top of every other card.
I thought layertofront works in such way, that say i have {a, b, c, d} layers in queue, and then i switch layer c to front, that now the table would look like {c, a, b, d}, but seems this is not the case, at least not after multiple layertofronts.
So how does this layertofront work the row? Does it swap their places, for example i switch c to front, and a moves to c:s place, or what?