Commit 38ca2d7c authored by Exc404's avatar Exc404

Резервный коммит

parent 710cf255
......@@ -30,7 +30,15 @@ C.Button {
gameInfoScene.title = game.gameTitle;
gameInfoScene.icon = game.gameIcon;
gameInfoScene.exec = game.gameExec;
var globalCoordinates = mapToItem(null,0,0)
console.log("game coord - X: " + globalCoordinates.x + " y: " + globalCoordinates.y)
gameInfoScene.startX = globalCoordinates.x
gameInfoScene.startY = globalCoordinates.y
gameInfoScene.imgWight = game.width*1.05
gameInfoScene.imgHight = game.height*1.05
window.scene = SceneConstants.gameInfoScene;
gameInfoScene.startAnimation()
}
......
......@@ -59,6 +59,15 @@ Window {
id: homeScene
anchors.fill: parent
Behavior on opacity {
NumberAnimation {
target: homeScene;
property: "opacity";
duration: 300;
}
}
}
GameInfoScene {
......@@ -68,6 +77,14 @@ Window {
id: gameInfoScene
anchors.fill: parent
Behavior on opacity {
NumberAnimation {
target: gameInfoScene;
property: "opacity";
duration: 300;
}
}
}
RunningScene {
......
......@@ -5,9 +5,52 @@ import "../components"
import "../constants/scene.js" as S
Rectangle {
id: container
x: 0
y: 0
width: 640
height: 480
property string title: "Generic title"
property string icon: ""
property string exec: ""
// поля для анимации при открытии
property double startX: 0
property double startY: 0
// поля свойств изображения
property double imgWight: 0
property double imgHight: 0
function startAnimation(){
// gameRect.anchors.leftMargin= 8
// gameRect.anchors.topMargin= 70
// gameRect.anchors.left= gameRect.parent.left
// gameRect.anchors.top= gameRect.parent.top
}
states: State {
name: "completed"
AnchorChanges {
target: gameRect;
//anchors.leftMargin: 8
//anchors.topMargin: 70
anchors.left: gameRect.parent.left
anchors.top: gameRect.parent.top
}
}
transitions: Transition {
// smoothly reanchor myRect and move into new position
AnchorAnimation { duration: 1000 }
}
Component.onCompleted: container.state = "completed"
onVisibleChanged: function(){
// if(visible){
......@@ -21,11 +64,16 @@ Rectangle {
back.clicked();
}
id: container
x: 0
y: 0
width: 640
height: 480
//
Item {
id: startPos
x: startX
y: startY
}
Rectangle {
id: rectangle
......@@ -51,17 +99,9 @@ Rectangle {
}
}
Image {
id: gameImage
width: 128
height: 128
anchors.left: parent.left
anchors.top: parent.top
source: container.icon
anchors.leftMargin: 8
anchors.topMargin: 70
fillMode: Image.PreserveAspectFit
}
Text {
id: title
......@@ -144,4 +184,46 @@ Rectangle {
}
}
Rectangle{
id:gameRect
width: imgWight
height: imgHight
color:"#000000"
anchors.left: startPos.left
anchors.top: startPos.top
Image {
id: gameImage
anchors.fill: parent
source: container.icon
fillMode: Image.PreserveAspectFit
}
Behavior on x {
NumberAnimation {
target: gameRect;
property: "x";
duration: 300;
}
}
Behavior on y {
NumberAnimation {
target: gameRect;
property: "y";
duration: 300;
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment