As mentioned in my last post 2023-07-13-dEngine-0 I’m going to be keeping up with a dev blog. I’m horrible out writing every day I work on it, but perhaps just establishing a regular cadence even if it’s not every time I do a little would be good. I would like to apologize for the lack of professionalism in these posts but this is in more of a diary format.

Since my last post I was able to get a simple UI system built with a few components. After getting it working, I wound up putting it in it’s own namespace to kind of break out the system from the rest, but after thinking on it last night I figured it may be even better to move it to a separate library, that way it can be completed left out if need be, but I’m cautious as that may add unnecessary complexity, but lets face it, putting it in a separate namespace probably has already done that.

Aside from this simple update I’ve also went through and updated a lot of the documentation. Oh! and I’m sure it’s not lost on anyone that does somewhat come to my site but I updated the theme! Now it’s a little darker! I took the inspiration for the color scheme from Twitter’s dark mode. But it just seemed like spending more than a few minutes here was starting to hurt my eyes, so I went ahead and changed it.

After work today I plan on getting more familiar with CMake since that’s what I’m using as dEngine’s build tool. Along with vcpkg package manager. Next I plan on updating the UI to allow us to choose what colors to render objects rather than just using whatever I put there.

I’m running into a dilemma with this though. I have started using two different methods of handling the UI components, and I really need to decide on a single method.

The first is to use SetVar and the second is to use Setup. The differences are displayed below:

SetVar

  healthBar = new ProgressBarH();
    healthBar->SetVar("ypos","0");
    healthBar->SetVar("xpos","0");
    healthBar->SetVar("completed","100");

Setup

    RoundedBox* roundedBox = new RoundedBox();
    roundedBox->Setup({0,200,150,30},0.5,2);

I really think the Setup method looks a lot nicer and is easier to maintain. As with the SetVar function behind the scenes we’re having to convert types. To show what I mean, in ProgressBarH.cpp this is being done:

    SDL_Rect rect;
    rect.y = std::stoi(GetVar("ypos"));
    rect.x = std::stoi(GetVar("xpos"))+(.2*std::stoi(GetVar("xpos")));
    rect.h = .2*h_ptr;
    rect.w = std::stoi(GetVar("xpos"))*.2;

And this can cause issues, BUT! If I choose to do it this way, I may need to figure out a way to update stuff inside the components but I don’t want to use Update() as we’re using that for other purposes throughout the engine.

I’ll put some more thought into it and figure something out probably later today. So I’ll get that figured out and put whatever change I ultimately land on, in place tonight. Once I get this done, I want to get back on fixing the animations, then adding in some pathfinding and building a very simple game. From there I can figure out what features need to be added through the game’s development.