Examples of GUI element graphics, written and illustrated with pictures to better understand the algorithm for drawing an element in the user interface.
- This project is a community project, meaning it depends on community participation to a large extent
- This README.md file was written by dillinger and readme.so.
The main goal of this repository is to help understand:
- How to draw and paint every shape (especially in the graphical user interface) using libraries whose function is mainly graphics.
- Dealing with the window management library to link graphics to events (mouse, keyboard, joystick, system events, etc.)
- You can consider it as a challenge or training to improve your programming skills.
- Examples using different libraries or algorithm to implement the same operation
- Detailed explanation with pictures suitable for beginners and professionals as well
- Additional resources and external links for further information
We currently use two graphics libraries: skia(rust) and tiny-skia. In the future, examples will be developed for other libraries, but the algorithm will not differ much.
There are levels of difficulty (the expected difficulty of writing the required example in terms of knowing the appropriate algorithm):
It can be written once you know how to work with the graphical library.
In addition to the previous requirement, it requires skill, resourcefulness, and some mathematical knowledge to know how to reach the required algorithm.
-
Tiny-Skia
-
Rounded rectangle (Difficult)
-
Simple pie chart (Difficult)
-
Simple graph (Easy)
-
Circular ends pie chart (Difficult)
-
Animation/Animated shapes in winit window and softbuffer (Difficult)
-
Animation/Animated shapes in winit window and pixels (Difficult)
-
mouse hover on shape event in winit window and softbuffer (Difficult)
-
mouse hover on shape event in winit window and pixels (Difficult)
-
-
Skia
- Rounded rectangle (Difficult)
- Simple pie chart (Difficult)
- Simple graph (Easy)
- Circular ends pie chart (Difficult)
- Animation/Animated shapes in winit window and softbuffer (Difficult)
- Animation/Animated shapes in winit window and pixels (Difficult)
- mouse hover on shape event in winit window and softbuffer (Difficult)
- mouse hover on shape event in winit window and pixels (Difficult)
- You can suggest new goals or other libraries for graphics in the Issues section
- The level of difficulty is based on my personal scale and does not necessarily have to be actually easy or difficult. It varies between one person and another.
- Often the same algorithm can be used in a specific function with multiple libraries, meaning the code can be copied and used with another library, and the code can be changed as necessary to be compatible with the library.
- It is possible to write advanced algorithm/code that based on algorithm/code that already exists in this repository.
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct.