Skip to content

Instantly share code, notes, and snippets.

@jocopa3 jocopa3/PocketEditionChart.js Secret
Last active Mar 9, 2017

Embed
What would you like to do?

Example Output:

{
"name": "Pocket Edition", // The chart's name (currently unused)
"version": "1.0.4", // The version displayed at the top of the chart
"format": "png", // The format (currently only supports png; will later support svg)
"columns": 2, // How many columns to render side-by-side before starting a new row
"drawOptions": {
"backgroundColor": [115, 158, 171], // Red Green Blue background color
"lineColor": [75, 75, 75], // Color to use for lines
"imageAntiAlias": false, // Toggles anti-aliasing for images
"textAntiAlias": false // Toggles anti-aliasing for text
},
// Obtain Types specify the method of obtaining certain blocks
"obtainTypes": [
{
"type": "legit", // Name of the obtain type
"desc": "legitimately", // Short description to render on the bottom-right of the chart
"color": [0, 0, 0], // Red Green Blue color
"isDefault": true // Makes this the default obtain type
},
{
"type": "enchants",
"desc": "silk touch",
"color": [0, 128, 0]
},
{
"type": "creative",
"desc": "creative mode",
"color": [0, 0, 128]
},
{
"type": "edu",
"desc": "edu edition",
"color": [128, 0, 128]
},
{
"type": "editors",
"desc": "inv. editors",
"color": [128, 0, 0]
}
],
// List of columns/sections to draw; columns are rendered sequentially
"chartColumns": [
{
"name": "Blocks", // Name of the column that appears at the top
"folder": "/res/blocks/", // Folder where image assets are stored
"columns": 9, // How many cells each row should have (i.e. the columns)
// All cells that belong in the column; cells are rendered sequentially
"cells": [
{
"id": 1, // Block id
"data": 0, // Block damage value
"obtainability": "legit", // The name of an obtain type (uses default if not specified)
"fileName": "Stone.png" // The name of the image file to use
},
{
"id": 1,
"data": 1,
"fileName": "Granite.png"
},
{
"id": 2,
"obtainability": "enchants",
"fileName": "Grass.png"
}
]
},
{
"name": "Items",
"folder": "/res/items",
"columns": 9,
"cells": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.