Skip to content

poke1024/tove2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TÖVE

Animated vector graphics for LÖVE.

Description

TÖVE is a vector drawing canvas for LÖVE, think HTML5's <canvas> or OpenFL's Graphics. Which you can animate. Efficiently.

Background

There have been various libraries for drawing vector graphics out there, but few of them are built for drawing or even animating complex scenes and most of them stopped at the most basic features.

As an example, take the HTML5 <canvas> tag: it's great in terms of quality, yet it's slow for animation or games, as it doesn't know how to keep its graphics data retained on the GPU: indeed, it will do a full redraw of the whole scene on each frame.

You can use WebGL, but then you lose vector graphics. There have been attempts to fix this by implementing vector graphics on top of WebGL, such as PIXI SVG and the ThreeJS SVG Loader. TÖVE is exactly like these, only more comprehensive. And for LÖVE.

Features

Getting Started

Releases are available for macOS, Linux and Windows: https://github.com/poke1024/tove2d/releases.

Some tutorials and general information on TÖVE are found in TÖVE's documentation.

Be sure to check out TÖVE's API documentation, which gives you detailed information on classes and functions.

Note: on Windows, in order to run the demos, you need to call setup.bat once (this will fix the links to the lib and asset folders, so you can run e.g. love demos/blob).

Building TÖVE Yourself

On Linux and macOS

git clone --recurse-submodules https://github.com/poke1024/tove2d
cd tove2d
scons
love demos/hearts

On Windows

# in git bash:
git clone --recurse-submodules https://github.com/poke1024/tove2d
cd tove2d

# in regular cmd shell:
cd path/to/tove2d
setup.bat /C

Take a look inside setup.bat to learn more about installing a compiler environment.

Experimental

Use scons --arch=sandybridge or scons --arch=haswell to compile for a custom CPU architecture. On Windows, this enables AVX extensions, which mainly speeds up the rasterizer dithering code.

On POSIX, in addition, you can enable hardware intrinsics for 16-bit floating point operations by using scons --f16c. These intrinsics might give small performance benefits in the gpux mode.

Since enabling custom options causes crashes on some CPUs (#24), I strongly recommend sticking to the defaults, as they ensure that your binary will run on many CPUs.

Roadmap

I keep my ideas of what might eventually end up in TÖVE in TÖVE's Public Trello Board.

License

TÖVE is licensed under the MIT license.

Details and the licenses of the included third party code are found in the LICENSE file.

Credits

TÖVE owes a lot to Mikko Mononen's excellent NanoSVG. Not only does TÖVE call NanoSVG in various places, it has also inherited some of its code.

TÖVE's API was inspired by EaselJS and PlotDevice.

The graphics you see in the tutorials and demos are by Mike Mac, Kenney and Chris Hildenbrand. The font in the demos is "amatic" by Vernon Adams.

About the Name

TÖVE is a portmanteau of LÖVE, Towards Vector Graphics and Tove Jansson, the Swedish author and illustrator of the Moomins.

Similar Projects