Particle Editor Demo
import Felgo 3.0
import QtQuick 2.2
Item {
id: itemEditorWrapper
property alias itemEditor: itemEditor
property alias state: itemEditor.state
width: scene.gameWindowAnchorItem.width/2.5
height : scene.gameWindowAnchorItem.height
ItemEditor {
id: itemEditor
width: parent.width
height: parent.height
currentEditableType: "FireParticle"
property bool dataStorageLocation: false
}
x: __outslidedX
y: scene.gameWindowAnchorItem.y
property int __outslidedX: scene.gameWindowAnchorItem.x+scene.gameWindowAnchorItem.width
property int offsetX: __outslidedX-itemEditor.width
property int slideDuration: 800
property bool sliderOut: true
Behavior on x {
SmoothedAnimation { duration: itemEditorWrapper.slideDuration; easing.type: Easing.InOutQuad }
}
onXChanged: {
if(x >= __outslidedX) {
itemEditor.visible = false
} else {
itemEditor.visible = true
}
}
MultiResolutionImage {
id: pullUp
width: 54
height: 20
transformOrigin: Item.Center
rotation: 90
x: -(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: {
itemEditorWrapper.slide()
}
}
}
function slide(pos) {
aboutPanel.closePanel()
if(itemEditorWrapper.sliderOut) {
if(itemEditorWrapper.x < __outslidedX-itemEditor.width/2 || itemEditorWrapper.x >= __outslidedX) {
x = offsetX
itemEditorWrapper.sliderOut = false
} else {
x = __outslidedX
itemEditorWrapper.sliderOut = true
}
} else {
if(itemEditorWrapper.x > __outslidedX-itemEditor.width/2 || itemEditorWrapper.x <= offsetX) {
x = __outslidedX
itemEditorWrapper.sliderOut = true
} else {
x = offsetX
itemEditorWrapper.sliderOut = false
}