{"id":1966,"date":"2017-12-12T09:15:53","date_gmt":"2017-12-12T09:15:53","guid":{"rendered":"https:\/\/www.migenius.com\/?p=1966"},"modified":"2017-12-20T22:46:22","modified_gmt":"2017-12-20T22:46:22","slug":"basic-canvas-operations-in-v8","status":"publish","type":"post","link":"https:\/\/www.migenius.com\/blog\/basic-canvas-operations-in-v8","title":{"rendered":"Basic Canvas Operations in V8"},"content":{"rendered":"

RealityServer 5.1 introduced new functionality for working with canvases in V8. In this post I’m going to show you how to do some basic things like resizing and accessing individual canvas pixels. We’ll build a fun little command to render a scene and process the result into a piece of interactive ASCII art. Of course, this doesn’t have much practical utility but it’s a great way to learn about this new feature!<\/p>\n

<\/p>\n

Rendering ASCII Art<\/h3>\n

ASCII Art<\/a> is a way of representing raster images purely by using a combination of standard ASCII characters rather than pixels. This technique was used heavily before raster based displays were common but you can still find many examples today.<\/p>\n

We are going to write a new RealityServer command in JavaScript using the Server-Side V8 API<\/a>. If you haven’t used the V8 API before, this will also serve as good starting point.<\/p>\n<\/div><\/div>