Python Forum

Full Version: error with survace.blit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So Ive been playing with pygame recently and ive came across this error, any help?

Traceback (most recent call last):
File "C:\Users\joemc\Desktop\Rpg\main.py", line 59, in <module>
window.blit(Sky)
TypeError: function missing required argument 'dest' (pos 2)

Here is the code...

import pygame
import sys
import time
from s.UltraColor import *
from s.textures import *

pygame.init()

cSec = 0
cFrame = 0
FPS = 0

tile_size = 32

fps_font = pygame.font.Font("C:\\Windows\\Fonts\\Verdana.ttf", 20)

sky = pygame.image.load("sky.png")
Sky = pygame.Surface(sky.get_size(), pygame.HWSURFACE)
Sky.blit(sky, (0, 0))
del sky

def show_fps():
fps_overlay = fps_font.render(str(FPS), True, Color.Goldenrod)
window.blit(fps_overlay, (0,0))

def create_window():
global window, window_height, window_width, window_title
window_width, window_height = 800, 600
window_title = "The Path"
window = pygame.display.set_mode((window_width, window_height), pygame.HWSURFACE|pygame.DOUBLEBUF)


def count_fps():
global cSec, cFrame, FPS

if cSec == time.strftime("%S"):
cFrame += 1
else:
FPS = cFrame
cFrame = 0
cSec = time.strftime("%S")


create_window()

isRunning = True

while isRunning:
for event in pygame.event.get():
if event.type == pygame.QUIT:
isRunning = False

# Logic
count_fps()



# Render Graphics
window.blit(Sky)


# Render Simple Terrain Grid
for x in range(0, 640, tile_size):
for y in range(0, 480, tile_size):
window.blit(Tiles.Grass, (x, y))


show_fps()



pygame.display.update()


pygame.quit()
sys.exit
blit takes 2 arguments, the first being the image and the second being the location. (x,y) or rect

next time please use a proper title, not HELP. Also post in the correct forum.
Thank you and sorry
and use code tags