Giter VIP home page Giter VIP logo

shatter's Introduction

Shatter

Shatter your dull Overlay Glasses experience by turning it into a redirectable terminal target!

Shatter adds several features to the overlay glasses experience beyond a terminal. It is meant to be used in a neural interface (obviously) with an unbound wireless keyboard.

Brief Rundown

API

  • Parameters
    • table: canvas object provided by the overlay glasses
  • Returns
    • table: terminal object
    • function: cursor handler function to be put in parallel with your code

Terminal Object

Alpha Manipulation

getTextAlpha: get the alpha value for the text

  • Parameters
    • none
  • Returns
    • number: alpha value, in range 0-1

getBackgroundAlpha: get the alpha value for the background

  • Parameters
    • none
  • Returns
    • number: alpha value, in range 0-1

setTextAlpha: set the alpha value for the text

  • Parameters
    • number: alpha value within range 0-1
  • Returns
    • none

setBackgroundAlpha: set the alpha value for the background

  • Parameters
    • number: alpha value within range 0-1
  • Returns
    • none

Custom Color Manipulation

setTextHex: set the text color using a color code in the format 0xrrggbbaa

  • Parameters
    • number: hex code for color value
  • Returns
    • none

setBackgroundHex: set the background color using a hex color code in the format 0xrrggbbaa

  • Parameters
    • number: hex code for color value
  • Returns
    • none

getTextHex: gets the text color returned in the format 0xrrggbbaa

  • Parameters
    • none
  • Returns
    • number: hex code for color value

getBackgroundHex: gets the background color returned in the format 0xrrggbbaa

  • Parameters
    • none
  • Returns
    • number: hex code for color value

Scaling

setScale: set the text and background pixel scale

  • Parameters
    • number: scale value within range 0.5-10
  • Returns
    • none

Events

shatter_resize: fired when the shatter terminal object is resized

Getting Started

Let's set up all elements of shatter! Obviously you're here for this part so I'll make it as brief as possible.

  1. run wget https://raw.githubusercontent.com/hugeblank/Shatter/master/shatter.lua on your neural interface that has overlay glasses.
  2. Find an unbound wireless keyboard, this functions as both a keyboard & mouse, keep that in mind.
  3. Check out the examples directory for demonstrations on how to use shatter.

shatter's People

Contributors

hugeblank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

shatter's Issues

Holograms. Holograms Everywhere.

I can be as excited as I want about 2D subcanvases, but this takes the cake.

  • Look into modifying shatter to work on a 3D level. how hard can it be?
    • I have yet to do 3D programming well, so this may be interesting.
  • Provide transitioning from 3D to 2D canvases (and vice versa) so users have the ability to 'detach'/'attach' terminals.
    • Walk into a 3D terminal object, clamps to face. Who wouldn't want xenomorph terminals?
  • Figure out how mouse and keyboard interactions are going to function within an environment of 3D terminals
  • Will the user even have the ability to create multiple 3D/2D terminal objects? How will human interfacing peripherals interact? Maybe some sort of keybinding to switch active terminal windows, where the active terminal window has some sort of outline... maybe?

Guess who needs feedback. This bagel.

setAlpha changes

See if there is a way to make setAlpha a term API implement, and then make it behave like setTextColor/setBackgroundColor. Of course instead of a color, a number from 0-1 would be put in its place.

Suggested by @Ale32bit

setTextHex and getTextHex

Just a way for people to break free of the 16 color 'palette' system that is in normal terminals.
(You can get away with this anyways, see #7 )
Because this is a Overlay Glasses specific call, and not a redirectable term call, 8 digit hex codes will be supported meaning you can set RGB and A

scroll function

This may be something out of my control but even in SP the scroll function is just god awful. For things like the shell I'm looking into ways I can just execute scrolling every 1/20th of a second instead of literally every time the event is pulled. That's a fix unrelated to this program, I'm wondering if I may have to restructure the data such that it's easy to perform scrolling sans latency.

SQUIDDDDDDD!

Add setTextScale

Currently in progress, will have ranges 0.1 to 10, don't really see the use of having anything more than that. If the limit becomes a problem I probably will change it.

shatter.base

return the base canvas object with a modified clear function that doesn't remove any shatter related objects.

The glasses have already been shattered, you wouldn't want to obliterate them would you? That's just not nice.

setPaletteColor exploit

The gist of it is the function doesn't redraw the terminal.
Example, using colors.black:

term.setTextColor(colors.black) --setting to black, pretty typical
term.write("hello") --written in black, also typical
term.setPaletteColor(colors.black, 0xff00ff) --turn black into vibrant yellow. "hello" doesn't change to yellow...
term.write("world") --written in yellow as expected

Of course I do like the idea of having all colors available, but not like this. See #6
This also applies to setAlpha

read() optional override

Just thinking about ways on my end I could face the issue of shatter being unusable in full proper form on Switchcraft because of the claims blocking the right click ability of the keyboard. Here's the layout:

  1. It is universally acknowledged that nobody uses scroll lock.
  2. Keyboards can be put into the neural interface and then detect keystrokes without the keyboard even having to be right clicked
    Goal: read function that can be toggled with keys.scrollLock

Plethora Standard implementation

this has been pushed to plethora. I think this calls for an overhaul:

  • Add support for 2D object groupings, maybe revive #4 with the modification that shatter.base returns a subcanvas of the master that shatter is on rather than the literal terminal object.
  • Subcanvas-ify shatter for compatibility with other programs.

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.