Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

Monkeybone: Creating a bar diagram using Notepad part 1/4

2009-11-01

To make a diagram by hand using Notepad, start Notepad, click File and Save as. Change the filter from txt to All files. Provide a filename that ends with .mob (I will use bardiagram.mob in my example) and change the encoding to UTF-8. Then, click save. Keep Notepad open and write your instructions there.

Open the Monkeybone Viewer and open the bardiagram.mob file (you can use Open in the file Menu or just drag and drop bardiagram.mob onto the Monkeybone Viewer window). Note that the filename of your mob file is now showing in the title bar of Monkeybone viewer.

First, we specify the size and background color of the image using the Clear instruction. This will make a light gray image 400 pixels wide and 300 pixels high.

Clear 400x300 #e0e0e0

This video shows these steps.

To position the diagram on the picture, use the Diagram instruction. The arguments are it’s position, size and background color. This line create a white diagram.

Diagram #ffffff X:25 Y:40 W:350 H:230

The result of this, might look very much like a light gray image with a white Bar on it, but unlike a Bar, a Diagram has a coordinate system on it’s own. The image has it’s 0,0 at the top left and higher values are located to the right (X) and below (Y). Anything that is drawn on a Diagram, will be drawn using the Diagrams coordinate system. 0,0 is at the bottom left and higher values are located to the right (X) and above (Y). Adding a Bar and a DiagramBar with the same arguments, will not place them on top of each other, because the Bar will be drawn on the image using the images coordinate system, and the DiagramBar will be drawn on the Diagram, using the diagrams coordinate system.

Part 2.

Categories: General

Tags: Monkeybone

One response to “Monkeybone: Creating a bar diagram using Notepad part 1/4”

  1. […] as Unicode text. These files can be created by hand using any text editor, such as Notepad (shown here, here, here and […]

Leave a Reply

Your email address will not be published. Required fields are marked *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips