Skip to content

Instantly share code, notes, and snippets.

@rozek
Created January 9, 2020 06:33
Show Gist options
  • Save rozek/382086986ce6526001578daaad8834e7 to your computer and use it in GitHub Desktop.
Save rozek/382086986ce6526001578daaad8834e7 to your computer and use it in GitHub Desktop.
Bangle.js: draws a 4bpp bitmap from Espruino Image Converter output
Bangle.setLCDMode('80x80');
g.clear();
const Width = g.getWidth(), CenterX = Width/2;
const Height = g.getHeight(), CenterY = Height/2;
let Ghost_1 = {
width:6, height:6, bpp:4, transparent:0,
buffer: E.toArrayBuffer(atob("AMwADP/ADMzADMzADMzAwMwM"))
};
let Ghost_2 = {
width:6, height:6, bpp:4, transparent:0,
buffer: E.toArrayBuffer(atob("ALsAC/+wC7uwC7uwC7uwsLsL"))
};
let Ghost_3 = {
width:6, height:6, bpp:4, transparent:0,
buffer: E.toArrayBuffer(atob("AIgACP+ACIiACIiACIiAgIgI"))
};
let Ghost_4 = {
width:6, height:6, bpp:4, transparent:0,
buffer: E.toArrayBuffer(atob("AN0ADf/QDd3QDd3QDd3Q0N0N"))
};
g.drawImage(Ghost_1,CenterX-Ghost_1.width*3,CenterY-Ghost_1.height/2);
g.drawImage(Ghost_2,CenterX-Ghost_2.width*1,CenterY-Ghost_2.height/2);
g.drawImage(Ghost_3,CenterX+Ghost_3.width*1,CenterY-Ghost_3.height/2);
g.drawImage(Ghost_4,CenterX+Ghost_4.width*3,CenterY-Ghost_4.height/2);
g.flip();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment