How can I do it using Qt creator? I want make 2D game and I need that the screen will be always centered on the image and image will move.
Because when the image reach maximum screen width it is no longer visible on the screen.
How can I do it using Qt creator? I want make 2D game and I need that the screen will be always centered on the image and image will move.
Because when the image reach maximum screen width it is no longer visible on the screen.
I would anchor your image to the horizontal centre of the screen and animate the background and other elements. Are you using QML?
Yes I am using QML. I already solve this with following code:
But it needs some optimalization because when image moves quickly the movement is not smooth and lag.Timer{
id: timer
interval: 20
running: true
repeat: true
onTriggered: {
screen.x = -image.x + 320
}
I will try to solve it using OpenGL.
I realise this thread is starting to get old now but I remembered this:
http://forumnokia.adobeconnect.com/p6xkwcroh3l/
It's a webinar exactly about this and they get 60FPS by almost entirely using QML, apart from C++ for Audio, collision detection of a funny shape, and IAP IIRC.
So if you are listening there are some tips!