Jump to content

SimpleUI (dxGUI) library


XaskeL

Recommended Posts

This is a simple dxGUI library. With the ability to describe your interface in a table. The library has just begun its development and, I would like you to participate in its development too.

The idea behind this is that the library can be easily exported via loadstring and used in your code. Also, have a minimum set of functions and a minimum of code to implement a simple interface.

Plans for further changes:

1. Come up with local and global functions as well as rename old functions. (for the entire style sheet or for an object in the interface table).
2. Change synchronization in style sheets, object table and interface table with sorted table.
3. Simplify the code. e.g styles.

4. Add simple animations like fade window and so on.

Link: 
https://github.com/XaskeL/SimpleUI/

#Wiki:

1. return index = baseUI.Construction(index, dx, dy, position, gui)
index: Name of The name of your interface table (must be unique).
dx,dy: Developer screen resolution. (the one who constructs the interface).
position: Position in the table. This type:
  { x = 0; y = 0; w = 0; h = 0; }
gui: Here you describe your objects. Also in the table with records.
  { p = LAYER_NUMBER (1..N), type = 'OBJECT TYPE', x = 0, y = 0, w = 0, h = 0, color = tocolor(255, 255, 255, 255) };
Example:
  background = { p = 1, type = 'image', x = 0, y = 0, w = 740, h = 638, image = 'assets/images/background.png', color = WHITE };
  { p = 2, type = 'image', x = 20+(160-82)/2, y = 60+15, w = 82, h = 70, image = 'assets/images/icons/1.png', color = WHITE };

2. return table = baseUI.GetScale(index);
  Returns a size table with a resolution difference.
 local scale = baseUI.GetScale(UI);

3. baseUI.SetScale(index, scale.x, scale.y);
  sets the size of items relative to the screen.

4. baseUI.SetAlign(index, 'center', 'center');
  sets the position of the interface relative to the position on the screen: left, top, bottom, right

 

Edited by XaskeL
  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...