Jump to content

Dreikblack

Members
  • Posts

    516
  • Joined

  • Last visited

Everything posted by Dreikblack

  1. Primary 2k 125 scale, second 1080p 100% scale. On my second screen.
  2. Strange, now it's working Maybe some of entities was causing an issue somehow
  3. In script extension.hook(event, extension) is no longer called with even EVENT_OPENSCENE after one of latest update. Also i don't see this event in C++ EventId enum
  4. Just in case, next update after last one (3h ago) or it was supposed to be fixed in latest beta? atm it's not working: #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("Callback"); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.2f, 0.1f, 0.1f, 1.0f); uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); btn = CreateButton("Btn", 20, 20, 100, 100, ui->root); btn2 = CreateButton("Btn", 20, 150, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, btn); auto color = Vec4(0.5, 0, 1, 0.5f); btn->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); ui->ProcessEvent(ev); if (ev.id == EVENT_WINDOWSIZE) { ui->SetSize(framebuffer->size); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); } } world->Update(); world->Render(framebuffer); } return 0; }
  5. Expect: 3, 4, 3.5 Result due scaling: 3, 8, 5.5 #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 mainP = CreatePivot(world); mainP->SetScale(5.0); mainP->SetPosition(3, 3, 3); auto childP = CreatePivot(world); childP->SetPosition(mainP->GetPosition()); childP->SetParent(mainP); childP->SetPosition(0, 1, 0.5); auto resPos = childP->GetPosition(true); Print(String(resPos.x) + String(", ") + String(resPos.y) + String(", ") + String(resPos.z)); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  6. Can be added option to ignore children aabb for GetEntitiesInArea?
  7. Well, then it's just light having bounds radius as their range? It's not what i expect when i do GetEntitiesInArea() and would prefer light bounds being a point when i do GetEntitiesInArea
  8. I'm able to do it with your prefab every time by changing Mover's Movement field value
  9. In Editor 1. Create Particle emitter 2. Add any component 3. Save as prefab. 4. Open and resave prefab 5. Open again - pivot/empty instead of particle emitter in prefab
  10. Life time for particles needed for 1-time effects like blood sprays, shots and explosion. With it would be possible to make such effects with fast enough particles that will not be over whole map. Also some kind of checkbox for 1-timed effects would be nice with a method to start burst on command.
  11. I did not know that it's works in this way, noticed Grid size only now. I need both 0.1 and 1.0 grid sizes, tried to achieve it with [ ] hotkeys
  12. https://cdn.discordapp.com/attachments/1175951843612954786/1300826347806920796/Editor_TXasCTU1rA.mp4?ex=67224071&is=6720eef1&hm=b5adb8352770f989777267d7a406674b68e1b5039360f7f77362bd10e711d44e&
  13. camera->AddPostEffect(LoadPostEffect("Effects/SSAO.fx"));
  14. 1. start map from 3rd person template 2. Add to SlidingDoor::Load(): name = "test"; 3. Doors are not opens by trigger anymore
  15. Gismo and Position from Transform tab does not move a tile GroundTile_city4_2.zip
  16. 1. Create brush 2. Move with gizmo from center somewhere 3. Change position in transform tab - brush moves itself to 0,0,0
  17. I'm not sure when it was changed, but now it's barely possible to pick entities like lights and pivots with a cursor.
  18. 1. Create brush. 2. Change color - color is still white
  19. Actually any changes in prefab seems to make same effect. Had it when just changed light properties.
  20. 1. Create box and light. 2. Attach light to box. 3. Save as prefab. 4. Open prefab, delete light and save prefab. 5. Reopen prefab - box gone too.
  21. Adding var just to json is enough. Maybe you changed it in another project than the one you looking at in the editor? What i did: 1. Added to json 2, Opened Editor, project and added component to brush
  22. Not sure if it's a bug or i'm doing something wrong, but even 2nd Mouse Up event of double click made before loading in event queue after map loading. Tried do FlushEvents, FlushMouse, FlushKeys before and after map load. To reproduce: 1. Debug mode to make loading longer, same issues in release mode persist. 2. Double click new game button to load map. 3. Press keys while loading. 4. Result after map load: If it's not possible to fix it then would be nice to have some event that will be up when map and gui are fully loaded so input events made while loading could be ignored in game code. Start map is from 3rd person template #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; shared_ptr<World> gameWorld; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Map> gameScene; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> loadingWorld; shared_ptr<Interface> loadingUi; shared_ptr<Camera> loadingCamera; shared_ptr<Widget> loadingLabel; shared_ptr<Widget> menuPanel; bool isMainMenuOn = true; bool newGameButtonCallback(const Event& ev, shared_ptr<Object> extra) { ui = nullptr; world = nullptr; loadingWorld->Render(framebuffer); WString mapName = "Maps/start.ultra"; FlushEvents(); window->FlushMouse(); window->FlushKeys(); gameScene = LoadMap(gameWorld, mapName); FlushEvents(); window->FlushMouse(); window->FlushKeys(); Print("Map loaded"); gameWorld->Render(framebuffer); isMainMenuOn = false; return true; } bool exitButtonCallback(const Event& ev, shared_ptr<Object> extra) { exit(0); return true; } void loadingInit() { loadingWorld = CreateWorld(); //Loading UI auto font = LoadFont("Fonts/arial.ttf"); loadingUi = CreateInterface(loadingWorld, font, framebuffer->GetSize()); loadingUi->SetScale(1); loadingUi->SetRenderLayers(2); loadingUi->LoadColorScheme("Resources/configs/Style.json"); //Label LOADING... int centerX = float(framebuffer->GetSize().x) * 0.5f; int centerY = float(framebuffer->GetSize().y) * 0.5f; float labelHeight = float(framebuffer->GetSize().y) * 0.2f; loadingLabel = CreateLabel("LOADING", float(framebuffer->GetSize().x) * 0.05f, centerY - labelHeight * 0.5f, float(framebuffer->GetSize().x) * 0.95f, labelHeight, loadingUi->root, LABEL_CENTER | LABEL_MIDDLE); loadingLabel->SetFontScale(20); //Create ui camera loadingCamera = CreateCamera(loadingWorld, PROJECTION_ORTHOGRAPHIC); loadingCamera->SetPosition(centerX, centerY, 0); loadingCamera->SetRenderLayers(2); loadingCamera->SetClearMode(CLEAR_DEPTH); loadingCamera->SetLighting(false); loadingWorld->Render(framebuffer); } int main(int argc, const char* argv[]) { RegisterComponents(); //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a world world = CreateWorld(); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.2f, 0.2f, 0.2f, 1.0f); ui->LoadColorScheme("Resources/configs/Style.json"); //Create ui camera auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition(float(framebuffer->GetSize().x) * 0.5f, float(framebuffer->GetSize().y) * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); auto newGameButton = CreateButton("New game", 200, 125, 200, 50, ui->root); ListenEvent(EVENT_DOUBLECLICK, newGameButton, newGameButtonCallback); auto exitButton = CreateButton("Exit", 200, 200, 200, 50, ui->root); ListenEvent(EVENT_WIDGETACTION, exitButton, exitButtonCallback); gameWorld = CreateWorld(); loadingInit(); shared_ptr<World> currentWorld = world; shared_ptr<Interface> currentUI = ui; while (window->Closed() == false || window->KeyHit(KEY_ESCAPE)) { if (!isMainMenuOn) currentWorld = gameWorld; while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { exit(0); break; } break; case EVENT_KEYDOWN: { Print("Key Down"); currentUI->ProcessEvent(ev); break; } case EVENT_MOUSEUP: Print("Mouse up"); default: currentUI->ProcessEvent(ev); break; } } currentWorld->Update(); currentWorld->Render(framebuffer); } return 0; }
  23. Yes, it can be used with bloom effect (for something like lamps, pressed buttons etc.)
  24. On beta after one of latest update fps is 5x lower now in the game, old builds have normal fps. Can't reproduce it in simple example yet
×
×
  • Create New...