Panel paint routine...sharing one.
-
So I have a lot of panels that have very slight customisations, so I'd like to share a single paint routine amongst all of them but I cant work out how to do this and still have access to stuff like this.getLocalBounds etc.
any ideas?
-
@Lindon I made a video about this. I'm not at my computer at the moment but take a look at the paint routines playlist on my channel
-
@d-healey said in Panel paint routine...sharing one.:
@Lindon I made a video about this. I'm not at my computer at the moment but take a look at the paint routines playlist on my channel
okay thanks will do...
-
@d-healey ..nearly...
I want to be able to parse thru Content.getAllComponents("") looking for panels and assign them the same paint routine.. but for some reason I cant get it to work...
-
@Lindon ah I do something like that here https://codeberg.org/LibreWave/RhapsodyBoilerplate/src/branch/main/includes/Card.js#L23
-
@d-healey thanks, you mean this?
x.setPaintRoutine(function(g) {cardPaintRoutine(g);});
-
..if so then no as I cant access localBounds etc.
LAF.js (1472): Unknown function 'getLocalBounds
-
so nearly there... its more like:
XYPathNamePanel.setPaintRoutine(function(g){panelPainter(g, this);});