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
38ca2d7c
Commit
38ca2d7c
authored
May 07, 2024
by
Exc404
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Резервный коммит
parent
710cf255
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
16 deletions
+123
-16
Game.qml
qml/delegates/Game.qml
+8
-0
qml.qml
qml/qml.qml
+17
-0
GameInfoScene.qml
qml/scenes/GameInfoScene.qml
+98
-16
No files found.
qml/delegates/Game.qml
View file @
38ca2d7c
...
...
@@ -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
()
}
...
...
qml/qml.qml
View file @
38ca2d7c
...
...
@@ -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
{
...
...
qml/scenes/GameInfoScene.qml
View file @
38ca2d7c
...
...
@@ -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
;
}
}
}
}
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