Jump to content

GUIs


VeTaL
 Share

Recommended Posts

For now, i'm using 2 GUIs:

 

1. ImGui (taken from raycast lib, and, to be correct, from Chris Paulson's Game )

pros: its extremely simple, fast and code-driven.

negs: it doesnt support skins, so it cant be end-user UI

add: in combination with _raise/_event system (i tried to find, where i got it, but wasn't scusessed), it makes creation of debug panels extremely simple:

1) its needed to inherit from GameObject: PlayerManager : public GameObject

2) its needed to define 3 virtual functions

virtual void UpdateEvent( float gameLoopTime);
virtual void RenderEvent( float gameLoopTime);		
virtual void RenderGuiEvent( float gameLoopTime);

3) its needed to define RenderGuiEvent, which would be called every frame while drawing gui

void PlayerManager::RenderGuiEvent( float gameLoopTime )
{
imguiBeginScrollArea("Player debug",
	800, 10, 200, 200, &_debugScroll); 

if (_controller)
{
	_playerPos = EntityPosition(_controller);
	sprintf(_debugBuf, "playerX: %f", _playerPos.X );
	imguiValue( _debugBuf );
	sprintf(_debugBuf, "playerY: %f", _playerPos.Y );
	imguiValue( _debugBuf );
	sprintf(_debugBuf, "playerZ: %f", _playerPos.Z );
	imguiValue( _debugBuf );
	imguiSeparator();
}	

imguiEndScrollArea();	
}

and thats all!

 

2. CeGui (i already had realization, but also nice tutorial was found here)

pros: it supports skins and layout editor

cons: its not so simple and flexible, it contains its own realisation of XML-parser, input and a lot of garbage

add: after some additional work (well, you can just close your eyes at the structure of CEGUI and use it as "black box"), you can get nice UI for end-user.

 

What are you thinking about it?

Working on LeaFAQ :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...