Today I made my first rookie mistake.
It involved UI, and please note, I am completely new to Urho3D and its workflow.
I had some code that called UI::SetDefaultStyle for UI elements:
ui_->GetRoot()->SetDefaultStyle(cache->GetResource(“UI/DefaultStyle.xml”));
Later, I had some code to set up a splash screen, and based on public examples, I brainlessly had this:
UI* ui = GetSubsystem<UI>();
BorderImage* splashUI = new BorderImage(context_);
splashUI->SetName("Splash");
texture = cache->GetResource<Texture2D>("Textures/LogoLarge.png");
splashUI->SetTexture(texture); // Set texture
splashUI->SetSize(texture->GetWidth(), texture->GetHeight());
splashUI->SetAlignment(HA_CENTER, VA_CENTER);
ui->GetRoot()->AddChild(splashUI);
splashUI->SetStyleAuto(); // <-- here's the culprit
What this does?
It sets the Texture of my UI Element to be the one used by the built-in UI elements.
Even though I could check my loaded texture name, size, etc was the one I thought I loaded, I would see the UI atlas texture instead.
It overrides the texture you thought you set, for that element.
I’ve learned my first lesson - don’t brainlessly attempt to string together code from different places, have a look at what it actually does!
I’m glad it makes sense to you, but its not well documented. In fact, the documentation needs a dust-off in general, and is entirely missing in parts, such as physics, which I might consider adopting.
Often the samples provided with Urho’s source, or the engine’s code itself are most informative. Since Bullet is used for (3D) physics its documentation may be useful at times as well.
what is the point of the engine being capable, if there is no public point of presence to learn it, or at least associate it with what you may already know? we should (hell I am already using the queens language) make it accessible. The more accessible it is, the more people will use it.
its ok for us who already know bullet or box2d or any number of other core systems but if we cant explain our bindings, we’re just talking to ourselves
Lets say I DID know bullet, or box2d, and wanted to code in angelscript, which is I assume the preferred scripting language we support. Where can I learn about the bindings?