Closed xFlowe closed 5 years ago
Hi xFlowe, look the way that you pass the parameters is wrong. if you would use those value x: 0, y: 0 r:0, g:50, b: 255, text: 'text' and the font: '10x20.bdf. ==> matrix.drawText(x, y, text, font, r, g, b); matrix.update(); ==> matrix.drawText(0, 0, 'text', './10x20', 0, 50, 255); matrix.update(); I hope that this will help you :)
You're on the right track, you just need to provide a path to the font instead of a filename; which can be tricky especially when you don't even know how your library will be installed
the way we do it in our node-red module is like this:
const input = "hello world!"; //whever you get the input from
const font = __dirname + '/fonts/' + "5x8.bdf";
led.drawText(x, y, 255, 255, 255, input, font);
led.update();
we should probably make it easier to use the 'default' fonts in the future
After hours of trying
const font = __dirname + '/repo/node-rpi-rgb-led-matrix/external/matrix/fonts/' + "5x8.bdf";
led.drawText(32, 0, 'text', font, 255, 255, 255); led.update();
worked for me. Can you update the readme? led.drawText
has wrong params order
Hi, the drawText function is not working on my setup. RPI 3+, Adafruit HAT, Node 8.11
Let me know if i've made a code mistake:
matrix.drawText(0,0,0,50,255,'text','10x20.bdf'); matrix.update();
No error messages etc.
All other functions are working.
Regards, Flo