
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
AAlib-Ruby brings graphics to the text terminal. AAlib-Ruby provides both a graphics context rendered as ascii-art and keyboard and mouse input. AAlib-Ruby supports a number of text-only display drivers such as Curses, SLang, and X11.
This is a DL based wrapper around the AA-lib C library. C struct alignment issues may cause problems on certain platforms when accessing variables of some objects.
Author:: Patrick Mahoney (mailto:pat@polycrystal.org) Copyright:: Copyright (c) 2007 Patrick Mahoney License:: Distributes under the same terms as Ruby
== Usage
First, AA-lib must be initialized with AAlib.init or AAlib.autoinit, returning an AAlib::Context. Two buffers are maintained: the image buffer and the text buffer. AAlib::Context#putpixel is the primary method to draw on the image buffer. AAlib::Context#render converts the image buffer to text, writing the result to the text buffer. Text may be written directly to the text buffer using AAlib::Context#puts and similar. Note that text written this way may be overwritten after a call to AAlib::Context#render. Finally, AAlib::Context#flush writes the text buffer to the screen.
=== Example
require 'aalib'
hp = AAlib::HardwareParams.new rp = AAlib::RenderParams.new
AAlib.parseoptions(hp, rp) or abort AAlib.help aa = AAlib.autoinit(hp) or abort "failed to initialize AA-lib" begin aa.autoinitkbd # set up keyboard support
# Fill screen with diagonal gradient
width = aa.imgwidth
height = aa.imgheight
height.times do |y|
width.times do |x|
aa.putpixel(x, y, 127*(x.to_f/width) + 127*(y.to_f/height))
end
end
rp.randomval = 25
aa.render(rp)
msg = ' AA-lib: the ascii-art library '
blank = ' ' * msg.size
attr = AAlib::Attr::BOLD
col = (aa.scrwidth - msg.size)/2
row = aa.scrheight/2
aa.puts(col, row - 1, attr, blank)
aa.puts(col, row, attr, msg)
aa.puts(col, row + 1, attr, blank)
aa.flush
aa.getkey # wait for any key to exit
ensure aa.close end
FAQs
Unknown package
We found that aalib-ruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.