Molecules - ClickImageComponent

Admin私のストア

This article explains Molecules' ClickImageComponent.

ClickImageComponent is a combination of BoxImageComponent and ClickComponent.

ClickComponent has a std::function<void()> as an argument and registers the argument to the event handler. The registered function is executed when a click event occurs. The BoxSelectComponent explained earlier uses this ClickComponent to open and close the options and set the values.

The arguments are the position, width, height, and background color of the BoxComponent, and the image name of the ImageComponent. The argument of the ClickComponent is a function closure, and you can pass a function that increments the Count by one each time a click occurs to check the behavior when a click event occurs.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.