当前位置:网站首页>[CEGUI] concept introduction

[CEGUI] concept introduction

2022-06-12 10:09:00 Lindo

CEGUI Concept introduction

background

Crazy Eddie’s GUI(MIT License), An open source GUI( Graphical user interface ) library . Use C++ Realization , follow OOP, Its purpose :

games developers who should be spending their time creating great games, not building GUI sub-systems.

The latest version is 0.8.7, Official website (http://cegui.org.uk/)
Below to 0.8.7 Version .

Architecture diagram

 Insert picture description here

  • ImageCode: Graphics decoding module ( Such as :FreeImage、SILY etc. )
  • ResourceProvider: Resource management module
  • XMLParser: XML analysis
  • ScriptMode: Script module
  • Render+Texture: The render module ( Such as :OpenGL、DirectX etc. )
  • InputEvent: Input system module
  • CEGUICoreWindowRenderSet: Window rendering module
  • Base(System):CEGUI Core control system module , Including execution flow 、 Resource management 、 Image set 、 system interface

Main concepts

attribute

Attribute system (Property)
CEGUI Properties in , It is actually a set of data . This data can affect the appearance of the window 、 Behavior and so on .
Not only Window, All objects , Can have attributes .
The birth of attribute system , So that you can use scripts , utilize xml Dynamic configuration window related data .

  • example
<Property Name="UnifiedMaxSize" Value="{
     {1,0},{1,0}}" />

event

The event system (Event)
An event is a mechanism or method by which a window notifies an external window of its own state change . When it happens at a certain time , Call some functions to handle notification events .
CEGUI The event system in is identified by events + A set of handler functions .
about Callback function ,CEGUI Encapsulates the following types :
 Insert picture description here
Event and attribute systems , Mainly in order to XML Set window events and window logic in .

Resource management

CEGUI There are mainly the following resources in :

  • .scheme file :CEGUI Definition of various data used in the system , Such as font information 、 Image set information 、 Window appearance information .
<?xml version="1.0" ?>									
  <GUIScheme Name="TaharezLook">//  Express scheme					
  <Imageset Name="TaharezLook" Filename="TaharezLook.imageset" />//  Image set 	
  <Font Name="Commonwealth-10" Filename="Commonwealth-10.font" />//  typeface 		
  <LookNFeel Filename="TaharezLook.looknfeel" />// Appearance file (falagard System ) 	
  <WindowRendererSet Filename="CEGUICoreWindowRenderSet" />//  Window rendering module 		
  <FalagardMapping WindowType="TaharezLook/Tree" TargetType="CEGUI/Tree" Renderer="Falagard/Tree" LookNFeel="TaharezLook/Tree" />//  External name 、 Internal name 、 Render window 、 appearance 
</GUIScheme>									
									

  • .looknfeel file : Appearance system , Can provide XML File specifies the image layout of the window , Layout of child windows , The default attribute , Attribute definition, etc .
  • .imageset file : Image set file . Think of an image as a collection of small images . Picture location information , Distinguish between small images .( The size of the image set , Need to be 2 Power dimension of , At this time, the processing efficiency of the graphics card is the best )
  • .layout file : Layout file , Contains the layout information of a window .
<?xml version="1.0" encoding="UTF-8"?>								
<GUILayout version="4">								
        <Window type="TaharezLook/FrameWindow" name="Frame" >								
            <Property name="Text" value="Console" />								
            <Property name="TitlebarFont" value="DejaVuSans-10" />								
            <Property name="MaxSize" value="{
     {1,0},{1,0}}" />								
            <Property name="TitlebarEnabled" value="True" />								
            <Property name="Area" value="{
     {0.208832,0},{0.650387,0},{0.80736,0},{0.998062,0}}" />								
            <Window type="TaharezLook/MultiLineEditbox" name="ConsoleText" >								
                <Property name="Text" value=""/>								
                <Property name="ReadOnly" value="True" />								
                <Property name="MaxTextLength" value="1073741823" />								
                <Property name="MaxSize" value="{
     {1,0},{1,0}}" />								
                <Property name="Area" value="{
     {0.019238,0},{0.030633,0},{0.973721,0},{0.769186,0}}" />								
            </Window>								
            <Window type="TaharezLook/Editbox" name="Input" >								
                <Property name="MaxTextLength" value="1073741823" />								
                <Property name="MaxSize" value="{
     {1,0},{1,0}}" />								
                <Property name="Area" value="{
     {0.019238,0},{0.772141,0},{0.973721,0},{0.980658,0}}" />								
            </Window>								
        </Window>								
</GUILayout>								

window

  • CEGUI Window in is an abstract concept . It can be simply understood as , It is a unit that can be painted independently
  • CEGUI Design idea , In windows WidgetSets.
原网站

版权声明
本文为[Lindo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203010528239197.html