Giter Site home page Giter Site logo

sdlmenu's Introduction

Basic SDL Joypad-driven Menu

sdlmenu in action

A quickly-hacked Ruby/SDL menu 'system' intended as a front-end for emulator systems on Raspberry Pi.

But given it's simplicity and portability you may just as well use it for anything you like.

Caveats/Notes:

  • Will handle only about a dozen items (no paging whatsoever)
  • Will use first joypad; which button is the 'Enter' button will vary across joypads
  • The method to execute a command and then return back is a bit hacky (for a reason)
  • The example.rb is the version I use, the sdlmenu.rb can be considered development/debug version
  • Font included came with Ruby/SDL, I hope I'm not gonna get sued for that
  • Code is not commented... if something is unclear, treat it as an incentive to learn Ruby
  • SDL is low-level, and the interface is not fully consistent with itself, oh well...

To configure, edit at least:

FONT = 'sample.ttf' # you'll want absolute path to your TTF font
MENU = [
  ['Menu Item One', 'sleep 5'], # 'Title', 'Command'
  ['Menu Item Two', 'sleep 5'], # and so on...
  ['Exit', nil],                # nil command means exit
]

If you need legalese assume BSD 2-clause license.

sdlmenu's People

Contributors

drbig avatar

Stargazers

Oops avatar Shea avatar

Watchers

James Cloos avatar  avatar Shea avatar  avatar

Forkers

ssilverm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.