This code works fine for me, using GetDefaultFont rather than GetFont. First thing to check is that sansFont is a valid font. Possibly you have the wrong name for the font in your GetFont call. Also, the color value you’re using is strange – it is only 6 digits long rather than 8, so the red value is zero and the alpha is F6. I’m not sure if that’s what you intended. There’s also a bug in either your HextToInteger3 function or the call to it, since it doesn’t account for the # at the start of the string (it ends up parsing the string “0#F6F6F6”). Unless you’re not showing your actual code, there’s no reason to say HexToInteger3(“#F6F6F6”) rather than the simpler and faster &hF6F6F6. Finally, you should almost always use a double buffered roScreen to avoid image tearing, which means you should use SwapBuffers not Finish.
“RokuMarkn” wrote:
… There’s also a bug in either your HextToInteger3 function or the call to it, since it doesn’t account for the # at the start of the string (it ends up parsing the string “0#F6F6F6”). Unless you’re not showing your actual code, there’s no reason to say HexToInteger3(“#F6F6F6”) rather than the simpler and faster &hF6F6F6.
There is no bug in HexToInteger3 nor in the way he calls it:
No, I don’t buy that this is intentional behavior. The function clearly expects a string of hex digits, and is prepending a zero only to avoid problems when the string is not well formed (odd length). The caller for whatever reason thinks the string can or should begin with a #. The caller clearly thinks it’s passing a well formed 3 byte string. The function however thinks this is not well formed and sticks a zero in front of the # producing the bizarre FOUR byte string 0#F6F6F6 that neither the caller nor the callee would call well formed. If the caller passed “#12345678”, the function would be parsing the FIVE(!) byte string “0#12345678”. IMHO rejoicing in the fact that the code nevertheless works is not the best response to this mess.