CanvasTerm - API for making term objects on Plethora Overlay glasses

Started by Wojbie, Jan 11, 2020, 01:39 am

Previous topic - Next topic


I am proud to present: CanvasTerm.

With this lovely API you and anyone you know can easily draw term-compatible objects on Plethora Overlay glasses! Have all conveniences of neural interface combined with ability to see term output at a glance of pocket! Easily redirect term to any canvas you want to.
Usage: (requires loading using require)
Code Select
term = canvasTerm.create( parentObject, offsetX, offsetX, nWidth, nHeight, nScale, bStartVisible, bFrameCursor )
parentObject -- should be a 2d canvas object like canvas(), canvas3d().create().addFrame() or addGroup() made on any of those.
offsetx, offsety -- coordinates to start drawing terminal on provided object
nWidth, nHeight -- size of terminal in characters.
nScale -- number specifying scale - 0.1-3 . Scales other then in this range can be unreadable or not fit in canvas size.
bStartVisible -- boolean - should term start visible or not. changed later using .setVisible() method
bFrameCursor -- boolean - additional frame around current cursor position - ignores CursorBlink status - useful for debugging.

Created object implements all term methods and additionally:
term.setVisible() -- turn terminal visible or not
term.redraw() -- force redraw
term.reposition( nNewOffsetX, nNewOffsetY, nNewWidth, nNewHeight, nNewScale, newParent ) -- Allows to change terminal properties. if you only want to change specific ones just provide nil to those staying same ex: to change scale do .reposition( nil, nil, nil, nil, nNewScale)
term.blinker() -- function that causes Cursor to blink. By default cursor don't blink. If you want to cause it to blink simply call this function every 0.1 sec or more often (implement it into your event loop) and you will get blinking cursor effect synchronized with all other CC cursors.


Feb 29, 2020, 06:14 pm #1 Last Edit: Mar 06, 2020, 08:26 am by pjals Reason: imgur
Issue 1: After looking at your code, I noticed this has limited color support, please add more color support, thanks!

Issue 2: It is all the time printing A with a brown background and green text, I'm very disappointed.

Here is my code:

Here is a image:
hi i am T79, bye


1) Can you share example of code you are using to interact with this API? Cause it fully supports all colors and pallettes normal term does.

2) If you see `A with a brown background and green text` that means you are doing something wrong.

The link you posted don't work..


Ok thank you for editing the message with updated urls. And see the problem. You don't realize that a plethora glasses canvas has limited size it can be. At scale of 2 (and with your program modified to be 300x200 instead of 600x200) while the terminal inside is claims to be 300x200 that you can only see is about 64x24 characters.

Example i described below:

As for your 'too long time without yeld' erroring issue - i never considered someone would try making big ass terminal and then not try making smaller ones first before reporting error. It simply errors during term building phase and all you are left with is debug pattern. Using term sizes that actually fit inside canvas are suggested.

Hope that explains how to correctly use this api?

As side note here is image using a different pallettes then default to showcase that this API does support all the colors.


SO COOL! I would love that, hopefully, I can make my own glasses which actually helps with finding your waypoint. It'll have a compass and such... I really like it! Good job!
Gitlab - COSC - XenusSoft - Hangout


Oh Yeah, this was one of the things i really wanted.

BAD ASS Terminal, colorfoul.

Very nice - i will directly have a try!


oh man....Plethora is minecraft 12.2 only....:0(

do u see any other options, i could use?
"Connected Glass" or sth else from MC 1.16.5?


Quote from: poisoned on Mar 19, 2021, 10:44 pmdo u see any other options, i could use?
"Connected Glass" or sth else from MC 1.16.5?

I have sadly not seen any mods that would implement some canvas-like system in 1.16.5 yet. If one shows up i will update this to support it too.


Could you explain the canvas system further u need for it?

Edit: would it be a could thing to return to 12.2?
My focus definitivly is on cc....


Quote from: poisoned on Mar 20, 2021, 09:36 pmCould you explain the canvas system further u need for it?
Something similar to plethora overlay glasses.
Or open peripheral terminal glasses.
There is even Open Glasses for OC.
But again none of those are for 1.16.4/5

Quote from: poisoned on Mar 20, 2021, 09:36 pmdit: would it be a could thing to return to 12.2?
My focus definitivly is on cc....
Personally i prefer playing on 1.16.4 cause its more up to date but if you want all peripheral mods you sure can go back.
Otherwise there is great peripheral mod for 1.16.4
If you really want overlay glasses you can suggest it there?



Quote from: poisoned on Mar 20, 2021, 11:01 pmThank you - i will have a look at it.
In fact since we last talked did add peripheral glasses. They are a bit raw and basic but i could implement this on them when i find some time one of those days. No promises tho.

Just poking you in case you missed that.