-
It's not the most elegant way, because i need to pass in the entire object because both constants and variables are required, but it works
function drawBottomLeftCorner(obj, x, y) { g.setColor(obj.C.color.primary.base); const x1 = x - obj.cornerOffset; const y1 = y + obj.cornerOffset; g.fillRect(x1, y1, x1 + obj.cornerSize, y1 - obj.cornerSize); g.setColor("#000000"); g.fillRect(x, y, x + obj.cornerSize - obj.cornerOffset, y - obj.cornerSize + obj.cornerOffset); }
-
-
I'm trying to write a module for shared code between my BangleJs Apps.
According to the tutorial, everything should be working at this Point.
I required the module with the GitHub URL to it and it downloads, but when i create the object that should have all public functions and constants, it only has the variables that were set in the constructor.
Am I doing something wrong or is the tutorial not working?
Here is the module: https://github.com/OmegaVoid/EspruinoDocs/blob/master/modules/dane_arwes.js
Would it be possible to use JavaScript classes in modules? Because then I could use actual private methods, and IMO that would be more elegant than using a constructor function with prototype methods and constants