All Projects → r00ster91 → lime

r00ster91 / lime

Licence: MIT license
A library for drawing graphics on the console screen

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to lime

Lazykube
⎈ The lazier way to manage kubernetes.
Stars: ✭ 369 (+1053.13%)
Mutual labels:  console, mouse
Crossline
A small, self-contained, zero-config, MIT licensed, cross-platform, readline and libedit replacement.
Stars: ✭ 53 (+65.63%)
Mutual labels:  console, cursor
Ascii canvas
ASCII canvas for drawing in console
Stars: ✭ 11 (-65.62%)
Mutual labels:  console, drawing
Hideit.sh
Automagically hide/show a window by its name when the cursor is within a defined region or you mouse over it.
Stars: ✭ 171 (+434.38%)
Mutual labels:  mouse, cursor
Kursor
Cursor style with javascript and css
Stars: ✭ 140 (+337.5%)
Mutual labels:  mouse, cursor
Tart
Tart - draw ASCII art in the terminal with your mouse!
Stars: ✭ 296 (+825%)
Mutual labels:  drawing, mouse
Debuguisystem
Create a runtime menu system with buttons and windows for debugging in one line of code.
Stars: ✭ 48 (+50%)
Mutual labels:  console, window
Robotgo
RobotGo, Go Native cross-platform GUI automation @vcaesar
Stars: ✭ 7,095 (+22071.88%)
Mutual labels:  mouse, window
Consolegameengine
.NET Console Graphics Engine
Stars: ✭ 226 (+606.25%)
Mutual labels:  console, graphics-library
Ci edit
A terminal text editor with mouse support and ctrl+Q to quit.
Stars: ✭ 183 (+471.88%)
Mutual labels:  console, mouse
React Cursor Position
A React component that decorates its children with mouse and touch coordinates relative to itself.
Stars: ✭ 136 (+325%)
Mutual labels:  mouse, cursor
react-sticky-mouse-tooltip
React tooltip component that follow mouse cursor.
Stars: ✭ 17 (-46.87%)
Mutual labels:  mouse, cursor
Naturalmousemotion
This library provides a way to move cursor to specified coordinates on screen reliably, while being randomly arced to look like real hand moved it there by using a mouse. The default settings should look good enough for most cases, but if user wishes, they can heavily customize the settings and implementations responsible for the trajectory of the cursor for specific use cases.
Stars: ✭ 117 (+265.63%)
Mutual labels:  mouse, cursor
Gbox
🎨 A multi-platform graphic library
Stars: ✭ 216 (+575%)
Mutual labels:  drawing, graphics-library
Fabgl
Display Controller (VGA, SSD1306, ST7789, ILI9341), PS/2 Mouse and Keyboard Controller, Graphics Library, Sound Engine, Game Engine and ANSI/VT Terminal for the ESP32
Stars: ✭ 534 (+1568.75%)
Mutual labels:  mouse, graphics-library
Crossterm
Cross platform terminal library rust
Stars: ✭ 1,023 (+3096.88%)
Mutual labels:  console, cursor
hotscript
HotScript - Revolutionizing how Windows works.
Stars: ✭ 29 (-9.37%)
Mutual labels:  mouse, window
plain-overlay
The simple library for customizable overlay which covers a page, elements or iframe-windows.
Stars: ✭ 28 (-12.5%)
Mutual labels:  mouse, window
Window Size
Reliable way to to get the height and width of the terminal/console in a node.js environment.
Stars: ✭ 79 (+146.88%)
Mutual labels:  console, window
graphicsvg
Graphics library authored by Chris Schankula and Dr. Christopher Anand
Stars: ✭ 42 (+31.25%)
Mutual labels:  drawing, graphics-library

Docs

lime

A library for drawing graphics on the console screen

Features

  • Drawing of
    • text
    • lines
    • rectangles
    • filled rectangles
    • circles
    • PNG images
  • Management of the window
  • Controlling of the console cursor
  • Keyboard and mouse pointer input

Installation

Add the dependency to your shard.yml:

dependencies:
  lime:
    github: r00ster91/lime

Then run shards install

Example

Three lights flashing repeatedly in order:

require "lime"

# Create the lights:
# They are red, green and blue rectangles with doubled lines
light1 = Rectangle.new(
  x: 2, y: 1,
  width: 5, height: 3,
  type: Double, color: :red
)
light2 = Rectangle.new(8, 1, 5, 3, Double, :green)
light3 = Rectangle.new(14, 1, 5, 3, Double, :blue)

# The light that is currently on
light = 1

loop do
  if light == 3
    light = 1
  else
    light += 1
  end

  case light
  when 1
    light1.color = :light_red
    light2.color = :green
    light3.color = :blue
  when 2
    light1.color = :red
    light2.color = :light_green
    light3.color = :blue
  when 3
    light1.color = :red
    light2.color = :green
    light3.color = :light_blue
  end

  # Insert the lights into the buffer:
  light1.draw
  light2.draw
  light3.draw

  # Draw the content of the buffer to the screen:
  Lime.draw
  # Clear the buffer (not the screen) so we have room for the next frame:
  Lime.clear

  # You can use `Lime.loop` instead of a normal loop to skip the above two steps

  # A short delay:
  sleep 0.5
end

In the top left corner we can see:

lights

See examples for more examples.

For technical information about lime, see src/README.md.

Contributing

  1. Fork it (https://github.com/r00ster91/lime/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Install required shards (shards install)
  4. Make your changes
  5. Format the code (crystal tool format)
  6. Make sure the specs compile (crystal spec -v)
  7. Commit your changes (git commit -am 'Add some feature')
  8. Push to the branch (git push origin my-new-feature)
  9. Create a new Pull Request

Contributors

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].