Skip to content

create_lines_with_colors only creates one line with colors. #804

@pvcraven

Description

@pvcraven

This only draws one line:

import arcade

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Starting Template"


class MyGame(arcade.Window):

    def __init__(self, width, height, title):
        super().__init__(width, height, title)

        arcade.set_background_color(arcade.color.WHITE)

        point_list = [[0, 0],
                      [100, 100],
                      [200, 0],
                      [300, 100]]
        color_list = [arcade.color.RED,
                      arcade.color.GREEN,
                      arcade.color.BLUE,
                      arcade.color.YELLOW]
        self.lines = arcade.create_lines_with_colors(point_list,
                                                     color_list,
                                                     line_width=5)

    def on_draw(self):
        arcade.start_render()
        self.lines.draw()


def main():
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcade.run()


if __name__ == "__main__":
    main()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions