[solved] Adding text over a grid of pushbuttons
-
Hi everyone,
This may be a very simple question but I couldn't find an answer while searching. I have written a simple memory game with pushbuttons in a grid layout and it is working perfectly. When the player uncovers the last match I would like to write "You Win" over the game screen but I would like to keep the game screen in the background. "Here":http://www.mobygames.com/images/shots/l/77636-yu-gi-oh-power-of-chaos-joey-the-passion-windows-screenshot.png is an example in a commercial game of what I am trying to do in case I wasn't clear. Is there a way of doing this in Qt? If the answer is no then I can always create a splash screen to display the message though that isn't quite the look I was going for.
Thanks,
Tim
-
Hi Tim,
You can certainly do this. If I understand correctly, the game board is a custom widget, which contains the buttons.
You can paint over this widget, by overriding the paint event from QWidget. Check out this:
http://qt-project.org/doc/qt-4.8/qwidget.html#paintEventGábor
-
Perfect! Thanks.