Should Game Gui APIs use themes?

jmasterx
  • Should Game Gui APIs use themes? jmasterx

    I'm making a GUI API (in C++) for games which uses Allegro 5 as a backend. I looked at how GuiChan works and noticed that they intend for the user to override the paint event and do all the drawing yourself.

    Since I felt that in general, there's a decent standard to how widgets behave, I have a static theme class in each widget class (static ButtonTheme buttonTheme; etc) and the parameters set in that theme are used to construct that widget (from there, the parameters can be changed individually for specific widgets). These sorts of things are: padding, font color, border color, is drawing border, back color, size, min / max size etc).

    Where I also differ from GuiChan is in the fact that instead of default drawing being rectangles, the widgets have bitmap pointers and if they are NULL, it draws rectangles like GuiChan, if not, they are drawn with bitmaps: ex: button has default, hover, clicked. And if hover is not provided, the switch case will just use default for hover. Each theme has corresponding bitmaps. I also have bitmaps for focused and disabled.

    The user can always choose to override the paint event and do it from scratch.

    Is this a good idea or a terrible one to use themes and theming? Should I stay generic like GuiChan?

    As game developers , which would you prefer, (no themes, partial themes, partial themes + bitmaps)?

    Thanks

  • I'd definitely let developers do themes and override things if it doesn't add excessive burden to the average developer, nor decrease your chances of releasing.

    Assume that most of your user base will just use the stock methods at first, but the rest will love the fact they can do it different. Or once they've got it working with the stock methods, they'll customize later.

  • It doesn't seem to make much difference to me - the developer is going to need to be able to customise what gets drawn either way, so whether those customisations are grouped into a theme or not makes little difference. If you're talking about supplying your own themes then that's great but any developer who wants to release the game with the GUI visible is likely to replace your theme anyway.

Tags
game-design c++ gui
Related questions and answers
  • that make really hard to work with when coding some functions that use them. I was thinking of making ie. SimpleMesh and HierarchyMesh objects, which will also require that the renderer can deal with different types of objects in the same scene. I was also thinking about making a MeshNode class and then make a Mesh object that contains them, but then I have some conflict on where to store some data... I was thinking about making smaller structures with the fTime variable each so I can have attribute keyframes, light keyframes and buffer keyframes, then make the node structure look like

  • I am trying to build and run Doom 3 from the open source release in order to better understand how the engine works. Unfortunately I am not able to run the game from the binary I built. I just get the console, but cannot run the actual game. Here is what I did: Downloaded the source code from the game repo Downloaded and installed the DirectX SDK Purchased, downloaded and installed Doom 3 from... installation path. This is the default command line arguments used to run the project from vstudio. +set fs_basepath "C:\Program Files (x86)\Steam\steamapps\common\doom 3" +set com_allowConsole 1 +set si

  • to worry about this since it isn't an issue there. Moving to C++, this has become a fairly major problem and made me think I may have designed things incorrectly. I can't really imagine how to decouple my classes and still have them do what I want. Here's a few examples of a dependency chain: I have a status effect class. The class has a number of methods (Apply/Unapply, Tick, etc.) to apply... parties, and the party class has a list of BaseCharacters introducing another cyclical dependency. 2 - Events In C# I made extensive use of delegates to hook into events on characters, battle

  • I want to be able to (only) define game states using Lua script, but I'm not sure how I should do it. Here's what I have in mind currently: For each state, I will create a .lua file that contains a class (table) that has the same name as the file name. Each table must have a set of event handlers: onEnter (called when the state is entered), onUpdate (called every frame) and onExit (called when exiting the state). So if I want to have a MainMenuState, I will have a file called "MainMenuState.lua" which will contain something like this: MainMenuState = {} MainMenuState["onEnter"] = function

  • . state_->handleEvent(event, this); } That means that I don't really ever need more than one instance of a particular entity state; doing something like entity.setState(new StandState) is therefore highly wasteful. Then again, making each entity state a singleton hardly seems appropriate. What do you suggest I do? (The same can be said about game states, so whatever the solution...This is the first time I'm trying to make a 2D game, so I'm having quite a few difficulties in getting things right. Right now I'm trying to figure out exactly how the entity state machine should

  • To begin with I am developing a PSP application so I have no clue how to debug a PSP application. That doesn't mean I do not know how debug period. Anyway, when I run the game everything runs fine but when I press the X button on the PSP I see no bullet being drawn or updated on the screen. I know the problem doesn't lie with the pad because I press start and it exits my game so I do not think... it returned: %i", rval); return 1; } allegro_message("Setting Graphics Mode...Press X To Begin Game. Default Missile count: %i", bullets->size()); set_color_depth(32); int ret

  • I have been playing around with Ogre3d and trying to integrate bullet physics. I have previously somewhat successfully got this functionality working with irrlicht and bullet and I am trying to base this on what I had done there, but modifying it to fit with Ogre. It is working but not correctly and I would like some help to understand what it is I am doing wrong. I have a state system and when... - Y * W))); TEuler.setZ(atan2f(2.0f * (X * Y + Z * W), XSquared - YSquared - ZSquared + WSquared)); TEuler *= RADTODEG; } I seem to have issues with the cubes not colliding with each other

  • I'm writing a shooter (like 1942, classic 2D graphics) and I'd like to use a component based approch. So far I thought about the following design: Each game element (airship, projectile, powerup, enemy) is an Entity Each Entity is a set of components which can added or removed at run-time. Examples are Position, Sprite, Health, IA, Damage, BoundingBox etc. The idea is that Airship, Projectile... components. A powerup has the Sprite, Position, BoundingBox. And so on. The main loop manages the game "physics", i.e. how the components interact each other: foreach(entity (let it be entity1

  • line of sight cones etc. EDIT - the naive approach would be to duplicate this code 4 times for each vector, but surely there is a better way? I don't think this is a hard thing to do, but trying to do it has exposed a basic gap in my knowledge about what some of these lines of code do. should I just populate one big list from all the vectors and push that through? some need to be drawn...I want to include the drawing of other vectors of vertices in the following code, in a number of places it seems easy enough to simply add or multiply size()s of the two vectors, for instance

Data information