コード例 #1
0
    def on_draw(
            self):  # this is another function which actually draws the smiley
        """ Draw the face """
        arcade.start_render()
        face_x, face_y = (
            self.x, self.y
        )  # the use of self here indicates that the smiley would go wherever the mouse would go
        smile_x, smile_y = (
            face_x + 0, face_y - 10
        )  # these are the coordinates of smiley and all its parts
        eye1_x, eye1_y = (face_x - 30, face_y + 20)
        eye2_x, eye2_y = (face_x + 30, face_y + 20)
        catch1_x, catch1_y = (face_x - 25, face_y + 25)
        catch2_x, catch2_y = (face_x + 35, face_y + 25)

        arcade.draw_circle_filled(
            face_x, face_y, 100, open_color.yellow_3
        )  #lines 37-43 draws the smiiley also giving its parts specific colors to make it look like a smiley
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black, 4)
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 15, 25, open_color.black)
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25, open_color.black)
        arcade.draw_circle_filled(catch1_x, catch1_y, 3, open_color.gray_2)
        arcade.draw_circle_filled(catch2_x, catch2_y, 3, open_color.gray_2)
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)
コード例 #2
0
 def draw(self, scale=1, offset=0):
     args = [self._pv.x, self._pv.y, self._height, self._width]
     args = list(map(lambda x: x * scale, args))
     args[0] += offset
     args[1] += offset
     args += [self._color, self._angle]
     arcade.draw_ellipse_filled(*args)
コード例 #3
0
    def on_draw(self):
        """ Draw the face """
        arcade.start_render()
        face_x, face_y = (self.x, self.y)  #drawing the face
        smile_x, smile_y = (face_x + 0, face_y - 10)  #drawing the smile
        eye2_x, eye2_y = (face_x + 30, face_y + 20)  #Drawing the eyes
        catch1_x, catch1_y = (face_x - 25, face_y + 25)  #Drawing the iris
        catch2_x, catch2_y = (face_x + 35, face_y + 25)  #Drawing the iris

        arcade.draw_circle_filled(
            face_x, face_y, 100,
            open_color.yellow_3)  #drawing the face with yellow background
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black,
                                   4)  #drawing a black outline for the face
        arcade.draw_ellipse_filled(
            eye1_x, eye1_y, 15, 25,
            open_color.black)  #drawing the eye with fill color black
        arcade.draw_ellipse_filled(
            eye2_x, eye2_y, 15, 25,
            open_color.black)  #drawing the eye with fill color black
        arcade.draw_circle_filled(
            catch1_x, catch1_y, 3,
            open_color.gray_2)  #drawing the iris with fill color gray
        arcade.draw_circle_filled(
            catch2_x, catch2_y, 3,
            open_color.gray_2)  #drawing the iris with fill color gray
        arcade.draw_arc_outline(
            smile_x, smile_y, 60, 50, open_color.black, 190, 350,
            4)  #drawing the arc for the smile with fill color black
コード例 #4
0
def main():
    arcade.open_window(800, 600, "Drawing Example")
    arcade.set_background_color(arcade.color.BABY_BLUE)
    arcade.start_render()

    draw_grass()

    # Draw the Pond
    arcade.draw_ellipse_filled(600, 150, 400, 100, arcade.csscolor.INDIGO)

    # Draw the flower
    draw_flower(100, 150)
    draw_flower(200, 150)

    # Draw the tree
    draw_tree(770, 350)
    draw_tree(300, 350)

    # Draw the cow
    draw_cow(100, 300)
    draw_cow(500, 300)
    #Sun
    arcade.draw_circle_filled(20, 600, 150, arcade.csscolor.YELLOW)

    arcade.finish_render()
    # Keep the window up until someone closes it.
    arcade.run()
コード例 #5
0
ファイル: main5.py プロジェクト: AjsonZ/E01b-Smiles
    def on_draw(self):  # define on_draw
        """ Draw the face """
        arcade.start_render(
        )  # start the render process. This must be done before any drawing commands
        face_x, face_y = (self.x, self.y)
        smile_x, smile_y = (face_x + 0, face_y - 10
                            )  #set the position of smile
        eye1_x, eye1_y = (face_x - 30, face_y + 20)  #set the position of eye1
        eye2_x, eye2_y = (face_x + 30, face_y + 20)  #set the position of eye2
        catch1_x, catch1_y = (face_x - 25, face_y + 25
                              )  #set the position of catch1
        catch2_x, catch2_y = (face_x + 35, face_y + 25
                              )  #set the position of catch2

        arcade.draw_circle_filled(
            face_x, face_y, 100,
            open_color.yellow_3)  #fill the circle with yellow
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black,
                                   4)  #draw the outline of circle with black
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 15, 25,
                                   open_color.black)  #fill the eye1 with black
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25,
                                   open_color.black)  #fill the eye2 with black
        arcade.draw_circle_filled(
            catch1_x, catch1_y, 3,
            open_color.gray_2)  #fill the catch1 with grey
        arcade.draw_circle_filled(
            catch2_x, catch2_y, 3,
            open_color.gray_2)  #fill the catch2 with grey
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)  #draw the smile arc with black
コード例 #6
0
def on_draw():

    global screen

    arcade.start_render()

    if screen == "death":
        arcade.draw_text(f"You got {str(player_points)}!", 60, 60,
                         arcade.color.BLACK, 12)
        arcade.draw_text("Press enter to restart the game", 60, 30,
                         arcade.color.BLACK, 12)

    elif screen == "playing":

        # Draw the player
        arcade.draw_ellipse_filled(pos_x, pos_y, 8, 5,
                                   arcade.color.SCHOOL_BUS_YELLOW)

        # Draw all the pipes
        for pipe in list_of_pipes:
            arcade.draw_xywh_rectangle_filled(pipe[0], pipe[1] + pipe_height,
                                              pipe_width, HEIGHT,
                                              arcade.color.GO_GREEN)
            arcade.draw_xywh_rectangle_filled(pipe[0], 0, pipe_width, pipe[1],
                                              arcade.color.GO_GREEN)

        arcade.draw_text(str(player_points), WIDTH / 2, HEIGHT - 15,
                         arcade.color.BLACK, 12)
コード例 #7
0
ファイル: 04_drawing.py プロジェクト: KoderKlub/Arcade-alapok
    def on_draw(self):
        arcade.start_render()

        # Circle - Kör
        arcade.draw_circle_filled(240, 360, 30, arcade.color.BLUE)
        arcade.draw_circle_outline(340, 360, 30, arcade.color.BUFF)

        # Ellipse - Ellipszis
        arcade.draw_ellipse_filled(100, 100, 50, 80, arcade.color.AO)
        arcade.draw_ellipse_outline(200, 100, 50, 80, arcade.color.YELLOW)

        # Rectangle - Téglalap
        arcade.draw_rectangle_filled(300, 100, 50, 50,
                                     arcade.color.ALIZARIN_CRIMSON)
        arcade.draw_rectangle_outline(400, 100, 50, 150,
                                      arcade.color.YANKEES_BLUE, 4)

        # Text - Szöveg
        arcade.draw_text("Kóder Klub", 20, 720 - 80, arcade.color.AQUA, 24)

        # Arc - Ív
        arcade.draw_arc_filled(640, 720 - 80, 120, 120,
                               arcade.color.YELLOW_ORANGE, 0, 90)
        arcade.draw_arc_filled(1040, 720 - 80, 120, 120,
                               arcade.color.YELLOW_ORANGE, 0, 270)

        # Triangle - Háromszög
        arcade.draw_polygon_outline([[0, 0], [50, 0], [25, 50]],
                                    arcade.color.AFRICAN_VIOLET)

        # Pentagon - Ötszög
        arcade.draw_polygon_outline(
            [[640, 360], [640 + 50, 360], [640 + 75, 360 + 25],
             [640 + 25, 360 + 50], [640 - 25, 360 + 25]],
            arcade.color.ALLOY_ORANGE)
コード例 #8
0
ファイル: main5.py プロジェクト: Ethan-source/E01b-Smiles
    def on_draw(self):  #command that draws the face
        """ Draw the face """
        arcade.start_render()  #nothing renders without this
        face_x, face_y = (self.x, self.y)
        smile_x, smile_y = (face_x + 0, face_y - 10
                            )  #Draws the coordinates of the smile
        eye1_x, eye1_y = (face_x - 30, face_y + 20
                          )  #These are the coordinates of the left eye
        eye2_x, eye2_y = (face_x + 30, face_y + 20
                          )  #These are the coordinates of the right eye
        catch1_x, catch1_y = (face_x - 25, face_y + 25
                              )  #draws the dimensions in the left eye
        catch2_x, catch2_y = (face_x + 35, face_y + 25
                              )  #draws the dimensions in the right eye

        arcade.draw_circle_filled(
            face_x, face_y, 100, open_color.yellow_3
        )  #Draws the yellow filled portion of the smiley
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black,
                                   4)  #draws tne outline of the smiley face
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 15, 25,
                                   open_color.black)  #draws the left eye
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25,
                                   open_color.black)  #draws the right eye
        arcade.draw_circle_filled(
            catch1_x, catch1_y, 3,
            open_color.gray_2)  #Draws the gray dot in the eye
        arcade.draw_circle_filled(
            catch2_x, catch2_y, 3,
            open_color.gray_2)  #Draws the gray dot in the right eye
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)  #Draws the smile
コード例 #9
0
ファイル: main5.py プロジェクト: chrstphrbtchr/E01b-Smiles
    def on_draw(self):  # Place the image on the cursor
        """ Draw the face """
        arcade.start_render()  # Start the rendering of the face
        face_x, face_y = (self.x, self.y
                          )  # Face and self are the same coordinates
        smile_x, smile_y = (
            face_x + 0, face_y - 10
        )  # Smile coordinates are equal to shifted face coordinates
        eye1_x, eye1_y = (
            face_x - 30, face_y + 20
        )  # Eye 1 coordinates are equal to shifted face coordinates
        eye2_x, eye2_y = (
            face_x + 30, face_y + 20
        )  # Eye 2 coordinates are equal to shifted face coordinates
        catch1_x, catch1_y = (
            face_x - 25, face_y + 25
        )  # Pupil 1 coordinates are equal to shifted face coordinates
        catch2_x, catch2_y = (
            face_x + 35, face_y + 25
        )  # Pupil 2 coordinates are equal to shifted face coordinates

        arcade.draw_circle_filled(
            face_x, face_y, 100, open_color.yellow_3
        )  # Lines 37 -43 are the creation of the parts of the face
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black, 4)
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 15, 25, open_color.black)
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25, open_color.black)
        arcade.draw_circle_filled(catch1_x, catch1_y, 3, open_color.gray_2)
        arcade.draw_circle_filled(catch2_x, catch2_y, 3, open_color.gray_2)
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)
コード例 #10
0
ファイル: main5.py プロジェクト: KyleNorlander/E01b-Smiles
    def on_draw(self):
        """ Draw the face """  #This is placing the smiley in the middle of the screen to begin with
        arcade.start_render()
        face_x, face_y = (
            self.x, self.y
        )  #is this connected to lines 46-49? These lines place the full picture in the middle of the screen with the coordinates making up a smiley and not a terrifying cyclops or some other beast
        smile_x, smile_y = (face_x + 0, face_y - 10)
        eye1_x, eye1_y = (face_x - 30, face_y + 20)
        eye2_x, eye2_y = (face_x + 30, face_y + 20)
        catch1_x, catch1_y = (face_x - 25, face_y + 25)
        catch2_x, catch2_y = (face_x + 35, face_y + 25)

        arcade.draw_circle_filled(
            face_x, face_y, 100, open_color.yellow_3
        )  #This is the line that make up the yellow circle background
        arcade.draw_circle_outline(
            face_x, face_y, 100, open_color.black, 4
        )  #This is the line that creates the solid black outline for the smiley
        arcade.draw_ellipse_filled(
            eye1_x, eye1_y, 15, 25,
            open_color.black)  #These two lines are the black circles, or eyes
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25, open_color.black)
        arcade.draw_circle_filled(
            catch1_x, catch1_y, 3, open_color.gray_2
        )  #These two lines are made for the two reflections in the eyes
        arcade.draw_circle_filled(catch2_x, catch2_y, 3, open_color.gray_2)
        arcade.draw_arc_outline(
            smile_x, smile_y, 60, 50, open_color.black, 190, 350, 4
        )  #This line is the arc, or the actual curved line making the smile
コード例 #11
0
    def on_draw(self):
        #circle
        arcade.start_render()
        arcade.draw_circle_filled(240, 360, 30, arcade.color.BLUE)
        arcade.draw_circle_outline(340, 360, 30, arcade.color.BUFF)

        #ellipse
        arcade.draw_ellipse_filled(100, 100, 50, 80, arcade.color.AQUA)
        arcade.draw_ellipse_outline(200, 100, 50, 80, arcade.color.AMETHYST)

        #rectangle
        arcade.draw_rectangle_filled(300, 100, 50, 50,
                                     arcade.color.RASPBERRY_GLACE)
        arcade.draw_rectangle_outline(400, 100, 50, 100,
                                      arcade.color.YANKEES_BLUE, 4)

        #text-szöveg
        arcade.draw_text("Kóder Klub", 20, 720 - 80, arcade.color.ALMOND, 24)
        #arc-iv
        arcade.draw_arc_filled(640, 720 - 80, 120, 120,
                               arcade.color.YELLOW_GREEN, 0, 90)
        arcade.draw_arc_filled(1040, 720 - 80, 120, 120, arcade.color.GLITTER,
                               0, 180)

        #triangle
        arcade.draw_polygon_outline([[0, 0], [50, 0], [25, 50]],
                                    arcade.color.RAZZMIC_BERRY)

        #polygon
        arcade.draw_polygon_outline(
            [[640, 360], [640 + 50, 360], [640 + 75, 360 + 25],
             [640 + 25, 360 + 50], [640 - 25, 360 + 25]],
            arcade.color.EARTH_YELLOW)
コード例 #12
0
ファイル: drawing_2_sky_6.py プロジェクト: lwz7512/pycoding
    def on_draw(self):
        """ Called whenever we need to draw the window. """
        arcade.start_render()

        arcade.draw_lrtb_rectangle_filled(0, 640, 480, 100,
                                          arcade.csscolor.BLUE)
        # Draw a rectangle
        # Left of 0, right of 599
        # Top of 300, bottom of 0
        arcade.draw_lrtb_rectangle_filled(0, 640, 100, 0,
                                          arcade.csscolor.GREEN)
        # Tree trunk
        # Center of 100, 320
        # Width of 20
        # Height of 60
        arcade.draw_rectangle_filled(100, 120, 20, 60, arcade.csscolor.SIENNA)
        # Tree top
        arcade.draw_circle_filled(100, 150, 30, arcade.csscolor.DARK_GREEN)
        # Another tree, with a trunk and ellipse for top
        arcade.draw_rectangle_filled(200, 120, 20, 60, arcade.csscolor.SIENNA)
        arcade.draw_ellipse_filled(200, 170, 60, 80,
                                   arcade.csscolor.DARK_GREEN)
        # Another tree, with a trunk and arc for top
        # Arc is centered at (300, 340) with a width of 60 and height of 100.
        # The starting angle is 0, and ending angle is 180.
        arcade.draw_rectangle_filled(300, 120, 20, 60, arcade.csscolor.SIENNA)
        arcade.draw_arc_filled(300, 140, 60, 100, arcade.csscolor.DARK_GREEN,
                               0, 180)
コード例 #13
0
    def on_draw(self):
        arcade.start_render()

        # zöld kör
        arcade.draw_ellipse_filled(self.green_circle_x, self.green_circle_y,
                                   80, 80, arcade.color.GREEN)
        arcade.draw_ellipse_outline(self.green_circle_x, self.green_circle_y,
                                    80, 80, arcade.color.YELLOW, 2)
        arcade.draw_text(
            f"green x: {self.green_circle_x:.2f} - green y: {self.green_circle_y:.2f}",
            10, 720 - 20, arcade.color.GREEN, 16)

        # kék kör
        arcade.draw_ellipse_filled(self.blue_circle_x, self.blue_circle_y, 80,
                                   80, arcade.color.BLUE)
        arcade.draw_ellipse_outline(self.blue_circle_x, self.blue_circle_y, 80,
                                    80, arcade.color.YELLOW, 2)
        arcade.draw_text(
            f"blue x: {self.blue_circle_x:.2f} - blue y: {self.blue_circle_y:.2f}",
            10, 720 - 40, arcade.color.BABY_BLUE, 16)

        # piros körvonal
        arcade.draw_ellipse_outline(self.red_circle_x, self.red_circle_y, 80,
                                    80, arcade.color.RED, 2)
        arcade.draw_text(
            f"red x: {self.red_circle_x:.2f} - red y: {self.red_circle_y:.2f}",
            10, 720 - 60, arcade.color.RED, 16)
コード例 #14
0
def draw_fish(x, y):
    """Function to draw a moderately large white fish with a pink belly at a specific point"""
    arcade.draw_polygon_filled([[x, y], [x + 55, y + 30], [x + 80, y], [x + 55, y - 30]], arcade.color.WHITE_SMOKE)
    arcade.draw_ellipse_filled(x + 65, y + 10, 10, 5, arcade.color.BLACK)
    arcade.draw_triangle_filled(x, y, x + 80, y, x + 55, y - 30, arcade.color.PINK)
    arcade.draw_triangle_filled(x, y, x - 20, y + 30, x - 20, y - 30, arcade.color.WHITE_SMOKE)
    arcade.draw_ellipse_filled(x + 40, y, 30, 10, arcade.color.BLUEBERRY)
コード例 #15
0
ファイル: main5.py プロジェクト: stldavids/E01b-Smiles
    def on_draw(self):
        """ Draw the face """
        arcade.start_render()

        #Face is set to the center defined above
        face_x, face_y = (self.x, self.y)
        #Set mouth positon on face
        smile_x, smile_y = (face_x + 0, face_y - 10)
        #Set left eye position
        eye1_x, eye1_y = (face_x - 30, face_y + 20)
        #Set right eye position
        eye2_x, eye2_y = (face_x + 30, face_y + 20)
        #Set left eye catch position
        catch1_x, catch1_y = (face_x - 25, face_y + 25)
        #Set right eye catch position
        catch2_x, catch2_y = (face_x + 35, face_y + 25)

        #Draw yellow base
        arcade.draw_circle_filled(face_x, face_y, 100, open_color.yellow_3)
        #Draw outline
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black, 4)
        #Draw left eye
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 15, 25, open_color.black)
        #Draw right eye
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25, open_color.black)
        #Draw left eye catch
        arcade.draw_circle_filled(catch1_x, catch1_y, 3, open_color.gray_2)
        #Draw right eye catch
        arcade.draw_circle_filled(catch2_x, catch2_y, 3, open_color.gray_2)
        #Draw mouth
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)
コード例 #16
0
ファイル: main5.py プロジェクト: Dusteen99/E01b-Smiles
    def on_draw(self):
        """ Draw the face """
        #This line initializes the rendering
        arcade.start_render()
        #Sets the center of the face to the middle of the screen to start
        face_x, face_y = (self.x, self.y)
        #Changed these three lines to make the picture closer to the example
        #Each of the next 5 non-comment lines draw the face, all of the positioning relative to the center
        #of the outline
        smile_x, smile_y = (face_x + 0, face_y + 0)
        eye1_x, eye1_y = (face_x - 30, face_y + 50)
        eye2_x, eye2_y = (face_x + 30, face_y + 50)
        #Changed shine position to be closer to example
        catch1_x, catch1_y = (face_x - 25, face_y + 63)
        catch2_x, catch2_y = (face_x + 35, face_y + 63)

        #Again, changed eye size to match example
        #These arcade.draw lines just color the face, specifically:
        #The whole face yellow
        arcade.draw_circle_filled(face_x, face_y, 100, open_color.yellow_3)
        #The outline black
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black, 4)
        #The two eyes black
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 30, 50, open_color.black)
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 30, 50, open_color.black)
        #The shining of the eyes gray
        arcade.draw_circle_filled(catch1_x, catch1_y, 3, open_color.gray_2)
        arcade.draw_circle_filled(catch2_x, catch2_y, 3, open_color.gray_2)
        #And the smile black
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)
コード例 #17
0
def draw_toolbar_shapes():
    # Export button
    arcade.draw_text("EXPORT", 15, 765, arcade.color.BLACK, font_size=18)

    # Draw rectangles
    arcade.draw_rectangle_filled(25, 725, 35, 15, arcade.color.BLUE)
    arcade.draw_rectangle_outline(75, 725, 35, 15, arcade.color.BLUE)

    # Draw circles
    arcade.draw_circle_filled(25, 675, 13, arcade.color.BLUE)
    arcade.draw_circle_outline(75, 675, 13, arcade.color.BLUE)

    # Draw ellipses
    arcade.draw_ellipse_filled(25, 625, 18, 8, arcade.color.BLUE)
    arcade.draw_ellipse_outline(75, 625, 18, 8, arcade.color.BLUE)

    # Draw triangles
    arcade.draw_triangle_filled(25, 590, 10, 560, 40, 560, arcade.color.BLUE)
    arcade.draw_triangle_outline(75, 590, 60, 560, 90, 560, arcade.color.BLUE)

    # Draw arc tops (to symbolize arc tops & bottoms)
    arcade.draw_arc_filled(25, 520, 15, 15, arcade.color.BLUE, 0, 180)
    arcade.draw_arc_outline(75, 520, 15, 15, arcade.color.BLUE, 0, 180)

    # Draw lines
    arcade.draw_line(10, 460, 40, 490, arcade.color.BLUE, line_width=2)
    arcade.draw_line(60, 460, 90, 490, arcade.color.BLUE, line_width=1)
コード例 #18
0
    def on_draw(self):  #on draw function
        """ Draw the face """
        arcade.start_render()  #begins the render, needed
        face_x, face_y = (self.x, self.y
                          )  #create 2 new variables to be used below
        smile_x, smile_y = (
            face_x + 0, face_y - 10
        )  #set the coordinates of the smile relative to the face
        eye1_x, eye1_y = (
            face_x - 30, face_y + 20
        )  #set the coordinates of the eye relative to the face
        eye2_x, eye2_y = (
            face_x + 30, face_y + 20
        )  #set the coordinates of the eye relative to the face
        catch1_x, catch1_y = (
            face_x - 25, face_y + 25
        )  #set the coordinates of the eye catch relative to the face
        catch2_x, catch2_y = (
            face_x + 35, face_y + 25
        )  #set the coordinates of the eye catch relative to the face

        arcade.draw_circle_filled(face_x, face_y, 100,
                                  open_color.yellow_3)  #draw in certain color
        arcade.draw_circle_outline(face_x, face_y, 100, open_color.black,
                                   4)  #draw in certain color
        arcade.draw_ellipse_filled(eye1_x, eye1_y, 15, 25,
                                   open_color.black)  #draw in certain color
        arcade.draw_ellipse_filled(eye2_x, eye2_y, 15, 25,
                                   open_color.black)  #draw in certain color
        arcade.draw_circle_filled(catch1_x, catch1_y, 3,
                                  open_color.gray_2)  #draw in certain color
        arcade.draw_circle_filled(catch2_x, catch2_y, 3,
                                  open_color.gray_2)  #draw in certain color
        arcade.draw_arc_outline(smile_x, smile_y, 60, 50, open_color.black,
                                190, 350, 4)  #draw in certain color
コード例 #19
0
 def draw(self):
     newX = 25 * math.cos(self.angle * math.pi / 180)
     newY = 25 * math.sin(self.angle * math.pi / 180)
     arcade.draw_line(self.x, self.y, self.x + newX, self.y + newY,
                      self.color, 3)
     arcade.draw_ellipse_filled(self.x + newX, self.y + newY, 10, 10,
                                self.color, 3)
コード例 #20
0
 def dibujo_camello(self):
     arcade.draw_line(self.position_x + 10, 235, self.position_x + 30, 215, arcade.color.BLACK, 4)
     arcade.draw_line(self.position_x - 10, 235, self.position_x - 30, 215, arcade.color.BLACK, 4)
     arcade.draw_ellipse_filled(self.position_x, 250, 70, 40, arcade.csscolor.SANDY_BROWN)  # cuerpo
     arcade.draw_circle_filled(self.position_x + 30, 270, 15, arcade.csscolor.SANDY_BROWN)  # cabeza
     arcade.draw_circle_filled(self.position_x + 25, 280, 2, arcade.csscolor.BLACK)
     arcade.draw_circle_filled(self.position_x + 40, 280, 2, arcade.csscolor.BLACK)
コード例 #21
0
ファイル: lab_03.py プロジェクト: feliciyus/learn-arcade-work
def draw_beach_umbrella(x, y):
    """ Draw an umbrella """
    # Shadow
    arcade.draw_ellipse_filled(x, y - 65, 250, 100, (86, 87, 64))
    # Handle and top
    arcade.draw_rectangle_filled(x, y, 10, 150, arcade.color.SILVER_PINK, 3)
    arcade.draw_arc_filled(x + 5, y + 70, 250, 100, (209, 27, 115), 0, 180, -3)
    arcade.draw_triangle_filled(x + 2, y + 120, x + 12, y + 120, x + 8,
                                y + 130, arcade.color.SILVER_PINK)
    # Stripes
    arcade.draw_line(x + 7, y + 120, x - 120, y + 76, arcade.color.BLACK, 2)
    arcade.draw_line(x + 7, y + 120, x - 50, y + 72, arcade.color.BLACK, 2)
    arcade.draw_line(x + 7, y + 120, x + 3, y + 70, arcade.color.BLACK, 2)
    arcade.draw_line(x + 7, y + 120, x + 50, y + 67, arcade.color.BLACK, 2)
    arcade.draw_line(x + 7, y + 120, x + 130, y + 64, arcade.color.BLACK, 2)
    # Green Circles on top
    arcade.draw_circle_filled(x - 5, y + 95, 5, (47, 128, 66))
    arcade.draw_circle_filled(x - 15, y + 80, 5, (47, 128, 66))
    arcade.draw_circle_filled(x - 95, y + 95, 5, (47, 128, 66))
    arcade.draw_circle_filled(x - 65, y + 107, 5, (47, 128, 66))
    arcade.draw_circle_filled(x + 50, y + 92, 5, (47, 128, 66))
    arcade.draw_circle_filled(x + 70, y + 82, 5, (47, 128, 66))
    # Blue Circles on top
    arcade.draw_circle_filled(x + 17, y + 88, 7, (71, 207, 214))
    arcade.draw_circle_filled(x - 60, y + 82, 7, (71, 207, 214))
    arcade.draw_circle_filled(x - 40, y + 95, 5, (71, 207, 214))
    arcade.draw_circle_filled(x + 100, y + 88, 5, (71, 207, 214))
    arcade.draw_circle_filled(x + 70, y + 100, 5, (71, 207, 214))
コード例 #22
0
def print_flower(x, y, ancho, alto, rgb_color):
    """float*4,tuple-->flor
    OBJ: dibujar una flor"""
    arcade.draw_ellipse_filled(x - 7, y, ancho, alto, rgb_color)
    arcade.draw_ellipse_filled(x, y + 5, ancho, alto, rgb_color)
    arcade.draw_ellipse_filled(x + 7, y, ancho, alto, rgb_color)
    arcade.draw_ellipse_filled(x, y - 5, ancho, alto, rgb_color)
    arcade.draw_ellipse_filled(x, y, ancho, alto, arcade.color.CHROME_YELLOW)
コード例 #23
0
ファイル: Pumpkin.py プロジェクト: Ti1mmy/classwork
def on_draw():
    arcade.start_render()
    # Draw in here...
    arcade.draw_rectangle_filled(320, 340, 20, 60, arcade.color.ASPARAGUS)
    arcade.draw_ellipse_filled(320, 240, 80, 100, arcade.color.PUMPKIN)
    arcade.draw_circle_filled(320, 240, 10, arcade.color.ORANGE_PEEL)
    arcade.draw_triangle_filled(290, 280, 280, 265, 300, 265, arcade.color.ORANGE_PEEL)
    arcade.draw_triangle_filled(350, 280, 340, 265, 360, 265, arcade.color.ORANGE_PEEL)
コード例 #24
0
def on_draw():
    arcade.start_render()
    # Draw in here...
    # arcade.draw_shape_etc (x-coord, y-coord, radius, colour)
    arcade.draw_circle_filled(player_x, player_y, 200, arcade.color.YELLOW)
    arcade.draw_ellipse_filled(255, 300, 20, 45, arcade.color.BLACK)
    arcade.draw_ellipse_filled(395, 300, 20, 45, arcade.color.BLACK)
    arcade.draw_xywh_rectangle_filled(265, 135, 120, 60, arcade.color.BLACK)
コード例 #25
0
ファイル: dibujo_camello.py プロジェクト: blopax3/arcade-labs
def dibujo_camello(x, y):
    """ Dibujo camello """
    arcade.draw_line(x + 10, 235, x + 30, 215, arcade.color.BLACK, 4)
    arcade.draw_line(x - 10, 235, x - 30, 215, arcade.color.BLACK, 4)
    arcade.draw_ellipse_filled(x, 250, 70, 40, arcade.csscolor.SANDY_BROWN)  # cuerpo
    arcade.draw_circle_filled(x + 30, 270, 15, arcade.csscolor.SANDY_BROWN)  # cabeza
    arcade.draw_circle_filled(x + 25, 280, 2, arcade.csscolor.BLACK)
    arcade.draw_circle_filled(x + 40, 280, 2, arcade.csscolor.BLACK)
コード例 #26
0
ファイル: lab_03.py プロジェクト: liu-hanli/learn-arcade-work
def draw_flower(x, y, rgb_color):
    """float*4,tuple-->flor
    OBJ: dibujar una flor"""
    arcade.draw_ellipse_filled(x - 7, y, 12, 9, rgb_color)
    arcade.draw_ellipse_filled(x, y + 5, 12, 9, rgb_color)
    arcade.draw_ellipse_filled(x + 7, y, 12, 9, rgb_color)
    arcade.draw_ellipse_filled(x, y - 5, 12, 9, rgb_color)
    arcade.draw_ellipse_filled(x, y, 12, 9, arcade.color.CHROME_YELLOW)
コード例 #27
0
def draw_cloud(x, y):
    """Draw clouds anywhere"""
    arcade.draw_point(x, y, arcade.color.RED, 5)
    arcade.draw_ellipse_filled(x, 35 + y, 200, 70, arcade.color.GRAY_BLUE)
    arcade.draw_circle_filled(35 + x, 60 + y, 35, arcade.color.GRAY_BLUE)
    arcade.draw_ellipse_filled(-10 + x, 85 + y, 75, 130,
                               arcade.color.GRAY_BLUE)
    arcade.draw_circle_filled(-40 + x, 60 + y, 35, arcade.color.GRAY_BLUE)
コード例 #28
0
def draw_bird():
    arcade.draw_ellipse_filled(250, 500, 80, 30, arcade.csscolor.BURLYWOOD)
    arcade.draw_rectangle_filled(250, 510, 10, 20, arcade.csscolor.BLUE_VIOLET)
    arcade.draw_arc_filled(233, 500, 30, 70, arcade.csscolor.BLACK, 0, 40)
    arcade.draw_arc_filled(243, 500, 30, 70, arcade.csscolor.BLACK, 0, 40)
    arcade.draw_circle_filled(250, 527, 10, arcade.csscolor.BLUE_VIOLET)
    arcade.draw_circle_filled(255, 529, 2, arcade.csscolor.BLACK)
    arcade.draw_rectangle_filled(261, 523, 7, 3, arcade.csscolor.BLACK)
コード例 #29
0
ファイル: lab_07.py プロジェクト: feliciyus/learn-arcade-work
def draw_cloud_1(x, y):
    """ Draw 1st type cloud """
    arcade.draw_ellipse_filled(x, y, 200, 100, arcade.color.WHITE, 7)
    arcade.draw_arc_filled(x, y + 35, 100, 50, arcade.color.WHITE, 0, 180)
    arcade.draw_arc_filled(x + 50, y + 25, 80, 80, arcade.color.WHITE, 0, 180, -20)

    arcade.draw_arc_filled(x, y - 40, 100, 50, arcade.color.WHITE, 0, 180, 180)
    arcade.draw_arc_filled(x - 50, y - 25, 80, 80, arcade.color.WHITE, 0, 180, 160)
コード例 #30
0
 def on_draw(self):
     arcade.start_render()
     arcade.draw_ellipse_filled(self.circle_x, self.circle_y, 80, 80,
                                arcade.color.AO)
     arcade.draw_ellipse_outline(self.circle_x, self.circle_y, 80, 80,
                                 arcade.color.YELLOW_ROSE)
     arcade.draw_text(f"x:{self.circle_x:.0f} - y:{self.circle_y:.0f}", 10,
                      720 - 20, arcade.color.WHITE, 16)
コード例 #31
0
arcade.draw_text("draw_circle_outline", 243, 207, arcade.color.WHITE, 10)
arcade.draw_circle_outline(300, 285, 18, arcade.color.WISTERIA, 3)

# Draw a filled in circle
arcade.draw_text("draw_circle_filled", 363, 207, arcade.color.WHITE, 10)
arcade.draw_circle_filled(420, 285, 18, arcade.color.GREEN)

# Draw an ellipse outline, and another one rotated
arcade.draw_text("draw_ellipse_outline", 483, 207, arcade.color.WHITE, 10)
arcade.draw_ellipse_outline(540, 273, 15, 36, arcade.color.AMBER, 3)
arcade.draw_ellipse_outline(540, 336, 15, 36,
                            arcade.color.BLACK_BEAN, 3, 45)

# Draw a filled ellipse, and another one rotated
arcade.draw_text("draw_ellipse_filled", 3, 3, arcade.color.WHITE, 10)
arcade.draw_ellipse_filled(60, 81, 15, 36, arcade.color.AMBER)
arcade.draw_ellipse_filled(60, 144, 15, 36,
                           arcade.color.BLACK_BEAN, 45)

# Draw an arc, and another one rotated
arcade.draw_text("draw_arc/filled_arc", 123, 3, arcade.color.WHITE, 10)
arcade.draw_arc_outline(150, 81, 15, 36,
                        arcade.color.BRIGHT_MAROON, 90, 360)
arcade.draw_arc_filled(150, 144, 15, 36,
                       arcade.color.BOTTLE_GREEN, 90, 360, 45)

# My drawing of PACMAN
arcade.draw_arc_filled(300, 345, 36, 36,
                       arcade.color.YELLOW, 90, 360, -45)

# Draw an rectangle outline
コード例 #32
0
ファイル: shapes.py プロジェクト: mwreuter/arcade
 def draw(self):
     arcade.draw_ellipse_filled(self.x, self.y, self.width, self.height,
                                self.color, self.angle)