Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pygame draw rect syntax

pygame.draw.rect(SURFACE, RGB_COLOR, (X, Y, WIDTH, HEIGHT))
Comment

how to draw a rectangle in pygame

# Importing the library
import pygame
  
# Initializing Pygame
pygame.init()
  
# Initializing surface
surface = pygame.display.set_mode((400,300))
  
# Initialing Color
color = (255,0,0)
  
# Drawing Rectangle
pygame.draw.rect(surface, color, pygame.Rect(30, 30, 60, 60))
pygame.display.flip()
Comment

pygame how to draw a rectangle

 pygame.draw.rect(DISPLAY,BLUE,(200,150,100,50))
Comment

pygame.draw.rect()

gameDisplay = pygame.display.set_mode((width,height))
bright_blue =(0,255,255)

# draw rectangle 
pygame.draw.rect(gameDisplay, bright_blue ,(611,473,100,50))
Comment

pygame draw rect

pygame.draw.rect(window, color, (x, y, width, height))
Comment

pygame draw rect

rectangle = pygame.Rect(x, y, width, height)
pygame.draw.rect(window, color, rectangle)
Comment

PREVIOUS NEXT
Code Example
Python :: jupyter upload folder 
Python :: how to use print in python 
Python :: python warning 
Python :: python copy an object 
Python :: calculating mean for pandas column 
Python :: spacy nlp load 
Python :: check strings last letter python 
Python :: convert string to list of dictionaries 
Python :: ImportError: No module named flask 
Python :: how to fill a list in python 
Python :: create age-groups in pandas 
Python :: unzip_data python 
Python :: remove columns from a dataframe python 
Python :: combine two dictionary adding values for common keys 
Python :: Inconsistent use of tabs and spaces in indentationPylance 
Python :: python dictionary comprehension 
Python :: python calculate derivative of function 
Python :: print only numbers from string python 
Python :: s = 1 + 2 + ... + n in python 
Python :: how to select python 3 interpreter in linux 
Python :: Python NumPy swapaxis Function Example 2 
Python :: python aws s3 client 
Python :: how to check if an input is a string in python 
Python :: date object into date format python 
Python :: pywhatkit docs 
Python :: python glob all files in directory recursively 
Python :: opencv waitkey example 
Python :: python Program to check if a given year is leap year 
Python :: show all urls django extensions 
Python :: select rows where column value is in list of values 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =