Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pygame zero how to draw text

screen.draw.text("Text color", (50, 30), color="orange")
screen.draw.text("Font name and size", (20, 100), fontname="Boogaloo", fontsize=60)
screen.draw.text("Positioned text", topright=(840, 20))
screen.draw.text("Allow me to demonstrate wrapped text.", (90, 210), width=180, lineheight=1.5)
screen.draw.text("Outlined text", (400, 70), owidth=1.5, ocolor=(255,255,0), color=(0,0,0))
screen.draw.text("Drop shadow", (640, 110), shadow=(2,2), scolor="#202020")
screen.draw.text("Color gradient", (540, 170), color="red", gcolor="purple")
screen.draw.text("Transparency", (700, 240), alpha=0.1)
screen.draw.text("Vertical text", midleft=(40, 440), angle=90)
screen.draw.text("All together now:
Combining the above options",
    midbottom=(427,460), width=360, fontname="Boogaloo", fontsize=48,
    color="#AAFF00", gcolor="#66AA00", owidth=1.5, ocolor="black", alpha=0.8)
Comment

PREVIOUS NEXT
Code Example
Python :: date-fns difference in days 
Python :: python string: iterate string 
Python :: split string in python 
Python :: doc2vec similarity 
Python :: python slicing multi dimensional array 
Python :: python grid 
Python :: python mixins 
Python :: opencv python grayscale image to color 
Python :: how to calculate z score in python 
Python :: cut rows dataframe 
Python :: ravel python 
Python :: python flatten list 
Python :: how to use path to change working directory in python 
Python :: feature importance naive bayes python 
Python :: python switch case 3.10 
Python :: maxsize in python 
Python :: what is seaborn in python 
Python :: first and last digit codechef solution 
Python :: python map string to int 
Python :: get token from request django 
Python :: keras lstm example 
Python :: python string indexing 
Python :: cartesian product pandas 
Python :: python one line if statement no else 
Python :: multiple boxplots python 
Python :: text widget get tkinter 
Python :: python find string 
Python :: breadth first search graph python 
Python :: numpy random in python 
Python :: how call module in the same directory 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =