[SOLVED]Loading Level Problem
-
wrote on 27 Aug 2011, 03:52 last edited by
I am currently working on a game which involves several levels..but
Is there any way to load the next level without overlaying the previous one?? I am using Loader to load the next qml level file.. but as Load and load new level files, it affects the entire game.. it starts to slow down animations included on my game
Is there any way to load the next level file and destroy the previous one?
-
wrote on 27 Aug 2011, 06:58 last edited by
I'm not sure if I understood, but if you are using one Loader it should destroy the previous one when new component is loaded.
-
wrote on 27 Aug 2011, 15:37 last edited by
If this is what you're doing, then it will really lag:
main.qml
{
Loader {source: new.qml}
}new.qml
{
Loader{source: newer.qml}
} -
wrote on 27 Aug 2011, 16:26 last edited by
diph: no , i believe its not..
nhojyer07
i have this code@Image{
x: 40;y: 10
width: 266;height: 179
source:"images/menu/sipnayan.png"
MouseArea{
anchors.fill: parent
onClicked: {
MouseArea.enabled=false
onClicked:pageLoader.source="Menu.qml"
}
}
}
Loader{
id:pageLoader
anchors.fill: parent
}
@ -
wrote on 27 Aug 2011, 16:37 last edited by
You just want to show menu on top of the application without filling the whole app area?
@Loader {
id: pageLoader
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
height: 100
}@ -
wrote on 28 Aug 2011, 02:45 last edited by
no.. there's a new "page" for that
-
wrote on 28 Aug 2011, 05:53 last edited by
So you're the programmer of sipnayan.
Anyway, what I did in my project is this. The main QML only has Loaders and Connections in it.
main.qml:
@{
Loader{
id: menuLoader
source: "SceneMenu.qml"
}
Loader{
id: gameLoader
anchors.fill: parent
}
Connections {
id: menuConnection
target: menuLoader.item
onGamestart: {
gameLoader.source = "SceneGame.qml"
menuLoader.source = ""
}
}
}@SceneMenu.qml:
@{
...
signal gamestartMouseArea{onClicked: gamestart}
}@When the player clicks the mouse area in scenemenu.qml, the gamestart signal is triggered, passed to menuConnection, and changes the sources of the Loaders.
-
wrote on 28 Aug 2011, 12:11 last edited by
and? can you please elaborate further? :D PUHLEASE :3
1/8