Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ingame
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
ingame
Commits
b22bbe26
Commit
b22bbe26
authored
May 07, 2024
by
Exc404
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Анимация движения карточки игры
parent
38ca2d7c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
15 deletions
+40
-15
GameInfoScene.qml
qml/scenes/GameInfoScene.qml
+40
-15
No files found.
qml/scenes/GameInfoScene.qml
View file @
b22bbe26
...
@@ -25,31 +25,42 @@ Rectangle {
...
@@ -25,31 +25,42 @@ Rectangle {
function
startAnimation
(){
function
startAnimation
(){
// gameRect.anchors.leftMargin= 8
// gameRect.anchors.topMargin= 70
// gameRect.anchors.left= gameRect.parent.left
// gameRect.anchors.top= gameRect.parent.top
startPos
.
x
=
startX
startPos
.
y
=
startY
gameRect
.
anchors
.
left
=
startPos
.
left
gameRect
.
anchors
.
top
=
startPos
.
top
container
.
state
=
"completed"
}
states
:[
State
{
name
:
"finish"
AnchorChanges
{
target
:
gameRect
;
anchors.left
:
startPos
.
left
anchors.top
:
startPos
.
top
}
}
states
:
State
{
},
State
{
name
:
"completed"
name
:
"completed"
AnchorChanges
{
AnchorChanges
{
target
:
gameRect
;
target
:
gameRect
;
//anchors.leftMargin: 8
anchors.left
:
finishPos
.
left
//anchors.topMargin: 70
anchors.top
:
finishPos
.
top
anchors.left
:
gameRect
.
parent
.
left
anchors.top
:
gameRect
.
parent
.
top
}
}
}
}
]
transitions
:
Transition
{
transitions
:
Transition
{
// smoothly reanchor myRect and move into new position
// smoothly reanchor myRect and move into new position
AnchorAnimation
{
duration
:
10
00
}
AnchorAnimation
{
duration
:
3
00
}
}
}
Component.onCompleted
:
container
.
state
=
"completed"
onVisibleChanged
:
function
(){
onVisibleChanged
:
function
(){
...
@@ -67,13 +78,24 @@ Rectangle {
...
@@ -67,13 +78,24 @@ Rectangle {
//
//
Start pos
Item
{
Item
{
id
:
startPos
id
:
startPos
x
:
startX
x
:
startX
y
:
startY
y
:
startY
}
}
// finish pos
Item
{
id
:
finishPos
anchors.left
:
gameRect
.
parent
.
left
anchors.top
:
gameRect
.
parent
.
top
anchors.leftMargin
:
8
anchors.topMargin
:
70
}
Rectangle
{
Rectangle
{
id
:
rectangle
id
:
rectangle
...
@@ -96,6 +118,11 @@ Rectangle {
...
@@ -96,6 +118,11 @@ Rectangle {
imageUrl
:
"../images/back.svg"
imageUrl
:
"../images/back.svg"
onClicked
:
function
(){
onClicked
:
function
(){
window
.
scene
=
S
.
homeScene
;
window
.
scene
=
S
.
homeScene
;
//gameRect.anchors.leftMargin= 0
//gameRect.anchors.topMargin= 0
container
.
state
=
"finish"
}
}
}
}
...
@@ -195,8 +222,6 @@ Rectangle {
...
@@ -195,8 +222,6 @@ Rectangle {
anchors.left
:
startPos
.
left
anchors.top
:
startPos
.
top
Image
{
Image
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment