Results 1 to 11 of 11

Thread: moving background

  1. #1
    Join Date
    May 2012
    Posts
    16
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default moving background

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: moving background

    Eeeem.... yes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2012
    Posts
    16
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moving background

    Quote Originally Posted by wysota View Post
    Eeeem.... yes.
    how?
    or is it another way to do this(make the background move)? newbie here....

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: moving background

    Hmm... QWidget::move()?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2012
    Posts
    16
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moving background

    Quote Originally Posted by wysota View Post
    thanks for reply.What I mean is not moving the frame, but moving content inside the frame.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: moving background

    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...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    May 2012
    Posts
    16
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moving background

    Quote Originally Posted by wysota View Post
    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).

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: moving background

    And what do you want to place on top of that?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    May 2012
    Posts
    16
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moving background

    Quote Originally Posted by wysota View Post
    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.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: moving background

    Use QGraphicsView then. Also have a look at the Parallax Sliding demo.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. The following user says thank you to wysota for this useful post:

    Dopt (18th June 2012)

  12. #11
    Join Date
    May 2012
    Posts
    16
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moving background

    Quote Originally Posted by wysota View Post
    Use QGraphicsView then. Also have a look at the Parallax Sliding demo.
    thanks!! I will try these out...=)

Similar Threads

  1. Replies: 0
    Last Post: 5th April 2011, 13:36
  2. Replies: 1
    Last Post: 25th June 2010, 18:31
  3. Replies: 0
    Last Post: 24th May 2010, 12:19
  4. moving in opengl
    By sdastagirmca in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2009, 12:21
  5. Moving the QGraphicsScene background content
    By maverick_pol in forum Qt Programming
    Replies: 5
    Last Post: 16th May 2008, 07:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.