Friday, August 19, 2016

Gui elements: The Switch

Creating a graphical user interface in Gimp

Part 5: The Switch

The switch is a lot like a button in that it can be used to turn something on, or off, but sometimes you need something that can tell you what state it is in with a quick glance.

Step 1:

After creating a new image with a transparent background, go to the rectangle selection tool.
Check Rounded corners, and set it to 16, which is half the height our switch will be.
Then of course set the Size to 72 width, and 32 height.

Step 2:

Click somewhere in the middle of the layer to make a selection.
It doesn't have to be perfectly centered, we'll fix that with a crop later.

Step 3:

Grab the bucket fill tool, and fill it with Aluminium 2 from the Tango Palette.
Then release the selection. Right click> Select >None.

Step 4:

Right click> Layer> Autocrop layer
We'll center it in the next step.

Step 5:

Now let's use the Alignment Tool for a couple steps.
First make sure the layer is selected, then choose the tool, then click on the part we want to center.
When its elected by the tool it will have four little squares on all four sides of the layer.
Now go back to the tools options, and click the top middle button with the arrows pointing at each other called: Align center of target. That will center it horizontally, and the button underneath that called: Align middle of target, will center it vertically.

Step 6:

Create a new transparent layer, and select it.
Then grab the Circle Selection Tool once again.

Step 7:

This time we just set the selection size to 32 width, and 32 height.

Step 8:

Click on the new layer to create the selection. Somewhere close to the left side of the texture in the first layer. Then fill it with Aluminium 6.

Step 9:

Next we Autocrop that new layer to get ready to align it to the bottom layer.

Step 10:

Select the bottom layer in the layers dialog.

Step 11:

Go to the Align tool, change it from Relative to: First item, to Active layer.

Step 12:

With the Align tool click on the image, directly on the filled circle to get it rather than the bottom layer selected by the tool.

Step 13:

Now go back to the Align Tool, and click the top left side button that looks like an arrow pointing left. The one called: Align left edge of target, and click it.
That will move it to the left most border of the active layer.
Then click the Align middle of target button to center it vertically.

Step 14:

Finally merge the two layers together, and Autocrop once more, and export to png.

No comments:

Post a Comment