[Dev] display.line() broken?

Brian Fisher brian at hamsterrepublic.com
Wed Mar 26 23:29:57 PDT 2008


lines work fine for me, below is the code I used for map.py:
-----------------------------
class BaseMap(object):

  def __init__(self):
    self.grid = vec2d(64, 64)

  def draw(self, display):
    game = HamsterWheel.the_game
    for i in xrange(game.screen_height / self.grid.y + 1):
      y = i * self.grid.y
      points = [vec2d(0, y), vec2d(game.screen_width, y)]
      display.line(points)
      #display.rect(points[0], points[1])
    for i in xrange(game.screen_width / self.grid.x + 1):
      x = i * self.grid.x
      points = [vec2d(x, 0), vec2d(x, game.screen_height)]
      display.line(points)
-----------------------------

does that code not work for you? (it's possible there could be a
driver issue - OpenGL line support is not a high priority for ATI or
Nvidia - I think nvidia's line's can't be antialiased either. I think
I need to change it to draw the line with a specially built texture
instead)

... as far as the rect goes - I don't really have on opinion on what a
zero width/height rect should be... although rects will have similar
problems to lines in terms of not being able to be antialiased
consistently - so they probably need some rework (probably to use a
specially designed texture just like the line)

On Wed, Mar 26, 2008 at 10:20 PM, James Paige <Bob at hamsterrepublic.com> wrote:
> I was just trying to draw a line with display.line, and I was getting
>  nothing.
>
>  Since I only needed to draw horizontal lines, I can use rect-- although
>  I do notice that if either the height or width of a rectangle is zero,
>  the rect isn't drawn. (the rectangle behaviour I am accustomed to is
>  zero dimention gets drawn as one-pixel)
>
>  ---
>  James
>  _______________________________________________
>  Dev mailing list
>  Dev at lists.motherhamster.org
>  http://lists.motherhamster.org/listinfo.cgi/dev-motherhamster.org
>



More information about the Dev mailing list