- modelData.type of – provides the icon title, age.grams. “rum”, “parrot”, “captain”, .
- modelData.volume – retains the fresh new regularity property value this new symbol.
- modelData.studies – provides the custom affiliate data of the symbol. We are able to use this to gain access to the picture origin setup out of all of our icons.
One that fills the brand new slot machine https://cloudbets.net/au/ that have a background, a different sort of suggests light traces due to the fact a line within reels. It photo is put over the records additionally the composed icons by mode brand new z possessions.
Getting What you To each other
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // complete video game screen that have record Rectangle < // . > // add slot machine FlaskOfRumMachine < anchors.centerIn: father or mother defaultItemHeight: 80 // image top 70 + 5 margin most readily useful + 5 margin base (Symbol.qml) defaultReelWidth: 67 // photo thickness > // . > >
As we county transfer “slotmachine” , we could add the part. We point it in the exact middle of the world and you will establish the newest default thickness and height to the issues and you can reels. As we don’t lay a certain top for our symbols, the brand new standard values are used for all of them. When you hit play, it already research quite good. But in the a closer look, new fixed peak lets blank section more than or beneath the position server.
Why don’t we true that! Although we have been at the they, we could together with offer everything you your adding a handler on the spinEnded code and you will using the new startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // add casino slot games FlaskOfRumMachine < id: slotMachine // we center they horzizontally and you will flow they ten px "under" the major bar // since picture of the newest bar casts a shadow with the toward the latest slot machine anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we truly need the fresh new video slot in order to automobile-proportions according to available height // the fresh slotmachine uses the video game screen peak apart from the topBar and you may bottomBar city // like with the major pub, the beds base pub and additionally casts a shade into the to help you slot servers height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // i then determine brand new standard goods top based on the genuine slotmachine top and you may line amount defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change the new reel width to match the thing peak (to keep this new width/top proportion of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // acceleration regarding twist is always to decrease/increase plus product level spinVelocity: Math.round(defaultItemHeight / 80 750) // hook laws in order to handler setting onSpinEnded: scene.spinEnded() > // . // begin slot machine game function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // dump pro credit scene.creditAmount -= scene.betAmount // initiate server var stopInterval = utils.generateRandomValueBetween(five-hundred, 1000) // between five-hundred and 1000 ms slotMachine.spin(stopInterval) > > // manage twist is fully gone rule function spinEnded() < bottomBar.startActive = not the case if(bottomBar.autoActive) startSlotMachine() > > >
So we circulate the new video slot 10px upwards to allow the fresh topbar plus the slotmachine overlap some time
We start with aligning the entire slot machine underneath the ideal bar. But the topbar visualize also incorporates a trace at the end. As greatest bar is placed on top of the slot servers, they casts the shade about it. An equivalent relates to the bottom pub. Just you to definitely in this instance, the fresh new height of one’s slot machine game is determined properly to let they overlap toward base pub.
Immediately following setting an active level into the slot machine game considering this new available place, i including calculate the brand new width and you will height of your signs properly. So when the past step we as well as measure brand new spin acceleration plus the product height. When we don’t place an active movement acceleration, a slot machine game which have faster signs would appear quicker.