pi3d string text color ??


3 posts
by AshPowers » Sun Apr 30, 2017 7:55 pm
Hi,

Having issues with trying to change the color of the text put on the screen using pi3d.String.

Cannot seem to find any documentation on how to do this. It is limited to just white characters??

Thanks!
-Ash
Posts: 65
Joined: Thu Apr 20, 2017 12:10 am
Location: Ormond Beach, FL
by scotty101 » Sun Apr 30, 2017 10:08 pm
Looks like you can change colour with TextBlock

https://pi3d.github.io/html/pi3d.util.h ... .TextBlock

And you can change String colour by defining the colour of the font used

https://pi3d.github.io/html/pi3d.util.h ... .util.Font
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter
Posts: 2089
Joined: Fri Jun 08, 2012 6:03 pm
by AshPowers » Mon May 01, 2017 9:50 pm
Actually figured it out a few hours after posting.

You can change the text color of a string in the font definition.
Code: Select all
myfont = pi3d.Font('fonts/fontname.ttf', (x, x, x, a))

x,x,x = RGB and the a value is alpha.
Posts: 65
Joined: Thu Apr 20, 2017 12:10 am
Location: Ormond Beach, FL