-
Posts
664 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Dreikblack
-
Want to make little fan game to have code foundation (GUI, gameplay base, etc.) for next games and ready Quake assets for Quake theme game will save my time a lot at this stage.
-
Thanks! I did it and now it works for me.
-
I was interested in just Quake model plagin for now. I have a problem with it btw. I updated client and project but have no thumbnails and there is error when i'm trying to open model in editor:
-
Pixmap seems to ignores alpha chanal at all: drawCircle(pixmap, 50, 50, 25, Rgba(100, 50, 150, 255)); drawCircle(pixmap, 50, 50, 30, Rgba(100, 50, 150, 0)); drawCircle(pixmap, 50, 50, 35, Rgba(100, 50, 150, 133)); btw slider has issue in fisrt and last position. Also i wonder how triangles button are made, no problem with their background. No source here: here https://github.com/Leadwerks/UltraEngine/tree/main/Source/Classes/GUI Same 3 circles with no 3D World behind UI for comparison:
-
In full 2D works fine but in 3D it's a black background in Pixmap area where should be transparent pixels. Probably Vulkan things this time too? Just want to be sure if it will be fixed later in Ultra or i'm missing something. #include "UltraEngine.h" using namespace UltraEngine; void drawPixel(shared_ptr<Pixmap> pixmap, const int x, const int y, unsigned int color) { if (pixmap && x >= 0 && x < pixmap->size.width && y >= 0 && y < pixmap->size.height) { pixmap->WritePixel(x, y, color); } } void drawCircle(shared_ptr<Pixmap> pixmap, const int centerX, const int centerY, const int radius, unsigned int color) { int x = 0; int y = radius; int delta = 1 - 2 * radius; int error = 0; while (y >= 0) { drawPixel(pixmap, centerX + x, centerY + y, color); drawPixel(pixmap, centerX + x, centerY - y, color); drawPixel(pixmap, centerX - x, centerY + y, color); drawPixel(pixmap, centerX - x, centerY - y, color); error = 2 * (delta + y) - 1; if (delta < 0 && error <= 0) { ++x; delta += 2 * x + 1; continue; } error = 2 * (delta - x) - 1; if (delta > 0 && error > 0) { --y; delta += 1 - 2 * y; continue; } ++x; delta += 2 * (x - y); --y; } } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); auto panel = CreatePanel(0, 0, 200, 200, ui->root); auto pixmap = UltraEngine::CreatePixmap(100, 100); drawCircle(pixmap, 50, 50, 25, Rgba(100, 50, 150, 255)); panel->SetPixmap(pixmap); panel->SetColor(0.1f, 0.15f, 0.1f, 1); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { auto ev = WaitEvent(); ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; }
-
@dugrosettehttps://www.leadwerks.com/learn - Leadwerks documentation
-
Works as intended in full 2D but if UI over 3D a text is not centerd vertically. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); auto button = CreateButton("Button", 10, 10, 120, 30, ui->root); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { auto ev = WaitEvent(); ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; } Same even if i'm using in custom widget textAlignment = TEXT_CENTER | TEXT_MIDDLE but text higher than center. Probably i'm missing something and cameras or something else should be configured differently in code.
-
Probably he was talking about https://www.ultraengine.com/learn/CreateInterface?lang=cpp Should 2nd example looks like that? https://www.ultraengine.com/learn/CreateCamera?lang=cpp says there should be 2 cameras for scene and UI but i still having same pic with this code: #include "UltraEngine.h" #include "Components/CameraControls.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); world->SetAmbientLight(0); auto framebuffer = CreateFramebuffer(window); auto plg = LoadPlugin("Plugins/FITextureLoader"); auto model = LoadModel(world, "https://github.com/UltraEngine/Documentation/raw/master/Assets/Models/Characters/cyber_samurai.glb"); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 1.4, -1); camera->SetFov(70); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/FXAA.json")); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetArea(15, 15); light->SetRotation(45, 35, 0); light->SetColor(1.2); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface auto ui = CreateInterface(world, font, framebuffer->GetSize()); //Create widget iVec2 sz = ui->root->ClientSize(); auto button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui->root); //Create camera auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition(float(framebuffer->GetSize().x) * 0.5f, float(framebuffer->GetSize().y) * 0.5f, 0); while (true) { while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; default: ui->ProcessEvent(ev); break; } } world->Update(); world->Render(framebuffer); } return 0; } Some simple example with 3D scene and 2D UI above would help me a lot. UPDATE: i fixed my problem with ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); Apparently it was just a background that covered 3D scene.
-
Ultra Editor missing Quake Model Loader plugin and idk how to properly build it from: https://github.com/UltraEngine/PluginSDK/tree/master/Plugins/Quake Model Loader I tried to open Quake Model Loader project and build solution but can't due errors: I can fix few incudes but still missing GMFSDK at least.
-
Package plugins and Quake files now supported
Dreikblack commented on Josh's blog entry in Development Blog
Does Ultra supports Quake 1 model animation btw? -
Slipgate Tactics is turn based tactics game about Slipgate marines squad in Quake 1 settings. Demo can be downloaded here: https://dreikblack.itch.io/slipgate-tactics Features: No randomness for actions Dedicated Movement Points for flanking or dodging damage from a front 4 Action Points can be used for few actions, blocking damage or as Movement Points Gibbing enemies gives Will Points which can be used for extra Action Points Special actions for all weapons like nailing an enemy to the floor Pushing enemy to an obstacles to do extra damage Relatively low health and armor values Enemies do their turn simultaneously Marines also can move simultaneously Couple tricky secrets to find on the main demo level Demo level is not canon and shows how Quake 1 looks like in another genre. Made with Ultra Engine. Quake model animations are not supported yet by the engine so Marines are always looking holding axes in their hands for now Turn based tactics in Quake 1 settings. ORIGINAL POST: Quake Tactics (early 2D prototype). Made this with Ultra App Kit. Will swtich to Ultra Engine as soon as it will be possible for me to buy the subscription. Quake Tactics is my fan uncommercial game about Slipgate marines squad before Quake 1 events. In terms of gameplay my goal is to make something between such games as Into the Breach and XCOM.
-
Automatically apply new text field styles
Dreikblack replied to TheHellTower's topic in Suggestion Box
Just redraw() did not worked for me either. "textfield->SetText(textfield->GetText());" with redraw made a field to change text style. Other style, TEXTFIELD_READONLY, works with no calling a redraw or changes of text. Style is just an int basically. In Draw() method Widget checks which one is applied and changes accordingly to it. You can see how some of widgets works here - https://github.com/Leadwerks/UltraEngine/tree/main/Source/Classes/GUI -
Automatically apply new text field styles
Dreikblack replied to TheHellTower's topic in Suggestion Box
If style will be protected you can make a child widget with a method to change style for such cases -
Automatically apply new text field styles
Dreikblack replied to TheHellTower's topic in Suggestion Box
I made it work by this way 😁 if (ev.source == checkbox) { if (checkbox->GetState() == WIDGETSTATE_SELECTED) { textfield->style = TEXTFIELD_PASSWORD; } else { textfield->style = TEXTFIELD_DEFAULT; } textfield->SetText(textfield->GetText()); textfield->Redraw(); } -
Also you can draw basically anything with Pixmap and WritePixel method https://www.ultraengine.com/learn/Pixmap_WritePixel?lang=cpp For example this is how i draw a circle for my custom widget in Ultra App Kit: void drawCircle(shared_ptr<Pixmap> pixmap, const int centerX, const int centerY, const int radius, unsigned int color) { int x = 0; int y = radius; int delta = 1 - 2 * radius; int error = 0; while (y >= 0) { drawPixel(pixmap, centerX + x, centerY + y, color); drawPixel(pixmap, centerX + x, centerY - y, color); drawPixel(pixmap, centerX - x, centerY + y, color); drawPixel(pixmap, centerX - x, centerY - y, color); error = 2 * (delta + y) - 1; if (delta < 0 && error <= 0) { ++x; delta += 2 * x + 1; continue; } error = 2 * (delta - x) - 1; if (delta > 0 && error > 0) { --y; delta += 1 - 2 * y; continue; } ++x; delta += 2 * (x - y); --y; } }
-
You can compile some examples from there like this one https://www.ultraengine.com/learn/CreateTerrain?lang=cpp I don't think there are demos like a game templates atm if you meant that.
-
https://www.ultraengine.com/learn
-
If i understand correctly your case and how mouse/keys events works a callbacks triggers only for upper UI element under mouse cursor. In UAK i solved it for my custom widgets by calling parent event methods void InnerContainer::MouseEnter(const int x, const int y) { GetParent()->MouseEnter(x, y); }
-
Thanks! Not sure if i prefer annual subscription due a bit more than 8$ per month in compare with monthly one tho 😅(i guess current annual pricing meant for 10$/month that will be later at some point). Sorry for bothering that much. When i found out Ultra Engine is close to launch, i started working on game prototype in UAK and was not sure should i focus on it like proper 2D game (turn based, so should be possible to make with just GUI) or spend less time on things that will be barely useful in proper 3D game engine.
-
Any updates about my case?
-
Cell.h: #pragma once #include "UltraEngine.h" #include "Table.h" using namespace UltraEngine; class Cell : public TextField { protected: Cell(); public: static std::shared_ptr<Cell> create(const int x, const int y, const int width, const int height, shared_ptr<Table> table, bool isHeader = false); void MouseEnter(const int x, const int y); void MouseLeave(const int x, const int y); Vec4 highlightColor = Vec4(0.3f, 0.3f, 0.3f, 1.0f); Vec4 backgroundColor = Vec4(0.15f, 0.15f, 0.15f, 1.0f); }; Cell.cpp: #include "UltraEngine.h" #include "Cell.h" Cell::Cell() { } std::shared_ptr<Cell> Cell::create(const int x, const int y, const int width, const int height, shared_ptr<Table> table, bool isHeader) { struct Struct : public Cell { }; auto instance = std::make_shared<Struct>(); instance->As<Widget>()->Initialize("", x, y, width, height, table, TEXTFIELD_DEFAULT); if (isHeader) { instance->backgroundColor = Vec4(0.2f, 0.2f, 0.2f, 1.0f); instance->highlightColor = Vec4(0.35f, 0.35f, 0.35f, 1.0f); instance->SetColor(instance->backgroundColor, WIDGETCOLOR_SUNKEN); } return instance; } void Cell::MouseEnter(const int x, const int y) { TextField::MouseEnter(x, y); SetColor(highlightColor, WIDGETCOLOR_SUNKEN); } void Cell::MouseLeave(const int x, const int y) { TextField::MouseEnter(x, y); SetColor(backgroundColor, WIDGETCOLOR_SUNKEN); } Table.h #pragma once #include "UltraEngine.h" class Cell; using namespace UltraEngine; class Table : public Panel { protected: Table(); public: int rowCount = 0; int columnCount = 0; vector<std::shared_ptr<Cell>> headers; static std::shared_ptr<Table> create(const int x, const int y, const int width, const int height, int columnCount, int rowCount, shared_ptr<Widget> parent); vector<vector<std::shared_ptr<Cell>>> cells; }; Table.cpp #include "UltraEngine.h" #include "Table.h" #include "Cell.h" using namespace UltraEngine; Table::Table() { } std::shared_ptr<Table> Table::create(const int x, const int y, const int width, const int height, int columnCount, int rowCount, shared_ptr<Widget> parent) { struct Struct : public Table { }; auto instance = std::make_shared<Struct>(); instance->Initialize("", x, y, width, height, parent, UltraEngine::PanelStyle::PANEL_DEFAULT); instance->SetColor(0, 0, 0, 0); instance->columnCount = columnCount; instance->rowCount = rowCount; int cellWidth = Floor (float(width) / float(columnCount)); int cellHeight = Floor(float(height) / float(rowCount + 1)); instance->cells.resize(columnCount); instance->headers.resize(columnCount); for (int i = 0; i < columnCount; i++) { instance->cells[i].resize(rowCount); instance->headers[i] = Cell::create(cellWidth * i, 0, cellWidth, cellHeight, instance, true); instance->headers[i]->SetText(WString("Header ") + WString(i)); } for (int i = 0; i < columnCount; i++) { for (int j = 0; j < rowCount; j++) { instance->cells[i][j] = (Cell::create(cellWidth * i, cellHeight * (j+1) , cellWidth, cellHeight, instance)); instance->cells[i][j]->SetText(WString("Cell ") + WString(i) + WString(',') + WString(j)); } } return instance; } main.cpp #include "UltraEngine.h" #include "UI/Table.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_CENTER); auto ui = CreateInterface(window); Table::create(0, 0, 500, 500, 3, 7, ui->root); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_QUIT: case EVENT_WINDOWCLOSE: return 0; break; default: break; } } return 0; }
-
Hi! I may try to create own Table class on the weekend.
-
I may only hope it is. Epic Games Store still allows to buy games in my region via Xsolla.
-
Never tried crypto but i will look into it. Should i use Binance for it or something else?
-
I wish i could buy it rn but still have to wait for avaiable for me a payment method like Xsolla 😐