Results 1 to 20 of 51

Thread: 4 in a row

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default 4 in a row

    Hai all,
    I am developing my own 4 in a row game in qt. while we play the ball falls from top to bottom of the grid the problem is that it feels like ball falls over through the grid . But I want the feel that ball falls through inside the grid . I tried what i know? but no use. Is there any way to do so?
    thanx in advance .

  2. #2
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: 4 in a row

    Could you describe a little more what is your current implementation?

  3. #3
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 4 in a row

    hai rachol,
    There is a 7x7 grid(image). There are two players one is comp: and another is user. There are two balls . now the ball falls to the bottom from top when we clicked on the desired position but through over the grid(Image). I want to get a feel that ball is falling through the grid cells and get placed in the position

  4. #4
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: 4 in a row

    Ok,

    But how did you think to implement it?

    QGraphicsView or custom QWidgets?

  5. #5
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 4 in a row

    Using QWidgets

  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: 4 in a row

    So why are you posting your problem in Qt Quick forum?
    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 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 4 in a row

    by mistake

  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: 4 in a row

    So how does your widget look like? How did you implement it?
    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 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 4 in a row

    I named my Qwidget as mainwidget and coded like this:
    Qt Code:
    1. ui->mainwidget->setStyleSheet("background-image: url(content/Pics/M_CCholder.png); "
    2. "background-position: top left; ");
    To copy to clipboard, switch view to plain text mode 


    it works for me but the problem remains the same?

  10. #10
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: 4 in a row

    Well, because you are setting background to your main widget on top of which all the children widgets are drawn, it doesn't work the way you wished for.

    What about placing another backgroundWidget on top of your mainwidget? Or using QStackedLayout::StackAll and having your backgroundWidget being the current widget in the layout?

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

    vinayaka (20th June 2011)

Tags for this Thread

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.