tft-lcd-draw-box

bradzilla84/color-tft-lcd-driver-mcufriend-kbv/tft-lcd-draw-box

Draw a Box (Fill or No Fill)
tft-lcd-draw-box
@/tft-lcd-draw-box
Draw a Box (Fill or No Fill)
IN@/tft-lcd-device
PosXnumber
Position X Start
PosYnumber
Position Y Start
SizeXnumber
Size in pixels X
SizeYnumber
Size in pixels Y
FILLboolean
Do you want to fill the box?
Colorbradzilla84/color-rgb-hsl/rgb-color-pack
Color to Fill/Outline with
INITpulse
Pulse to update
tft-lcd-draw-box
IN
OUT
PosX
PosY
SizeX
SizeY
FILL
Color
INIT
OK
OKpulse
Pulse on Complete
OUT@/tft-lcd-device
To use the node in your project you should have the bradzilla84/color-tft-lcd-driver-mcufriend-kbv library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isInputDirty<input_INIT>(ctx)){
        emitValue<output_OUT>(ctx, getValue<input_IN>(ctx));
        return;}

    auto tft = getValue<input_IN>(ctx);
    auto color = getValue<input_Color>(ctx);


    if (getValue<input_FILL>(ctx)){
        tft->fillRect(getValue<input_PosX>(ctx),getValue<input_PosY>(ctx),getValue<input_SizeX>(ctx),getValue<input_SizeY>(ctx),color.Hex);
    }
    else
    {
        tft->drawRect(getValue<input_PosX>(ctx),getValue<input_PosY>(ctx),getValue<input_SizeX>(ctx),getValue<input_SizeY>(ctx),color.Hex);
    }

    emitValue<output_OUT>(ctx, getValue<input_IN>(ctx));
    emitValue<output_OK>(ctx, 1);
}