Skip to main content
gamedev.net
🔒 Locked

Interface

Started by Chris987 2 replies 350+ views
Original Post
Chris987
Chris987
Hi, Im making a management game, like championship manager. Im fine with all the backend code, match engine etc is working nearly bug free. Im now trying to make it look like a game. I am new to making interfaces so any help is much appreaceated. I have searched but have found nothing specifice to what i require. Basically, i have a mockup of what i want the screen to look like as a bitmap picture. Now im trying to make this into an interface and am not sure where to start... thanks, chris
Sneftel
Sneftel
Which graphics and input libraries are you using? OpenGL, Direct3D, DirectDraw, GDI, GDI+, DirectInput, SDL....?


"Sneftel is correct, if rather vulgar." --Flarelocke
Chris987
Chris987
OpenGL
bzroom
bzroom


I started with a base class that acted as a container.


class BaseClass
{
long coords[4]; //top, right, bottom left
long material; //to display on it

CallBackFunction callback;

BaseClass *children;
BaseClass *next;

virtual void Draw()
{
DrawQuad(material);
}

virtual void Click(int x, int y)
{
//checkagainst children here

if all children fail
{
callback(x,y);
}
}
};


Something like that. Derive other classes off it to make buttons, scrollbars, windows. Then make some sort of a focus manager, and have your game as an object that can receive focus, when focus is lost the game pauses.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.