Repeater does not work for Sprite inside SpriteSequence?
Unsolved
General and Desktop
-
hello guys...
so i have this:
// Sprites property variant sprites: [{"name": "idle", "width": 80, "height": 100, "left": 150, "top": 441, "frames": 4}, {"name": "walk", "width": 80, "height": 100, "left": 150, "top": 77, "frames": 6}, {"name": "run", "width": 80, "height": 100, "left": 150, "top": 200, "frames": 6}, {"name": "attack1", "width": 80, "height": 100, "left": 200, "top": 321, "frames": 4}, {"name": "climb", "width": 80, "height": 100, "left": 150, "top": 564, "frames": 4}, {"name": "push", "width": 80, "height": 100, "left": 150, "top": 686, "frames": 6}, {"name": "dust1", "width": 80, "height": 100, "left": 150, "top": 809, "frames": 6}, {"name": "jump", "width": 80, "height": 100, "left": 150, "top": 77, "frames": 8}, {"name": "walkAttack", "width": 80, "height": 100, "left": 150, "top": 200, "frames": 6}, {"name": "hurt", "width": 80, "height": 100, "left": 150, "top": 321, "frames": 4}, {"name": "death", "width": 80, "height": 100, "left": 150, "top": 441, "frames": 8}, {"name": "attack2", "width": 80, "height": 100, "left": 150, "top": 564, "frames": 6}, {"name": "throw", "width": 80, "height": 100, "left": 150, "top": 686, "frames": 4}, {"name": "dust2", "width": 80, "height": 100, "left": 150, "top": 809, "frames": 6} ] // Player SpriteSequence { id: mySprite x: 200 y: 200 width: 80 / 2 height: 100 / 2 smooth: true //mirror: false // does not work running: true antialiasing: true z: 5 property string source: "images/sprite_white.jpg" Repeater { id: spriteRepeater model: sprites //anchors.fill: root delegate: Sprite { name: sprites[index]["name"] frameWidth: sprites[index]["width"] frameHeight: sprites[index]["height"] frameCount: sprites[index]["frames"] frameDuration: 250 frameX: sprites[index]["left"] frameY: sprites[index]["top"] source: mySprite.source } } }
which gives me error:
Cannot assign object to list property "sprites"
on line where i have the Repeater
tho, is very weird that this works fine with no error:
// Lands property variant lands: [{"id": 1, "image": "01", "x": 5, "y": 60, "scale": 1, widthRatio: 1}, {"id": 2, "image": "02", "x": 15, "y": 45, "scale": 1, widthRatio: 1}, {"id": 3, "image": "03", "x": 19, "y": 10, "scale": 1, widthRatio: 1}, {"id": 4, "image": "04", "x": 27, "y": 40, "scale": 1, widthRatio: 1}, {"id": 5, "image": "05", "x": 35, "y": 55, "scale": 1, widthRatio: 1}, {"id": 6, "image": "06", "x": 42, "y": 30, "scale": 1, widthRatio: 1.2}, {"id": 7, "image": "07", "x": 46, "y": 45, "scale": 1, widthRatio: 1}, {"id": 8, "image": "08", "x": 56, "y": 20, "scale": 1, widthRatio: 1}, {"id": 9, "image": "01", "x": 65, "y": 35, "scale": 1, widthRatio: 1}, {"id": 10, "image": "02", "x": 72, "y": 15, "scale": 1, widthRatio: 1}, {"id": 11, "image": "01", "x": 75, "y": 70, "scale": 1, widthRatio: 1.5} ] // Lands Repeater { id: landRepeater model: lands //anchors.fill: root delegate: Image { asynchronous: true cache: true width: sourceSize.width * lands[index]["scale"] * lands[index]["widthRatio"] height: sourceSize.height * lands[index]["scale"] x: background.width / 100 * lands[index]["x"] y: background.height / 100 * lands[index]["y"] smooth: true source: "images/land_" + lands[index]["image"] + ".png" } }
so what do i do wrong? why Repeater does not like Sprite?