I want to extend the Graphics class and be able to use the same "method" names, but extend them. I'd like to do this by creating my own Graphics2 class that inherits from Graphics.
Problem: How do I create a new Object derived from Graphics2 that's connected to the hardware display, like the built-in LCD object?
This is the code I found in the source that I'm pretty sure is setting up the LCD var:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I want to extend the Graphics class and be able to use the same "method" names, but extend them. I'd like to do this by creating my own Graphics2 class that inherits from Graphics.
Problem: How do I create a new Object derived from Graphics2 that's connected to the hardware display, like the built-in LCD object?
This is the code I found in the source that I'm pretty sure is setting up the LCD var:
Pretty straightforward -- if I was coding in C!
Is there a way to accomplish the same thing in the Javascript interpreter with standard Espruino interfaces/classes, that would be great!