Jump to content

Josh

Staff
  • Posts

    23,507
  • Joined

  • Last visited

Community Answers

  1. Josh's post in How to show FPS in game and how to increase the distance for shadow shading? was marked as the answer   
    In the default main.lua script there is some code that shows stats and FPS.
    --Render statistics context:SetBlendMode(Blend.Alpha) if DEBUG then context:SetColor(1,0,0,1) context:DrawText("Debug Mode",2,2) context:SetColor(1,1,1,1) context:DrawStats(2,22) context:SetBlendMode(Blend.Solid) else --Toggle statistics on and off if (window:KeyHit(Key.F11)) then showstats = not showstats end if showstats then context:SetColor(1,1,1,1) context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2) end end I usually use a third-party tool like FRAPS because it ensures consistency across all programs.
  2. Josh's post in CreateMeshCollider() with no arguments? was marked as the answer   
    Oh yeah, I changed the way this works. After creating the collider, call Collider::AddFace for each polygon / face. When you are done adding faces, call Collider::Finalize().
    This gives you control over the exact number of vertices per face, and the finalize method also exposes the Newton optimize feature, which will attempt to merge adjacent coplanar faces.
  3. Josh's post in event.id == Event.WidgetSelect ?? GUI Leadwerks. was marked as the answer   
    It's for comboboxes, listboxes, and treeviews. event.data is the item, or event.extra is the treeview node.
  4. Josh's post in How to solve circular dependencies in compoents? was marked as the answer   
    A forward declaration should work, as long as you are creating the object as a pointer or shared pointer:
    class MyThing;
     
  5. Josh's post in Can't load sounds from quake archive. was marked as the answer   
  6. Josh's post in How are custom fonts loaded? was marked as the answer   
    Custom fonts on Windowed interfaces are currently not supported, but you can adjust the text scale and weight on a per-widget basis,and it will be scaled relatively for different DPI settings. On windowed interfaces, the GUI will use the default system font.
    LoadFont is for use with 3D GUIs and sprites, and is only available in Ultra Engine:
    https://www.ultraengine.com/learn/LoadFont?lang=cpp
  7. Josh's post in Freeze Window on LoadModel was marked as the answer   
    There is currently no mechanism to remove a component. Maybe you just want to disable it?
  8. Josh's post in Component uses old members after was marked as the answer   
    It sounds like visual studio is hss as bing problems. I’ve been seeing a lot of weird stuff like this myself lately.
  9. Josh's post in CreateTerrain() casues exception was marked as the answer   
    Fixed!
  10. Josh's post in Widget's "gui" after last update (12th May) was marked as the answer   
    Widget::GetInterface(). Note this can return NULL if the interface object has gone out of scope.
  11. Josh's post in Vulkan crash after changing window resolution was marked as the answer   
    Fixed the fullscreen issue now.
  12. Josh's post in Exception when i'm trying to create ComboBox in "3D" UI was marked as the answer   
    The fix is incoming. Example for testing:
    #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 640, 480, displays[0]); // Create a world auto world = CreateWorld(); // Create a framebuffer auto framebuffer = CreateFramebuffer(window); //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); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); auto button = CreateButton("TEST", 20, 20, 400, 30, ui->background); //Create widget auto sz = ui->root->ClientSize(); auto combobox = CreateComboBox((sz.x - 300) / 2, (sz.y - 30) / 2 + 100, 300, 30, ui->root); for (int n = 0; n < 20; ++n) { combobox->AddItem("Item " + String(n), n == 0); } while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETSELECT: Print("Item " + String(ev.data) + " selected"); break; case EVENT_WINDOWCLOSE: return 0; break; default: ui->ProcessEvent(ev); break; } world->Update(); world->Render(framebuffer); } }  
  13. Josh's post in shadow question was marked as the answer   
    A directional light can consist of several shadow maps. Each shadow render is counted separtely.
  14. Josh's post in Text higher than should be was marked as the answer   
    There are some known drawing bugs when the GUI is used in a Vulkan framebuffer. I've been considering these relatively low-priority for now. They will get fixed, but not right away.
  15. Josh's post in How to build plugin for Ultra? was marked as the answer   
    The plugins system presently supports images and packages. The interface for model plugins needs a little more love, and in fact I plan to add Quake model loading into the Quake plugin as the first implementation.
  16. Josh's post in Color Console Output was marked as the answer   
    How about this?
    #include "UltraEngine.h" using namespace UltraEngine; bool PrintColorHook(const Event& e, shared_ptr<Object> extra) { //https://learn.microsoft.com/en-us/windows/console/getstdhandle#handle-disposal HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if (e.text.Left(8) == "Warning:") { SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY); } else if (e.text.Left(6) == "Error:") { SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_INTENSITY); } else { SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); } return true; } int main(int argc, const char* argv[]) { ListenEvent(EVENT_PRINT, NULL, PrintColorHook); Print("Here is a normal text message."); Print("Warning: Here is a warning."); Print("Here is a normal text message."); Print("Error: Here is an error."); Print("Here is a normal text message."); return 0; }  
  17. Josh's post in Why is small EXE icon shown? was marked as the answer   
    The secret is that the icon file must contain multiple "mipmaps". It's not enough for it to be a large icon.
    This program is the only way I know to create these:
    http://www.aha-soft.com/anytoicon/
  18. Josh's post in Editor not showing was marked as the answer   
    This was a bug in the way the window position was saved. I fixed this in the latest build.
  19. Josh's post in Wrong Window Dimensions with WINDOW_DEFAULT/WINDOW_CLIENTCOORDS was marked as the answer   
    Okay, I think I fixed. This is how it's supposed to appear, correct?

  20. Josh's post in Certificate invalid was marked as the answer   
    Fixed, sorry about that.
  21. Josh's post in UAK: Issues with the scrollbar was marked as the answer   
    I did a lot of work on sliders and I think they are 100% working in Ultra Engine 1.0.2.
  22. Josh's post in How to ensure .. was marked as the answer   
    I think the one-shot animation issue is something I only discovered in the Ultra code that carried over from Leadwerks. The best thing to do here is control the animation frame by setting it in each Update call. You can set the exact frame time of an animation with Entity::SetAnimationFrame
  23. Josh's post in MESH_POINTS with Geometry Shader was marked as the answer   
    Question: Do you have a matching depth pass shader you are using for the depth pre-pass? You can disable camera depth pre-pass to test this.
  24. Josh's post in Racing game template was marked as the answer   
    Yes, I hope so.
  25. Josh's post in WString.StartsWith() returns WString was marked as the answer   
    Will be fixed in the next build...
×
×
  • Create New...