jueves, 10 de marzo de 2016
LeapTable API
LeapTable API
The leaptable uses an API (Application Program Interface) to create the GUI (Graphical User Interface).
This API is coding in C++ 11 and works only on windows (7 to 10) and uses for the graphics SFML (version 2.3), OpenGL and the LeapMotion API v2.
How it’s works?
The LeapTable’s API use XML files to create all of the objects, so at the beginning, the software load a folder who contain all of the files, assets and resources.
This folder has this type of hierarchy:
Main Folder
|- Window.xml (Contains all file’s names for the pages and resources)
|- Pages (is the folder who contain all of the pages)
|- PageOne.xml
|- PageTwo.xml
|- …
|- Assets
|- 3DModels
|- 3DModelsfile
|- …
|-Font
|- fontfile.ttf
|- …
|-Texture
|-textureFile.png
|- …
This is an example of window folder :
Window.XML
<Window Title="Hello World">
<Page File="PageOne.xml" Tag="PageOne"/>
<Page File="PageTwo.xml" Tag="PageTwo"/>
<Font File=”Font.ttf” Tag=”FontName”/>
<Texture File="Texture.png" Tag=”TextureName”/>
<3DObject File=”3DObjectFile” Tag=”3DObjectName”/>
</Window>
Page.xml
<Page Background="0xffffffff" Tag="PageOne">
<Object Type="Button" Tag="ButtonOne" Posx="10" Posy="10" Height="20" Width="10" Background="0xffff0000" Foreground="0xff0000ff" Border="0xff00ffff" ContentText="Click On Me" OnClick="OnButtonClick_2"/>
<Object Type="Button" Tag="ButtonTwo" Posx="30" Posy="10" Height="20" Width="10" Background="0xfff42580" Foreground="0x424242ff" Border="0x424242ff" ContentText="ButtonText" OnClick="OnButtonClick_3"/>
<Object Type="Button" Tag="ButtonThree" Posx="30" Posy="30" Height="20" Width="10" Background="0xffff0000" Foreground="0xff0000ff" Border="0xff00ffff" ContentText="Go to PageTwo" OnClick="OnButtonClick_4"/>
<Object Type="TextBlock" Tag="Text" Posx="10" Posy="40" Text="I'm a text" Font="Arial" TextSize="20" Foreground="0xff26aaff" />
</Page>
For the moment, the API can recognize 3 types of object in 2D: Button, ButtonCircular and TextBlock
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario