- modelData.variety of – gets the symbol term, age.g. « rum », « parrot », « captain », .
- modelData.volume – retains this new regularity value of the fresh new symbol.
- modelData.study – provides the customized associate analysis of your icon. We are able to use this to get into the picture provider arrangement out of our icons.
One that fills the new slot machine having a backgbullet, an alternate suggests white contours once the a line https://22betscasino.net/pt/ between the reels. It picture is placed over the background plus the authored icons by means brand new z assets.
Putting Everything you Together
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // fill game screen having records Rectangle < // . > // put slot machine game FlaskOfRumMachine < anchors.centerIn: parent defaultItemHeight: 80 // image level 70 + 5 margin best + 5 margin base (Icon.qml) defaultReelWidth: 67 // picture depth > // . > >
Once we condition import « slotmachine » , we could range from the parts. I anchor they in the middle of the view and you will indicate the brand new standard width and you may level with the affairs and reels. Even as we didn’t lay a particular level for our icons, this new default beliefs are used for them. After you struck enjoy, that it currently research quite a great. But at a close look, the repaired level allows empty parts a lot more than otherwise underneath the slot servers.
Let us real that! And while we’re from the they, we could and additionally offer what you your by adding an excellent handler into the twistEnded rule and using this new startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // create casino slot games FlaskOfRumMachine < id: slotMachine // i center it horzizontally and you can move they 10 px "under" the major bar // since image of the brand new bar casts a shadow on into the the newest slot machine game anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we require the slot machine to help you vehicles-size with regards to the offered top // the fresh new slotmachine uses the overall game window level apart from this new topBar and you can bottomBar urban area // just as in the big bar, the base bar plus casts a trace towards so you can slot server height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we upcoming determine the brand new default product peak in accordance with the genuine slotmachine peak and you will line amount defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change the fresh new reel depth to suit the thing peak (to keep up the brand new thickness/top proportion of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // speed off twist will be decrease/raise along with product height spinVelocity: Math.round(defaultItemHeight / 80 750) // hook up laws to handler form onSpinEnded: scene.spinEnded() > // . // begin slot machine game function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // lose user credit scene.creditAmount -= scene.betAmount // start server var stopInterval = utils.generateRandomValueBetween(five hundred, 1000) // anywhere between five hundred and you can 1000 ms slotMachine.spin(stopInterval) > > // handle spin is fully gone rule function spinEnded() < bottomBar.startActive = incorrect if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we flow the brand new slot machine 10px upwards to allow the brand new topbar as well as the slotmachine overlap some time
I start with aligning the whole video slot beneath the most useful pub. But the topbar visualize also incorporates a trace at the bottom. Since the best club is positioned on top of the slot host, they casts their shade about it. A similar relates to the base club. Merely one in such a case, the new height of your slot machine game is decided accordingly so that they convergence on the bottom club.
Immediately following setting a dynamic level on slot machine according to the new readily available place, we plus assess the brand new thickness and you will top of one’s icons correctly. So when the last action we also level the latest spin acceleration also the goods height. Whenever we don’t place an active way acceleration, a slot machine game that have shorter icons would seem smaller.

Commentaires récents