- modelData.particular – has got the icon name, e.grams. “rum”, “parrot”, “captain”, .
- modelData.volume – keeps this new regularity property value the symbol.
- modelData.data – provides the personalized member data of your icon. We are able to make use of this to access the picture provider setup from our very own signs.
One which fulfills gala bingo the fresh video slot which have a back ground, a new reveals light traces while the an edge between the reels. This picture is placed above the history in addition to authored signs of the means the new z assets.
Placing That which you To each other
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // fill games windows having history Rectangle < // . > // add slot machine game FlaskOfRumMachine < anchors.centerIn: father or mother defaultItemHeight: 80 // picture top 70 + 5 margin best + 5 margin base (Icon.qml) defaultReelWidth: 67 // picture thickness > // . > >
As we county import “slotmachine” , we are able to range from the part. We anchor it in the middle of the world and you may establish the newest default depth and you will height into circumstances and reels. Once we did not set a specific top in regards to our symbols, the fresh new standard thinking can be used for all of them. When you hit gamble, this currently search a little an excellent. But during the a close look, the fresh new repaired peak lets empty components above or beneath the slot host.
Let’s real that! Even though our company is during the it, we could including offer everything you to life by the addition of an excellent handler towards the spinEnded code and you may implementing the fresh new startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // create slot machine FlaskOfRumMachine < id: slotMachine // we cardiovascular system they horzizontally and you can disperse it ten px "under" the big pub // since image of the brand new pub casts a trace into the to the new casino slot games anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we are in need of the casino slot games so you can auto-dimensions depending on the available top // the latest slotmachine will use the video game windows level with the exception of the fresh topBar and bottomBar urban area // like with the top pub, the bottom pub along with casts a trace with the to slot server height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // i up coming determine the new standard items peak according to the actual slotmachine height and you can row number defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change the new reel thickness to complement the thing level (in order to maintain the brand new width/level ratio of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // acceleration out-of twist is always to disappear/boost and additionally product top spinVelocity: Math.round(defaultItemHeight / 80 750) // hook signal to help you handler function onSpinEnded: scene.spinEnded() > // . // begin video slot function startSlotMachine() < if(!slotMachine.spinning && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // eradicate athlete loans scene.creditAmount -= scene.betAmount // start machine var stopInterval = utils.generateRandomValueBetween(five-hundred, 1000) // between five hundred and you may 1000 ms slotMachine.spin(stopInterval) > > // handle spin is gone signal function spinEnded() < bottomBar.startActive = not true if(bottomBar.autoActive) startSlotMachine() > > >
So we disperse new slot machine game 10px upwards so that the fresh topbar and also the slotmachine overlap sometime
I begin by straightening the entire video slot beneath the better pub. However the topbar image also contains a trace towards the bottom. Once the ideal club is positioned on top of the position servers, they casts their trace onto it. An equivalent relates to the beds base pub. Merely you to definitely in this situation, the newest peak of your slot machine is decided appropriately to let they convergence toward bottom bar.
After function an energetic top on casino slot games predicated on brand new readily available area, we and determine the fresh width and you will level of symbols appropriately. And as the past step i also size the newest spin acceleration in addition to the items level. If we failed to set an active course acceleration, a casino slot games that have reduced symbols would seem less.