r/ComputerCraft • • Jul 25 '22

Basalt Update

Hello guys!

Basalt got, since the last time i posted here, tons of new updates/fixes and features.

If you don't know what Basalt is, check this post out: Basalt UI Framework

Basalt is now able to create very easy and beautiful animations, you are able to change text, colors, position, size or offset (or create your custom animation). You can use some basic easing functions for the animation calculation (easeIn, easeOut, easeInOut).

Dynamic Values is a new feature to change, for example, the size of your object based on its parent size: "button:setSize("math.floor(parent.w * 0.8)", 3) <- would work.You are also able to change the position, here is a example for that: button2:setPosition("button1.w + button1.x + 2", "button1.y")

Textfields can now use keywords and patterns to change the text/bg color in specific situations.

I also made new objects, you can use: Menubar, Progressbar, Switch, Pane, Image and Graphic.

You can also use different anchors for your objects (default is topLeft): topLeft, top, topRight, left, center, right, bottomLeft, bottom, bottomRight, for example, if you use center, your object will always be centered on its parent (frame).

The old version of basalt didn't really support monitors. Now you are able to display your frame on a monitor instead of the computer's terminal (baseFrame:setMonitor(side)). Another feature is to mirror the computer terminal instead (baseFrame:setMirror(side)).

There are also a lot of smaller features & bugfixes (shadows, borders, shedule,...)

One of the biggest feature is XML support. You are now able to add your design via XML (if you want to). It could look like that: basaltPreview2.xml - but maybe it shouldn't look like that (i am sometimes lazy!). You are also able to do it in multiple files, because you always load the xml layout into a frame. You would use baseframe:addLayout(path) subframe:addLayout(anotherPath). It always starts to create the layout based on the frame where you are using the command. You could also do that via xml: <frame layout="yourpath.xml" />

Questions? Just ask!

Examples:
basaltPreview2.lua
basaltPreview2.xml
DiscordCC (lua only, beta)

Links:

Documentation: https://basalt.madefor.cc/#/

Github: https://github.com/Pyroxenium/Basalt

Discord: https://discord.gg/yM7kndJdJJ

30 Upvotes

6 comments sorted by

1

u/Nemonstrocity Jul 27 '22

alright. I'm impressed.

any thoughts on adding sound to this already a great job?

1

u/NyoriE01 Jul 28 '22

Hey, i am sorry for the late response. What exactly do you mean? You can trigger music by clicking on a button - you have to setup this yourself! :P

Sound should always be optional. I dont like to add sound by default. Not everyone would want that.

1

u/Nemonstrocity Jul 29 '22

Exactly, If the eu doesn't want sound make it a clickable setting.

Personally I'm a fan of machines that go 'boing'. Just me I guess.

Anyway as it is great job.

2

u/wolfe_br Jul 26 '22

Nice work!