AshPowers
Posts: 76
Joined: Thu Apr 20, 2017 12:10 am
Location: Ormond Beach, FL
Contact: Website

pi3d string text color ??

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

scotty101
Posts: 2242
Joined: Fri Jun 08, 2012 6:03 pm

Re: pi3d string text color ??

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

AshPowers
Posts: 76
Joined: Thu Apr 20, 2017 12:10 am
Location: Ormond Beach, FL
Contact: Website

Re: pi3d string text color ??

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.

Return to “Python”

Who is online

Users browsing this forum: tulaaks and 27 guests