PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Pbm between DrawText and Colorkey

I've got a problem with the DrawText() function.
When I use it on a CGapiDisplay with ColorKey set to RGB(0xFF,0x00,0xFF), it's working fine.
When I change the Colorkey to another value, the function crashes and returns GDERR_INVALIDRECT the first time and GDERR_NOTINITIALIZED after.

Did someone have the same problem?

Is it because the background color of my bitmap fonts are Fuschia (0xFF00FF)?

jul'
Hi,

Yep.. When you say "crash" I assume you mean "fail". Basically every blit function tests all parameters and states of the surface so getting GapiDraw to crash now would be an accomplishment. ;)

Basically the color key is used to define transparency in the bitmap. If you do not specify the correct background color (in your case 0xFF00FF) CGapiBitmapFont::CreateFont will not be able to identify any characters in the bitmap and will fail. That's the same reason all subsequent events return GDERR_NOTINITIALIZED.

/Johan
Yes, it did not crash but failed ;-)
I now see where's my error : I had an unique transparent color for all the application. But the transparent color for the fonts I have (currently yours) is Fuschia (FF,00,FF), so when I tried to change it, it failed...

Thanks a lot.


jul'