Skip to content

GlistPlugins/gipButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gipButton

This GlistEngine plugin draws a blue button on the screen with the given coordinates. The button sends the clicks to a callback function for further processes.

Installation

Fork & clone this project into ~/dev/glist/glistplugins

Usage

  1. Add gipButton into plugins of your GlistApp/CMakeLists.txt

set(PLUGINS gipButton)

  1. Include gipButton.h in GameCanvas.h

#include "gipButton.h"

  1. Create a callback function

void GameCanvas::buttonClicked(int buttonId);

  1. Define gipButton object

gipButton button;

  1. Set callback and position

void GameCanvas::setup() { button.setClickCallback(std::bind(&GameCanvas::buttonClicked, this, std::placeholders::_1)); button.setPosition(100, 100); }

  1. Draw

void GameCanvas::draw() { button.draw(); }

  1. Listen and process the clicks in your callback function

Plugin Licence

Apache 2

About

A blue button plugin for GlistEngine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published