1. pygame
  2. pygame
  3. pygame
  4. Issues

Issues

Issue #147 new

gfxdraw doesn't work with inherited surfaces

Anonymous created an issue

it seems that gfxdraw not works with objects that inherit from Surface

import pygame as pg
from pygame import gfxdraw

class Frame(pg.Surface,object):
    def __init__(self,x,y,w,h):
        pg.Surface.__init__(self,(w,h),pg.SRCALPHA)

scr = pg.display.set_mode((500,500))
fr = Frame(50,50,300,300)
pg.gfxdraw.box(fr,pg.Rect(0,0,50,50),pg.Color('red'))

Traceback (most recent call last):

File "gfxdrawbug.py", line 13, in <module> pg.gfxdraw.box(fr,pg.Rect(0,0,50,50),pg.Color('red'))

TypeError: surface must be a Surface

Comments (0)

  1. Log in to comment