KF2-BoxPainterLib/README.md

51 lines
2.6 KiB
Markdown
Raw Normal View History

2023-01-29 22:10:40 +00:00
# KF2-BoxPainterLib
2023-01-30 00:14:01 +00:00
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-BoxPainterLib)](https://github.com/GenZmeY/KF2-BoxPainterLib/tags)
[![GitHub top language](https://img.shields.io/github/languages/top/GenZmeY/KF2-BoxPainterLib)](https://docs.unrealengine.com/udk/Three/WebHome.html)
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-BoxPainterLib)](LICENSE)
**2D box drawing library**
2023-05-10 01:42:07 +00:00
## Add to your project
2023-01-30 00:14:01 +00:00
There are two ways to add BoxPainterLib to your project:
### 1. As [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
Open git-bash and go to your project: `cd <your_project_path>`
Add submodule: `git submodule add https://github.com/GenZmeY/KF2-BoxPainterLib BoxPainterLib`
**updating library:**
Get updates: `pushd BoxPainterLib && git pull && popd`
Commit the changes: `git add BoxPainterLib && git commit -m 'update box painter lib'`
### 2. As standalone sources
Create a `BoxPainterLib` folder and put [this repo](https://github.com/GenZmeY/KF2-BoxPainterLib) there.
2023-05-10 01:42:07 +00:00
## Using
2023-01-30 00:14:01 +00:00
1. Create `BoxPainter` object: `BoxPainter = new class'BoxPainterLib.BoxPainter';`
2. Initialize the canvas: `BoxPainter.Canvas = <REPLACE_THIS_WITH_YOUR_CANVAS_OBJECT>;`
3. `BoxPainter` is ready! Use functions [DrawBox(...)](https://github.com/GenZmeY/KF2-BoxPainterLib/blob/master/Classes/BoxPainter.uc#L3) and [DrawShapedBox(...)](https://github.com/GenZmeY/KF2-BoxPainterLib/blob/master/Classes/BoxPainterBase.uc#L129) to draw cool interface boxes.
2023-05-10 01:42:07 +00:00
## Available Functions
### DrawShapedBox(float X, float Y, float W, float H, float Edge, byte TopLeftShape, byte TopRightShape, byte BottomLeftShape, byte BottomRightShape)
2023-01-30 00:14:01 +00:00
Draws a box using the [shape code](https://github.com/GenZmeY/KF2-BoxPainterLib/blob/master/Classes/BoxPainterBase.uc#L13) for each corner:
- ECS_Corner
- ECS_BeveledCorner
- ECS_VerticalCorner
- ECS_HorisontalCorner
2023-05-10 01:42:07 +00:00
### DrawBox(float X, float Y, float Width, float Height, float Edge, optional byte Shape = 0)
2023-01-30 00:14:01 +00:00
Draws a box using the shape code:
2023-05-10 01:42:07 +00:00
![codes_table](rect_shapes.png)
2023-01-30 00:14:01 +00:00
2023-05-10 01:42:07 +00:00
## Build
2023-01-30 00:14:01 +00:00
If you are using [KF2-BuildTools](https://github.com/GenZmeY/KF2-BuildTools) open `builder.cfg` and add `BoxPainterLib` **first** in `PackageBuildOrder` and `PackageUpload` parameters
If you are building manually add line `ModPackages=BoxPainterLib` to your `KFEditor.ini` before all other `ModPackages`
Now build the mod. `BoxPainterLib.u` library will be next to your `*.u` files
2023-05-10 01:42:07 +00:00
## Examples
2023-05-01 16:47:17 +00:00
[KF2-YetAnotherScoreboard](https://github.com/GenZmeY/KF2-YetAnotherScoreboard)
2023-01-30 00:57:28 +00:00
2023-05-10 01:42:07 +00:00
## License
[![license](https://www.gnu.org/graphics/lgplv3-with-text-154x68.png)](LICENSE)