To use the node in your project you should have the yzheka-m/nokia-5510-display 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 {int x,y,width,height,radius;bool fill,black,set=false;};{{ GENERATED_CODE }}voidevaluate(Context ctx){auto display = getValue<input_DISPLAY>(ctx);auto point = getValue<input_POSITION>(ctx);auto state =getState(ctx);if(state->set){if(state->fill)display->fillRoundRect(state->x,state->y,state->width,state->height,state->radius,state->black?WHITE:BLACK);else display->drawRoundRect(state->x,state->y,state->width,state->height,state->radius,state->black?WHITE:BLACK);}
state->x=point->x; state->y=point->y;
state->width=getValue<input_WIDTH>(ctx);
state->height=getValue<input_HEIGHT>(ctx);
state->radius=getValue<input_CORNERS>(ctx);
state->fill=getValue<input_FILL>(ctx);
state->black=getValue<input_BLACK>(ctx);
state->set=true;if(state->fill)display->fillRoundRect(state->x,state->y,state->width,state->height,state->radius,state->black?BLACK:WHITE);else display->drawRoundRect(state->x,state->y,state->width,state->height,state->radius,state->black?BLACK:WHITE);
display->display();
emitValue<output_DONE>(ctx,1);}