Particle Editor Demo
import Felgo 3.0
import QtQuick 2.2
import QtQuick.Controls 1.1
Item {
id: menuEditorWrapper
property alias menuEditor: menuEditor
width: scene.gameWindowAnchorItem.width/2.5
height : scene.gameWindowAnchorItem.height
property variant mainMenuContentParticles
ItemEditor {
id: menuEditor
width: parent.width
height: parent.height
currentEditableType: "Menu"
defaultGroupName: "Main Menu"
Component.onCompleted: {
menuEditor.addItemsToExternalGroupPanel(menuEditor.defaultGroupName,Qt.resolvedUrl("MainMenuContent.qml"))
mainMenuContentParticles = menuEditor.addItemsToExternalGroupPanel("Particles",Qt.resolvedUrl("MainMenuContentParticles.qml"))
mainMenuContentParticles.fillListWithFiles()
}
}
x: __outslidedX
y: scene.gameWindowAnchorItem.y
property int __outslidedX: scene.gameWindowAnchorItem.x-menuEditor.width
property int offsetX: __outslidedX+menuEditor.width
property int slideDuration: 800
property bool sliderOut: true
Behavior on x {
SmoothedAnimation { duration: menuEditorWrapper.slideDuration; easing.type: Easing.InOutQuad }
}
onXChanged: {
if(x <= __outslidedX) {
menuEditor.visible = false
} else {
menuEditor.visible = true
}
}
MultiResolutionImage {
id: pullUp
width: 54
height: 20
transformOrigin: Item.Center
rotation: -90
x: menuEditor.width+height/2-width/2
anchors.verticalCenter: parent.verticalCenter
source: "../assets/img/button-pullup.png"
MouseArea {
width: parent.width+30
height: parent.height+20
x: -(width-parent.width)/2
onReleased: {
menuEditorWrapper.slide()
}
}
}
function slide(pos) {
aboutPanel.closePanel()
if(menuEditorWrapper.sliderOut) {
if(menuEditorWrapper.x > __outslidedX+menuEditor.width/2 || menuEditorWrapper.x <= __outslidedX) {
x = offsetX
menuEditorWrapper.sliderOut = false
} else {
x = __outslidedX
menuEditorWrapper.sliderOut = true
}
} else {
if(menuEditorWrapper.x < __outslidedX+menuEditor.width/2 || menuEditorWrapper.x >= offsetX) {
x = __outslidedX
menuEditorWrapper.sliderOut = true
} else {
x = offsetX
menuEditorWrapper.sliderOut = false
}