PDA

View Full Version : moving background



Dopt
16th June 2012, 10:08
hi guys.
Let's say when I start a Qt-Gui, its display starts from (0, 0).Is that possible when I press right key, so that the display starts from (+50, 0) , to make the background looks like moving?:rolleyes:

wysota
16th June 2012, 21:49
Eeeem.... yes.

Dopt
17th June 2012, 07:17
Eeeem.... yes.

how?
or is it another way to do this(make the background move)? newbie here....:confused:

wysota
17th June 2012, 10:32
Hmm... QWidget::move()?

Dopt
18th June 2012, 04:05
Hmm... QWidget::move()?

thanks for reply.What I mean is not moving the frame, but moving content inside the frame.

wysota
18th June 2012, 12:00
Put that content inside another widget that is a child widget of the top-level one and move that. No idea why you want that, though...

Dopt
18th June 2012, 13:06
Put that content inside another widget that is a child widget of the top-level one and move that. No idea why you want that, though...

I think I explain wrongly.what I mean is scrolling a background image, setting up a horizontally scrolling background that auto-scrolls behind, like a 2D game(example).

wysota
18th June 2012, 14:09
And what do you want to place on top of that?

Dopt
18th June 2012, 15:02
And what do you want to place on top of that?
A moving character(QPixmap).background keep scrolling to left when he is moving to right side and the center is always be that character.

wysota
18th June 2012, 15:43
Use QGraphicsView then. Also have a look at the Parallax Sliding (http://labs.qt.nokia.com/2008/11/03/parallax-sliding/) demo.

Dopt
18th June 2012, 16:26
Use QGraphicsView then. Also have a look at the Parallax Sliding (http://labs.qt.nokia.com/2008/11/03/parallax-sliding/) demo.
thanks!! I will try these out...=)