New Kojo Release — 2.7.03

I’m pleased to announce a new release of Kojo. Highlights of changes since v2.4.14 include:

1. The introduction of a dark theme

Kojo now includes a modern dark theme. The colors in this theme are easier on the eyes, especially for those who sit in front of Kojo for longer periods of time.


Here are some screenshots, showing both the new dark theme and the original (but slightly refined) light theme.

2. Windows gaming improvement

Animations on Windows are now able to run at 45-50 frames per second (fps), up from 30-33 fps in earlier versions.

To enable this, Kojo increases the resolution of the Windows system timer whenver an animation starts (and resets it to its original value when the animation ends).

3. Picture enhancements for generative art

In Kojo, Pictures are the building blocks of compositional graphics and generative art (and also gaming, but this section is not about that). The following Picture methods have been added in this release — from the perspective of supporting performant and rich generative art:

  • Picture.line(x, y) (to augment Picture.hline and Picture.vline)
  • Picture.ellipse(rx, ry)
  • Picture.fromPath { path => Unit }

The following method has been ‘optimized’ to perform well with a large number of instances

  • Picture.rectangle(w, h)

In case you are wondering about the missing second coordinate for the line/rectangle or the missing center coordinate for the ellipse, that’s because Pictures are anchored around the origin of their parent Picture’s coordinate system, and can be translated, rotated, and scaled as desired after they are created.

All of this will be explained in an upcoming e-book on generative art for secondary school children that will (as currently planned, but subject to enhancement) walk through the creation of these paintings  using Pictures. Here are a couple of Kojo screenshots to whet your appetite:



4. Embedded mode for devices like the Raspberry Pi.

Kojo now has a couple of modes – the original Desktop mode, and a new Embedded mode. The Embedded mode delays the loading of certain Kojo components till (and if) they are actually needed in a Kojo session. This, for example, brings down the Kojo startup time on a plugged-in Raspberry Pi 3b+ from ~50 seconds to ~20 seconds.

Also, in Embedded mode, Kojo does Fast syntax coloring within the script editor (based on the dafault Scala syntax coloring in RSyntaxTextArea). In Desktop mode, Kojo does Rich syntax coloring, which provides better support for things like interpolated strings and xml literals.

You can manually switch between Embedded / Desktop mode and Fast / Rich coloring using the script editor context menu (via a right-click on the editor).

5. Improvements to the Kojo-Arduino bridge

The Kojo-Arduino bridge has seen steady enhancements (the most notable recent one being the addition of support for ultra-sonic sensors for distance sensing). It is now pretty easy to program robots like this one using Kojo (we’ll put up a better video after we get our video-making act together).

Here’s a screenshot of the computer screen from the above video (with Kojo running on a Raspberry Pi 3b+):


6. Protection against the very rare freeze

Certain advanced Kojo scripts (like an earlier version of the beginner challenges) could freeze Kojo if the stars were aligned just wrong. Kojo now detects such potential freezes and stops the offending script.

7. Scala upgrade to 2.12.6

Last but not least, the Scala version in Kojo has moved from 2.11.11 to 2.12.6. This has been on the todo-list for quite some time, and was held back by the dependence of Kojo on the original Scala actor framework (which is not supported on Scala 2.12.x). For this release, Kojo’s actor dependency has been migrated to akka actors.

I’d like to put in a special word of thanks to Lund University for taking on the responsibility of building, signing, and hosting the Mac version of Kojo. Thanks Björn, Marcus, and Peter (for this, and for all your earlier contributions to Kojo).

That’s it for this release. As always, the new version is available from the Kojo Download Page. If you run into any difficulties, let us know.


This entry was posted in News, Release. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s