How to use my own classes with TGFX Design Studio
Hi!
I use a lot of rounded coloured boxes for my implementation and I was looking at writing custom classes to handle this. EG: My own circle class with a built in painter to remove the confusing use of the painter. Can I add this to TGFX Design Studio so that when I generate my files, it will generate with my own circle?
#ifndef MYCIRCLE_HPP
#define MYCIRCLE_HPP
#include <touchgfx/widgets/canvas/Circle.hpp>
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
namespace mygfx {
class Circle : public touchgfx::Circle {
public:
Circle()
{
setPainter(_painter);
}
explicit Circle(touchgfx::colortype initColour)
{
_painter.setColor(initColour);
setPainter(_painter);
}
void setColor(touchgfx::colortype colour)
{
_painter.setColor(colour);
}
touchgfx::colortype getColor() const
{
return _painter.getColor();
}
private:
touchgfx::PainterRGB565 _painter;
};
}
#endif //MYCIRCLE_HPPThe end goal is to make a box with rounded border that implements this custom class for a less polluted member access (Instead of accessing all assets when I need to change colour, I would just update the box). The issue is when we generate a change from the software, I want it to use my "cleaned up" classes.
Is this possible?
TIA :)