Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MaddyOff/ue4-canvas-gui
It's a simple Canvas GUI for Unreal Engine 4 with mouse operation
https://github.com/MaddyOff/ue4-canvas-gui
Last synced: about 1 month ago
JSON representation
It's a simple Canvas GUI for Unreal Engine 4 with mouse operation
- Host: GitHub
- URL: https://github.com/MaddyOff/ue4-canvas-gui
- Owner: MaddyOff
- Created: 2021-04-15T06:47:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-15T08:25:32.000Z (over 3 years ago)
- Last Synced: 2024-08-02T16:31:27.114Z (4 months ago)
- Language: C++
- Homepage:
- Size: 1.22 MB
- Stars: 121
- Watchers: 3
- Forks: 28
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-unreal - ue4-canvas-gui - It's a simple Canvas GUI for Unreal Engine 4 with mouse operation (UI)
README
# ue4-canvas-gui
## It's a simple Canvas GUI for Unreal Engine 4 with mouse operation.
Included elements:
Rendering Text (left/center);
Rendering Rects;
Rendering Circles (filled and not);
Button, Slider, Checkbox, Combobox, Hotkeys and ColorPicker.
Implemented a simple post-render system to draw on top of menu and all.
## Screenshots with default style:
![EU4 GUI](screenshots/canvas1.jpg "")
![EU4 GUI](screenshots/canvas2.jpg "")
![EU4 GUI](screenshots/canvas3.jpg "")
Ingame render
![EU4 GUI](screenshots/canvas4.jpg "")## Small "How to use" guide:
First you need get **UCanvas** from game.
After it you can draw like this:```cpp
//I'll show you with an example Post Render Hook
void PostRenderHook(UGameViewportClient* viewport, UCanvas* canvas)
{
ZeroGUI::SetupCanvas(canvas);
Menu::Tick();
}//Menu.h
void Tick()
{
ZeroGUI::Input::Handle();
static bool menu_opened = false;
if (GetAsyncKeyState(VK_F2) & 1) menu_opened = !menu_opened; //Our menu keyif (ZeroGUI::Window("Superior UE4 GUI", &pos, FVector2D{ 500.0f, 400.0f }, menu_opened))
{
//Simple Tabs
static int tab = 0;
if (ZeroGUI::ButtonTab("Tab 1", FVector2D{ 110, 25 }, tab == 0)) tab = 0;
if (ZeroGUI::ButtonTab("Tab 2", FVector2D{ 110, 25 }, tab == 1)) tab = 1;
if (ZeroGUI::ButtonTab("Tab 3", FVector2D{ 110, 25 }, tab == 2)) tab = 2;
if (ZeroGUI::ButtonTab("Tab 4", FVector2D{ 110, 25 }, tab == 3)) tab = 3;
ZeroGUI::NextColumn(130.0f);
//
//Some Elements
static bool text_check = false;
static float text_slider = 15.0f;
static int test_hotkey = 0x2;
static FLinearColor test_color{ 0.0f, 0.0f, 1.0f, 1.0f };ZeroGUI::Checkbox("Test Checkbox", &text_check);
ZeroGUI::SliderFloat("Test Slider", &text_slider, 0.0f, 180.0f);
ZeroGUI::Hotkey("Test Hotkey", FVector2D{ 80, 25 }, &test_hotkey);ZeroGUI::Text("Left aligned text!");
ZeroGUI::Text("Outline and Center aligned text!", true, true);//Element with padding
ZeroGUI::PushNextElementY(50.0f);
ZeroGUI::Combobox("Combobox", FVector2D{ 100, 25 }, &test_number, "None", "First", "Second", "Third", NULL); //NULL at end is required!
ZeroGUI::SameLine();//inline items
if (ZeroGUI::Button("It's a Button!", FVector2D{ 100, 25 })) { /*clicked!*/ }//Color Picker
ZeroGUI::ColorPicker("Color Picker", &test_color);
}
ZeroGUI::Render();//Custom Render. I use it for drawing Combobox and ColorPicker over the menu
ZeroGUI::Draw_Cursor(menu_opened);
}
```