Font appears completely black
Font appears completely black
I've created fonts using the advanced font tool, but the characters always appear completely black, regardless of what colors I use.
Any ideas what could be happening?
Any ideas what could be happening?
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
-
- Posts: 115
- Joined: Mon May 17, 2010 7:42 am
Font image (a PNG):
Code (MSVC 2010, Irrlicht 1.7.1 standard build):
Result:
Code (MSVC 2010, Irrlicht 1.7.1 standard build):
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace video;
using namespace scene;
using namespace gui;
#pragma comment(lib, "irrlicht.lib")
int main()
{
SIrrlichtCreationParameters cp;
cp.AntiAlias = 8;
cp.Bits = 32;
cp.DriverType = video::EDT_DIRECT3D9;
IrrlichtDevice* device = createDeviceEx(cp);
IVideoDriver* vd = device->getVideoDriver();
vd->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
ISceneManager* sm = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->getSkin()->setFont(guienv->getFont("displayfont.png"));
guienv->addStaticText(L"Woohoo!", rect<s32>(10, 10, 200, 100));
while(device->run())
{
vd->beginScene(true, true, SColor(255, 127, 127, 127));
guienv->drawAll();
vd->endScene();
}
return 0;
}
isn't there a xml file creates by the font tool you should load ???slavik262 wrote:Code: Select all
guienv->getSkin()->setFont(guienv->getFont("displayfont.png"));
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
Confirmed. It's happening with an XML font too (same code as above, substituting the png for the appropriate xml file). Plus to make sure it wasn't something I broke, I just did a fresh download of 1.7.1, and the same thing still happens.
Could this be some material thing? I have no idea why this is happening. It's not like I have weird setup either (GTX 260, Windows 7 32-bit, latest drivers).
Could this be some material thing? I have no idea why this is happening. It's not like I have weird setup either (GTX 260, Windows 7 32-bit, latest drivers).
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
Hi I have TEH clue. After seeing your post I downloaded Irrlicht (what a shame that I didn't have it already and made investigation).
Your text is displaying black cause it's the skin's text color. So to display it at the image just change :
Your text is displaying black cause it's the skin's text color. So to display it at the image just change :
Code: Select all
IGUIStaticText* staticText = guienv->addStaticText(L"Woohoo!", rect<s32>(10, 10, 200, 100));
staticText->setOverrideColor(SColor(255, 255, 255, 255));