All Projects β†’ ParadoxZero β†’ GameMenu-cpp

ParadoxZero / GameMenu-cpp

Licence: MIT license
A c++ library depending on sfml which can be used to create old school UI menu for sfml based software.

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to GameMenu-cpp

my-country-presidents
Open source repository containing information about a country's president profile
Stars: ✭ 12 (-42.86%)
Mutual labels:  beginner-project, beginner-friendly
Pandemic-Produce-Delivery-Project
An ongoing open-source e-commerce shop using React, Express, Firebase, and MongoDB. Designed for pandemic-relief and social good. New contributors are always, always, welcomed, regardless of where you are πŸ”₯. Feel free to reach out at [email protected]~
Stars: ✭ 20 (-4.76%)
Mutual labels:  beginner-project, beginner-friendly
github welcome wall
This is the official repository for the Towards Data Science Article, "WTH am I doing here? The absolute beginner's guide to Git and GitHub"
Stars: ✭ 25 (+19.05%)
Mutual labels:  beginner-project, beginner-friendly
Heel2Toe
A beginner-friendly repository to get started with HTML, CSS, and JS.
Stars: ✭ 22 (+4.76%)
Mutual labels:  beginner-project, beginner-friendly
100-Days-of-Code
Officially committing to 100 Days of code challenge.
Stars: ✭ 63 (+200%)
Mutual labels:  beginner-project, beginner-friendly
JS-OS
An Unified Operating System on the web
Stars: ✭ 54 (+157.14%)
Mutual labels:  beginner-project, beginner-friendly
HACKTOBERFEST2021 INSPIRATION
😎A Hacktoberfest-2021 Contribution Repository For Beginners😎...Simplest Repo for BeginnersπŸ‘¨β€πŸ’»πŸ‘¨β€πŸ’»πŸ‘¨β€πŸ’»...Add your Profile Details, Photo and Inspirational Quote πŸ™ŒπŸ™ŒπŸ™Œ& There you go to do your first PR❀❀❀
Stars: ✭ 30 (+42.86%)
Mutual labels:  beginner-project, beginner-friendly
password-keeper
A simple and secure Password Management System made completely in Python.
Stars: ✭ 26 (+23.81%)
Mutual labels:  beginner-project, beginner-friendly
GREIN
GREIN : GEO RNA-seq Experiments Interactive Navigator
Stars: ✭ 40 (+90.48%)
Mutual labels:  graphical-interface
J.A.R.V.I.S
Just A Rather Very Intelligent System
Stars: ✭ 36 (+71.43%)
Mutual labels:  beginner-friendly
cmkr
Modern build system based on CMake and TOML.
Stars: ✭ 211 (+904.76%)
Mutual labels:  beginner-friendly
10secondsofcode
The team behind 10-seconds-of-code and official 10-seconds projects.
Stars: ✭ 41 (+95.24%)
Mutual labels:  beginner-friendly
react-chat-client
A simple chat client built in React for communicating with the node-multi-server-chat example
Stars: ✭ 24 (+14.29%)
Mutual labels:  beginner-friendly
good-first-issues
Find good first issues right from your CLI! πŸš€
Stars: ✭ 64 (+204.76%)
Mutual labels:  beginner-friendly
hacktoberfest-beginners
This repository solely aims to provide beginners a spark to start contributing to open source. Open source helps our growth in myriad ways. The early you start the better you become.
Stars: ✭ 17 (-19.05%)
Mutual labels:  beginner-friendly
Simple-ADB
ADB/Fastboot. With a GUI.
Stars: ✭ 29 (+38.1%)
Mutual labels:  beginner-friendly
ZeroOctave-Javascript-Projects
This Repository Contains 150+ web development Projects.
Stars: ✭ 134 (+538.1%)
Mutual labels:  beginner-friendly
bioGUI
bioGUI provides install modules for bioinformatic software for users and allows developers to script a GUI for their applications.
Stars: ✭ 14 (-33.33%)
Mutual labels:  graphical-interface
ruby-sinatra-starter-app
A starter project for Ruby On Sinatra web app projects to introduce programmers to Ruby programming.
Stars: ✭ 36 (+71.43%)
Mutual labels:  beginner-friendly
HacktoberFest21
A beginner friendly repository for HacktoberFest 2021
Stars: ✭ 45 (+114.29%)
Mutual labels:  beginner-friendly

GameMenu

Codacy Badge License: MIT Language (C++) Build Status

This is a C++ library to help create Menu UI for games based of sfml. It provides simple and direct pathways to create Menu, add action to it etc.

How to use?

The main purpose of the library is to make creation of menu's in games easy. This achieves it by dividing the Menu into two parts:

  • UI - Options to display
  • Function - The action to perform

To use the library

  • First Need to decide the menu items, ie the options available (eg Start, Exit, Highscore etc)
  • Create A vector of gmenu::MenuItem. Which contains the title of the item and Action it will perform.

The definition of gmenu::MenuItem is:

```cpp
   struct MenuItem {
       std::shared_ptr<Action> action;
       std::string title;
   };
```

 Here `gmenu::Action` is an abstract Class that acts as an interface.
 The virtual method `bool DerivedAction::start()` will be called by the Menu when that item is selected.
  • Now create a style. gmenu::Style

    • It requires two paramenters ( sf::Font ) to initialize.
    • gmenu::Style can be used to define the look of the menu.
     sf::Font &TitleFont;
     sf::Font &ItemFont;
    
     sf::Color TitleColor = sf::Color::Green;;
     sf::Color ItemColor = sf::Color::Red ;
     sf::Color Selected = sf::Color::Blue; 
    
     unsigned int TitleFontSize = 50;
     unsigned int ItemFontSize = 20;
     
     float MenuItemScaleFactor = 0.25; // This determines the distance between options. 
     
     int layout = Layout::Default; // Bitflag, Defines the layout of menu. eg. Layout::ItemLeft| Layout::TitleCentre
    
     struct {
      signed int top, left;
     } PaddingTitle, PaddingItems; // this is the padding that will extra displacement that will always be added.
  • Now create an object of gmenuMenu which require the following parameters:

    • sf::RenderWindow : Where menu is to be created
    • std::vector<gmenu::MenuItem> : Vector containing MenuItems.
    • gmenu::Style: That defines the style.
  • Vola, your menu is ready to be used.

Screenshots!

Dependencies

  • Simple and Fast Multimedia Library

    • How to install on linux

        $ sudo apt-get install libsfml-dev
      
    • How to install in Windows (visual studio)

      • Download the binaries from sfml
      • Open project settings
      • In c/c++ option
      • Add new include dir as <Path to sfml>/include
      • In linker additional external libraries
      • Add <path to sfml>/lib

Installing

Linux

  • Clone/Download source

  • Go to Project dir eg:

      $ cd GameMenu
    
  • type

      $ make
    
  • Now copy the contents of GameMenu/include to your project's include directory.

  • Copy lib/libGameMenu.a to your projects lib directory.

  • Include the path /path/to/GameMenu/include/ within you project.

  • Now you can use the GameMenu by linking bin/libGameMenu.a to your executable.

    eg

      $ g++ your_source.cpp -I./include -o your_output.o
      $ g++ your_output.o -L./lib -lGameMenu -o your_executable
    

Windows (Visual Studio)

  • Clone/Download the GameMenu
  • Build for the required platform
  • Copy the content of GameMenu/include to your folder's include directory.
  • Copy the .lib GameMenu.lib to your projects lib directory.
  • Add the GameMenu.lib to your linker input files list.
  • Build and enjoy.

Contributions

If you are looking to contribute, then feel free to create a pull request.

Future Possibilities

  • Mouse integration
  • Menu style system. Abiity to alter the menu apearance as per need. (Create a style object with nessary specifications, which will be passed to the Menu)
  • Sound.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].