Seeing weird issues with canvas.line, anything better to use
Posted: Fri Jun 03, 2016 1:26 am
Hi All,
I'm trying to animate a line, and I'm seeing strange things happening with the canvas.line method. Looks like when the x end point is less than the x start point, the y start and end points get flipped around. Here's an example render method that I'm using.
Any way to fix this, or is there something better to use? Otherwise animating a flowing line is impossible in certain directions.
Thanks in advance!
I'm trying to animate a line, and I'm seeing strange things happening with the canvas.line method. Looks like when the x end point is less than the x start point, the y start and end points get flipped around. Here's an example render method that I'm using.
Code: Select all
def render(self, width, height, st, at):
render = renpy.Render(self.width, self.height)
canvas = render.canvas()
canvas.line("#000", (500,500), (0,0), 20) #flips the line around
canvas.line("#000", (500,500), (1000,1000), 20)
canvas.line("#000", (500,500), (0,1000), 20) #flips the line around
canvas.line("#000", (500,500), (1000,0), 20)
canvas.line("#000", (500,500), (500,1000), 20)
canvas.line("#000", (500,500), (1000,500), 20)
canvas.line("#000", (500,500), (500,0), 20)
canvas.line("#000", (500,500), (0,500), 20)Thanks in advance!