Skip to content
/ MyGUI Public

The project contains My Gui-Button-Menu classes in c++ and the raylib library.

License

Notifications You must be signed in to change notification settings

Omegapy/MyGUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


MyGui Gui-Button-Menu

MyGui is a c++ collection of classes that utilizes the raylib library; the classes feature buttons and menu-bars for graphical user interface (GUI). MyGui offers a diverse set of methods that simplify and streamline the coding of buttons and menus.

Alejandro (Alex) Ricciardi
created date: 02/08/2023


Requirements:

c and c++ 17 or later
MS Windows 10 or later
Raylib library: https://www.raylib.com


Project description:

The project contains My Gui-Button-Menu classes in c++ and the raylib library.


Buttons

/*
   -- ButtonR --

    The ButtonR class creates a rectangle-shaped static-size button, window-resized-not-responsive button.

    The button size is computed from the font size and length of the text;
    the text is automatically centered on the button.
    See mutators to modify the button’s position, the text’s position in the button, and the button’s size.

    The button's border can be turned on and off.
    the border's size is computed from the font size and length of the text;
    modifying the button's size, we also modify the border's size.

    The button's shadow can be turned on and off.
    The shadow size is computed from the font size and length of the text;
    modifying the button's size, we also modify the shadow's size..

    The default font is raylib font.

    Parent class to the ButtonO class
   
*/
ButtonR button;
/*
    -- ButtonO --

    The ButtonO class creates a rounded edges rectangle shaped static-size button, window-resized-not-responsive button.

    The button size is computed from the font size and length of the text;
    the text is automatically centered on the button.
    See mutators to  modify the button’s position, the text’s position in the button, and the button’s size.

    The button's border can be turn on and off.
    the border's size is computed from the font size and length of the text;
    modifying the button's size, we also modify the border's size.

    The button's shadow can be turn on and off.
    The shadow size is computed from the font size and length of the text;
    modifying the button's size, we also modify the shadow's size.
    See mutators for modifying specifically the shadow's size and position.

    The default font is raylib font.

    Child class of ButtonR class
    
*/
ButtonO button;
/*
    -- ButtonP --

    The ButtonP class creates a responsive button from an image.
    (The button resizes with the window)

    The button size is computed from the font size and length of the text;
    the text is automatically centered on the button.
    See mutators to modify the button’s position, the text’s position in the button, and the button’s size.

    The button's shadows can be turned on and off. It is off by default.
    The sizes of the shadows are computed from the font size and length of the bar with the longest text;
    modifying the bars’ sizes will also modify the shadows’ sizes.
    The default font is raylib font.

    The default font is raylib font.
    
*/
ButtonP button;

Menus

/*
    -- MenuR --

    The MenuR class creates static-size menu objects,
    window-resized-not-responsive menus.
    The MenuR objects consist of rectangle shaped bars.

    The menu object can contain one menu bar or several menu bars,
    the menu can be automatically positioned on the left, center, or right side of the screen.
    See mutators to modify the menu position.

    The bars’ sizes are computed from the font size and length of the bar with the longest text;
    the texts can be positioned on the left, center, or right side of the bars.

    The bars’ borders can be turned on and off.
    The sizes of the borders are computed from the font size and length of the bar with the longest text;
    modifying the bars’ sizes will also modify the borders’ sizes.

    The bars' shadows can be turned on and off.
    The sizes of the shadows are computed from the font size and length of the bar with the longest text;
    modifying the bars’ sizes will also modify the shadows’ sizes.

    The default font is raylib font.

    The menu bars untilize the ButtonR class.

*/
MenuR menu;
/*
    --- MenuO ---

    The MenuO class creates static-size menu objects,
    window-resized-not-responsive menus.
    The MenuR objects consist of rounded edges rectangle shaped bars.

    The menu object can contain one menu bar or several menu bars,
    the menu can be automatically positioned on the left, center, or right side of the screen.
    See mutators to modify the menu position.

    The bars’ sizes are computed from the font size and length of the bar with the longest text;
    the texts can be positioned on the left, center, or right side of the bars.

    The bars’ borders can be turned on and off.
    The sizes of the borders are computed from the font size and length of the bar with the longest text;
    modifying the bars’ sizes will also modify the borders’ sizes.

    The bars' shadows can be turned on and off.
    The sizes of the shadows are computed from the font size and length of the bar with the longest text;
    modifying the bars’ sizes will also modify the shadows’ sizes.

    The default font is raylib font.

    The menu bars untilize the ButtonO class.

*/
MenuO menu;
/*
    --- MenuP ---

    The MenuP class creates responsive menu objects, from images.

    The menu object can contain one menu bar or several menu bars,
    the menu can be automatically positioned on the left, center, or right side of the screen.
    See mutators to modify the menu position.

    The bars’ sizes are computed from the font size and length of the bar with the longest text;
    the texts can be positioned on the left, center, or right side of the bars.

    The bars' shadows can be turned on and off. It is off by default.
    The sizes of the shadows are computed from the font size and length of the bar with the longest text;
    modifying the bars’ sizes will also modify the shadows’ sizes.
    
    The default font is raylib font.
    
    The menu bars untilize the ButtonP class.

*/
MenuP menu;

Link: Image How To ButtonP Class


Links :
Project GitHub: https://github.com/Omegapy/MyGUI
GitHub: https://github.com/Omegapy
Youtube MyGui: https://www.youtube.com/watch?v=I_9yhN82opo&t=1s
YouTube: YouTube: https://www.youtube.com/@omegapy
Facebook: https://www.facebook.com/profile.php?id=100089638857137
Twitter: https://twitter.com/RicciardiAlex


Credits:

Example button image:
icons png from pngtree.com

About

The project contains My Gui-Button-Menu classes in c++ and the raylib library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages