• If I grok what you're suggesting, it won't work because Graphics is native code. There is no Javascript access to the prototype object and its properties (in particular, all the functions like fillRect, for example).

    So, I CAN'T do something like:

    LCD.oldProto = Graphics.prototype;
    Graphics.prototype.fillRect = function() {
      if (arguments.length > 4) this.setColor(arguments.slice[-1]);
       this.oldProto.fillRect.apply(this,argumeĀ­nts.slice(0,4)); <== this fails -- oldProto is undefined

    What does work is creating a new "method" with a different name (fillRect2), which works fine since there's no name collision. However, I then have to deliberately code with that name, which makes the code dependent on having my extensions to Graphics loaded.

    It's not really a big deal... I'm not working on this for a particular project ATM. Rather, I'm working on developing that GUI module for use on the MiniSTM32 with 3.2" display and touchscreen. Developing this mostly out of interest and fun, plan to share with community and use in the future some time.

    I don't have a "real" project for that hardware right now -- just playing.


Avatar for dwallersv @dwallersv started