Hi, urhofriends.
I have other problem today
I don’t know why but I can’t load a font to a Text.
ResourceCache * cache2 = GetSubsystem<ResourceCache>();
SharedPtr<Text> helloText(new Text(context_));
helloText->SetFont(cache2->GetResource<Font>("Fonts/Anono.ttf"));
But i can load a XML
ResourceCache* cache = GetSubsystem<ResourceCache>();
XMLFile* xmlFile = cache->GetResource<XMLFile>("UI/DefaultStyle.xml");
The error in the compilation is:
[color=#FF0000]…/Urho3D-1.5/build_debug/include/Urho3D/Resource/ResourceCache.h: In instantiation of ?T* Urho3D::ResourceCache::GetResource(const Urho3D::String&, bool) [with T = Urho3D::Font]?:
Engine.cpp:53:67: required from here
…/Urho3D-1.5/build_debug/include/Urho3D/Resource/ResourceCache.h:263:40: error: incomplete type ?Urho3D::Font? used in nested name specifier
StringHash type = T::GetTypeStatic();
^
…/Urho3D-1.5/build_debug/include/Urho3D/Resource/ResourceCache.h:264:71: error: invalid static_cast from type ?Urho3D::Resource*? to type ?Urho3D::Font*?
return static_cast<T*>(GetResource(type, name, sendEventOnFailure));[/color]
In an old project I could use fonts, but not now. It’s a mistery
Thank you!