Results 1 to 5 of 5

Thread: Skinning a button and using bitmap fonts

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2010
    Posts
    99
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Skinning a button and using bitmap fonts

    I have been making a game on and off for the past few years, and i had built my own GUI for it (using OpenGL for the graphics). I had put that project aside for a while, until recently when i decided to re-write the GUI, and a lot of other components, using Qt.

    Two of the most important things i need for the GUI is to have bitmap* skinned buttons and bitmap fonts.
    Right now, i have buttons that look like this (note that the grey is not part of the button):

    I admit, the font doesn't look the best, but i would still like to be able to use a bitmap font. Or at least find a better way to use fonts. I don't know what other games do.
    One other point to make is the size of the button, it will need to be bigger than the standard button size.

    Firstly, for the skinning, i don't suppose there is an easy (or possible) way to do this using style sheets. So the other way would be to subclass each widget and do custom drawing. That should probably be faster than style sheets, too.
    As for the button size, if i subclass i can override the size hint. But i am not sure what the size should be. I want it to resize well and look good at different screen sizes.

    It would be cool if there was already a 3rd party GUI library for Qt, like wysota's widgets, but geared more towards games (that is, can use bitmap skins and fonts).
    If not, where is the best place to start? Just start subclassing each widget and re-write their drawing code?


    * I am using the Microsoft definition of bitmap, so i actually mean pixmap.
    Attached Images Attached Images
    Last edited by xtal256; 24th August 2011 at 12:19.
    [Window Detective] - Windows UI spy utility
    [War Thunder]

Similar Threads

  1. Bitmap on Push Button in QT 3
    By Gokulnath in forum Newbie
    Replies: 2
    Last Post: 12th January 2011, 07:34
  2. Re-skinning
    By davidgould in forum Newbie
    Replies: 2
    Last Post: 9th July 2010, 05:40
  3. QToolButton customization / skinning
    By Treggie in forum Qt Programming
    Replies: 8
    Last Post: 20th February 2010, 20:20
  4. Bitmap border
    By SailinShoes in forum Qt Programming
    Replies: 5
    Last Post: 14th May 2008, 18:37
  5. Bitmap buttons
    By BloodHo in forum Newbie
    Replies: 1
    Last Post: 4th November 2006, 14:17

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.