Atoms-BoxComponent
Share
Kotaro will create components using atomic design.
There are several components for Atoms and Molecules. You can create all the components yourself, from Atoms to Pages. You can also use SDL2 to directly control the drawing of objects.
Unlike CSS, which uses static styles, you can change the style dynamically because you specify how to draw an object after determining its parameters.
In KotaroTest, parameters are determined by SliderComponent and TestComponent is drawn, which enables comprehensive testing of graphical Components.
After introducing the standard components, we will provide a tutorial that explains how to create and render components.
First, let's introduce BoxComponent, which determines the layout of components.
BoxComponent has nine different layout options, from top left to bottom right.
The remaining parameters are width, height, and background color. This is a useful Atom component for creating page layouts. You can arrange your application by setting its child elements.
RectComponent does not specify one of the nine types of placement, but instead directly specifies the margin of the parent element to place it. We will explain each component in turn from next time onwards.