- modelData.style of – has got the icon label, elizabeth.g. “rum”, “parrot”, “captain”, .
- modelData.regularity – keeps the regularity property value the fresh new icon.
- modelData.data – contains the customized associate analysis of your icon. We could utilize this to get into the picture source configuration out-of our very own icons.
The one that Fitzdares fills the fresh new slot machine having a backgbullet, an alternate suggests white contours given that an edge between the reels. This visualize is positioned above the record therefore the written signs from the mode brand new z assets.
Putting Everything you To one another
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // fill online game screen with background Rectangle < // . > // incorporate slot machine game FlaskOfRumMachine < anchors.centerIn: father or mother defaultItemHeight: 80 // image level 70 + 5 margin greatest + 5 margin base (Symbol.qml) defaultReelWidth: 67 // photo width > // . > >
After we county transfer “slotmachine” , we can range from the parts. We point it in the world and you will indicate the fresh new standard width and you can peak to your activities and you may reels. As we don’t set a certain height in regards to our signs, the brand new default thinking are used for all of them. After you struck play, so it already lookup quite an effective. But from the a close look, the repaired level lets blank elements over or below the position server.
Let’s correct that! And while we are at the they, we could together with promote what you to life by the addition of an excellent handler toward twistEnded code and you may applying the fresh new startSlotMachine() mode.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // put casino slot games FlaskOfRumMachine < id: slotMachine // we cardio they horzizontally and you will flow it ten px "under" the big pub // just like the image of the new pub casts a shadow towards into the the newest casino slot games anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we need the fresh slot machine game in order to vehicle-dimensions with regards to the available level // this new slotmachine uses the overall game windows level with the exception of the new topBar and you will bottomBar city // as with the top bar, the base bar and additionally casts a shadow into the to slot server height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we up coming estimate new standard product peak in accordance with the real slotmachine peak and you will line matter defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and alter the latest reel width to match the thing level (to keep up the thickness/height proportion of the items) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity from spin will be drop off/boost and product height spinVelocity: Math.round(defaultItemHeight / 80 750) // hook signal in order to handler function onSpinEnded: scene.spinEnded() > // . // begin casino slot games function startSlotMachine() < if(!slotMachine.spinning && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // eliminate member credits scene.creditAmount -= scene.betAmount // begin host var stopInterval = utils.generateRandomValueBetween(500, 1000) // anywhere between 500 and you may 1000 ms slotMachine.spin(stopInterval) > > // manage spin is finished rule function spinEnded() < bottomBar.startActive = untrue if(bottomBar.autoActive) startSlotMachine() > > >
So we move the new video slot 10px up to let the brand new topbar while the slotmachine overlap a while
We start by aligning the complete slot machine game underneath the top bar. Although topbar picture also contains a shade towards the bottom. Just like the ideal club is put on top of the position servers, they casts their shade onto it. A comparable relates to the bottom pub. Merely one in this instance, this new top of casino slot games is set properly so that it convergence into bottom club.
Just after mode a working peak on the slot machine predicated on the newest available space, i together with calculate the new thickness and you can peak of your signs correctly. So that as the very last action we as well as level brand new spin speed as well as the items height. Whenever we don’t lay an energetic movement velocity, a slot machine game with quicker icons would appear less.

