Hello.
I do jigsaw puzzles. At the click of a button, I need to shuffle all the pieces.
To animate of 20 pieces, I need to do 40 actions - Set X and Set Y for each piece.
In each action I wrote:
return Math.random() *0.8.
How can I write all this operations in one code?
For example (this code doesn’t work):
Item {
Connections {
target: widget.scriptAdaptor
onEventItemClicked: {
pageUi.getBlockByName(“D1”).x = Math.random() * 0.8;
pageUi.getBlockByName(“D1”).y = Math.random() * 0.8;
…
}
}
}