Giter VIP home page Giter VIP logo

dragonruby-ui-sample's Introduction

Deprecated

Please visit https://github.com/danhealy/dragonruby-zif

UI Sample

This is a demonstration of some simple UI elements, based on the excellent free assets at kenney.nl

  • Self-truncating labels
  • 9-slice resizable panels
    • A simple glass panel with two options for each corner
    • A complex metal panel where the top edge transitions from blue to metal, with a header label inside
    • A very simple cutout for the above panel
  • Progress bars
  • Interactive buttons with labels

It's built on some library code:

  • Sprite helper class, tying together Assignable, Serializable and attr_sprite
    • Easy to setup new sprites using Sprite.new.tap {|s| s.x = 5 ... }
  • ComplexSprite is the basis for many of these, it's a way of combining individual sprites into something that can be displayed and modified as a whole using render_targets.
  • TwoStageButton, ThreePanel, NinePanel, NinePanelEdge

The idea is that you could drop the app/lib/ui folder into your project, and create custom elements as in app/ui

Experiment with this code!

Source is under MIT License and available at https://github.com/danhealy/dragonruby-ui-sample

Kenney assets are under CC0 license, including modifications made by me to allow for pixel scaling

Suggested things to try:

  • Build out the vertical progress bars! This is currently left as a todo.
  • Add some more elements from Kenney's assets
  • Try creating a nine-slice panel without splitting the assets apart, using source_[x/y/w/h]

Changelog

  • September 13 2020: Deprecated in favor of https://github.com/danhealy/dragonruby-zif
  • July 28 2020: Moved the lib/* stuff to Zif namespace, so it can be reused by others more easily
  • July 27 2020: Initial commit

dragonruby-ui-sample's People

Contributors

danhealy avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.