Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extras #1

Open
danprince opened this issue Mar 19, 2022 · 0 comments
Open

Extras #1

danprince opened this issue Mar 19, 2022 · 0 comments

Comments

@danprince
Copy link
Owner

danprince commented Mar 19, 2022

Other stuff to consider extracting to add to this library.

  • Shaded tinting
  • Transparency keys
  • Glyph composition
  • Multitile glyphs
  • Glyph alignment
// Cleaner way to wait for tileset to load
terminal.ready = start;

// Write a string with optional alignment and max width.
write(terminal, 0, 0, "Hello world", { align: "left", width: 5 });

// Support escape codes for color rendering
write(terminal, 0, 0, "[red,black]hello[/] world");

// Wrap text into line objects
wrap(terminal, 0, 0, "Hello world", { width: 5 });
// => [{ length: 5, text: "Hello" }, { length: 5, text: "world" }]

// Measure text (after wrapping)
let metrics = measure(terminal, 0, 0, "Hello world", { width: 5 });
// => { width: 5, height: 2 }

// Nested terminals
let panel = child(terminal, 5, 5, 10, 10);
panel.write(0, 0, "test") // writes at 5,5
panel.relativePoint(x, y)

// Mouse handling?
// Keyboard handling?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant