Files
Linux.js---javascript-OS/rootfs overrides/usr/bin/framebuffer-demo.js
T
2022-02-08 13:35:49 +01:00

144 lines
3.3 KiB
JavaScript

//@ts-check
const graphics = require('../../chibrax/graphics')
const shapes = require('../lib/shapes')
const path = require('path')
graphics.clear()
drawChibrax()
const bitmap = shapes.createBitmap(400, 400)
const pencil = shapes.pencilFromBitmap(bitmap, [0,255, 0,255])
shapes.drawCircle(pencil, 200, 200, 190)
graphics.drawBitmap(0, 0, pencil)
graphics.flip()
function drawChibrax() {
//LA LETTRE C
for(let i = 0; i < 100; i++) {
for(let j = 0; j < 10; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 0; i < 20; i++) {
for(let j = 10; j < 110; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 0; i < 100; i++) {
for(let j = 110; j < 120; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
//LA LETTRE H
for(let i = 110; i < 130; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 110; i < 210; i++) {
for(let j = 50; j < 60; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 210; i < 230; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
//LA LETTRE I
for(let i = 240; i < 260; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
//LA LETTRE B
for(let i = 270; i < 280; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 380; i < 390; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 270; i < 390; i++) {
for(let j = 0; j < 10; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 270; i < 390; i++) {
for(let j = 50; j < 60; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 270; i < 390; i++) {
for(let j = 90; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
//LA LETTRE R
for(let i = 400; i < 410; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 510; i < 520; i++) {
for(let j = 0; j < 100; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 400; i < 520; i++) {
for(let j = 0; j < 10; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 400; i < 520; i++) {
for(let j = 50; j < 60; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
//LA LETTRE E
for(let i = 530; i < 630; i++) {
for(let j = 0; j < 10; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 530; i < 550; i++) {
for(let j = 10; j < 110; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 530; i < 630; i++) {
for(let j = 50; j < 60; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
for(let i = 530; i < 630; i++) {
for(let j = 110; j < 120; j++) {
graphics.setPixel(i,j, [0,0,255, 255])
}
}
}