• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python turtle.stamp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中turtle.stamp函数的典型用法代码示例。如果您正苦于以下问题:Python stamp函数的具体用法?Python stamp怎么用?Python stamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了stamp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: show_sharks

    def show_sharks(self, sharks):
        self.update_cnt += 1
        if UPDATE_EVERY > 0 and self.update_cnt % UPDATE_EVERY != 1:
            return

        turtle.clearstamps()
        draw_cnt = 0
        px = {}
        for shark in sharks:
            draw_cnt += 1
            shark_shape = 'classic' if shark.tracked else 'classic'
            if DRAW_EVERY == 0 or draw_cnt % DRAW_EVERY == 0:
                # Keep track of which positions already have something
                # drawn to speed up display rendering
                scaled_x = int(shark.x * self.one_px)
                scaled_y = int(shark.y * self.one_px)
                scaled_xy = scaled_x * 10000 + scaled_y
                turtle.color(shark.color)
                turtle.shape(shark_shape)
                turtle.resizemode("user")
                turtle.shapesize(1.5,1.5,1)
                if not scaled_xy in px:
                    px[scaled_xy] = 1
                    turtle.setposition(*shark.xy)
                    turtle.setheading(math.degrees(shark.h))
                    turtle.stamp()
开发者ID:hmc-lair,项目名称:multitarget_state_estimator,代码行数:26,代码来源:draw.py


示例2: printwin

def printwin(turtle):
  turtle.stamp()
  turtle.hideturtle()
  turtle.penup()
  turtle.goto(0,0)
  turtle.color("green")
  turtle.write("You Win!",font=("Arial",30), align = "center")
开发者ID:LRBeaver,项目名称:PythonGameDev_Trinket,代码行数:7,代码来源:helpercode.py


示例3: show_robot

 def show_robot(self, robot):
     turtle.color("green")
     turtle.shape('turtle')
     turtle.setposition(*robot.xy)
     turtle.setheading(robot.h)
     turtle.stamp()
     turtle.update()
开发者ID:wellfare,项目名称:particle_filter_demo,代码行数:7,代码来源:draw.py


示例4: show_robot

 def show_robot(self, robot):
     turtle.color("blue")
     turtle.shape('square')
     turtle.setposition(*robot.xy)
     turtle.setheading(math.degrees(robot.h))
     turtle.stamp()
     turtle.update()
开发者ID:hmc-lair,项目名称:multitarget_state_estimator,代码行数:7,代码来源:draw.py


示例5: show_robot

 def show_robot(self, robot):
     turtle.color("green")
     turtle.shape('turtle')
     turtle.setposition([robot.x + self.width / 2, robot.y + self.height / 2])
     turtle.setheading(robot.theta / pi * 180.0)
     turtle.stamp()
     turtle.update()
开发者ID:shreeshga,项目名称:gaussian_particlefilter,代码行数:7,代码来源:draw.py


示例6: show_particles

    def show_particles(self, particles):
        self.update_cnt += 1
        if UPDATE_EVERY > 0 and self.update_cnt % UPDATE_EVERY != 1:
            return

        turtle.clearstamps()
        turtle.shape('tri')

        # Particle weights are shown using color variation
        show_color_weights = 1 #len(weights) == len(particles)
        draw_cnt = 0
        px = {}
        for i, p in enumerate(particles):
            draw_cnt += 1
            if DRAW_EVERY == 0 or draw_cnt % DRAW_EVERY == 1:
                # Keep track of which positions already have something
                # drawn to speed up display rendering
                scaled_x = int(p.x * self.one_px)
                scaled_y = int(p.y * self.one_px)
                scaled_xy = scaled_x * 10000 + scaled_y
                if not scaled_xy in px:
                    px[scaled_xy] = 1
                    turtle.setposition([p.x + self.width / 2, p.y + self.height / 2])
                    turtle.setheading(p.theta / pi * 180.0)
                    if(show_color_weights):
                        weight = p.w
                    else:
                        weight = 0.0
                    turtle.color(self.weight_to_color(weight))
                    turtle.stamp()
开发者ID:shreeshga,项目名称:gaussian_particlefilter,代码行数:30,代码来源:draw.py


示例7: show_goal_posts

 def show_goal_posts(self, goal_posts):
     for p in goal_posts:
         turtle.color("#FFFF00")
         turtle.setposition(p[0], p[1])
         turtle.shape("circle")
         turtle.stamp()
         turtle.update()
开发者ID:hendrikvgl,项目名称:RoboCup-Spielererkennung,代码行数:7,代码来源:draw.py


示例8: show_shark

 def show_shark(self, shark):
     turtle.color(shark.color)
     turtle.shape('turtle')
     turtle.setposition(*shark.xy)
     turtle.setheading(math.degrees(shark.h))
     turtle.stamp()
     turtle.update()
开发者ID:hmc-lair,项目名称:multitarget_state_estimator,代码行数:7,代码来源:draw.py


示例9: show_particles

    def show_particles(self, particles):
        self.update_cnt += 1
        if UPDATE_EVERY > 0 and self.update_cnt % UPDATE_EVERY != 1:
            return

        # turtle.clearstamps()
        turtle.shape('tri')

        draw_cnt = 0
        px = {}
        for p in particles:
            draw_cnt += 1
            if DRAW_EVERY == 0 or draw_cnt % DRAW_EVERY == 1:
                # Keep track of which positions already have something
                # drawn to speed up display rendering
                scaled_x1 = int(p.x1 * self.one_px)
                scaled_y1 = int(p.y1 * self.one_px)
                scaled_xy1 = scaled_x1 * 10000 + scaled_y1
                if not scaled_xy1 in px:
                    px[scaled_xy1] = 1
                    turtle.setposition(*p.xy1)
                    turtle.setheading(math.degrees(p.h))
                    turtle.color("Red")
                    turtle.stamp()

                    turtle.setposition(*p.xy2)
                    turtle.setheading(math.degrees(p.h))
                    turtle.color("Blue")
                    turtle.stamp()
开发者ID:hmc-lair,项目名称:multitarget_state_estimator,代码行数:29,代码来源:draw.py


示例10: show_mean

 def show_mean(self, x, y, confident=False):
     if confident:
         turtle.color("#00AA00")
     else:
         turtle.color("#cccccc")
     turtle.setposition(x, y)
     turtle.shape("circle")
     turtle.stamp()
开发者ID:MoonMaker,项目名称:Machine-Learning,代码行数:8,代码来源:draw.py


示例11: show_particles

    def show_particles(self, particles):
        turtle.shape('dot')

        for p in particles:
            turtle.setposition(*p.xy)
            turtle.setheading(p.h)
            turtle.color(self.weight_to_color(p.w))
            turtle.stamp()
开发者ID:ferrix,项目名称:particle_filter_demo,代码行数:8,代码来源:draw.py


示例12: show_particles

 def show_particles(self, particles):
     turtle.clearstamps()
     for p in particles:
         turtle.setposition(*p.xy)
         turtle.setheading(p.h)
         turtle.color(self.weight_to_color(p.w))
         turtle.stamp()
     turtle.update()
开发者ID:gfede,项目名称:particle_filter_demo,代码行数:8,代码来源:draw.py


示例13: serpinski

def serpinski(length, depth):
    if depth > 1:
        t.dot()

    if depth == 0:
        t.stamp()
    else:
        serpinski_draw(length, depth)
        serpinski_draw(length, depth)
        serpinski_draw(length, depth)
开发者ID:linef4ult,项目名称:PythonTeaching2014,代码行数:10,代码来源:recursion1.py


示例14: show_attraction_point

    def show_attraction_point(self, att):
        turtle.color('black')
        turtle.shape('circle')
        turtle.fillcolor("")
        turtle.resizemode("user")
        turtle.shapesize(1.5, 1.5, 1)

        turtle.setposition(att)
        turtle.setheading(0)
        turtle.stamp()
        turtle.update()
开发者ID:hmc-lair,项目名称:multitarget_state_estimator,代码行数:11,代码来源:draw.py


示例15: draw_vertex

 def draw_vertex(self,  domain_name, domain ):
    if len(domain) == 1:
       shape_name = self.colors[ domain[0] ]
    else:
       shape_name = "uncolored"
    
    if shape_name != self.previous_color[domain_name]:
       self.previous_color[domain_name] = shape_name
       position = tuple(map(lambda x: x+0.4, self.positions[domain_name]))
       turtle.shape( shape_name )
       turtle.setposition( position )
       turtle.stamp()
开发者ID:jorgenkg,项目名称:IT3105,代码行数:12,代码来源:visuals.py


示例16: move

def move():
    global x, y, Vsnake, t, cherry
    t = t + 1
    turtle.forward(Vsnake)
    turtle.stamp();

    if cherry > 0:
        cherry = cherry - 1
    else:
        turtle.clearstamps(1)


    turtle.ontimer(move, 100)
开发者ID:bonoxu,项目名称:planeGames,代码行数:13,代码来源:snake_v1.py


示例17: circularSpiral

def circularSpiral(turtle, center, heading, color):
    #draws a circular spiral with a stamped symbol at its center
    turtle.penup()
    turtle.goto(center)
    turtle.pendown()
    turtle.setheading(heading)
    turtle.color(color)
    for k in range(8):
        #draws the stamped symbol by stamping the turtle in 8 different rotated positions
        turtle.stamp()
        turtle.right(45)
    for k in range(130):
        turtle.circle(k, 10 * 3.14)
开发者ID:jyu197,项目名称:comp_sci_101,代码行数:13,代码来源:TurtlePicture.py


示例18: disp

def disp(A, cellsize = 1 / 10.5):
    turtle.clear()
    turtle.shape("square")
    turtle.penup()
    turtle.speed(0)
    turtle.shapesize(0.5, 0.5, 1)
    turtle.ht()
    top = len(A) / cellsize
    left = -len(A[0]) / cellsize
    for r in range(len(A)):
        for c in range(len(A[r])):
            if A[r][c]: 
                turtle.goto(c * 10.5 + left, top - r * 10.5)
                turtle.stamp()
开发者ID:Arvykins,项目名称:61a-sp14-website,代码行数:14,代码来源:13.py


示例19: show_mean

 def show_mean(self, mean):
     # TODO: Delete below assumption about confident
     confident = True
     m1, m2 = mean
     x = 0
     y = 0
     if confident:
         turtle.color("#00AA00")
         turtle.fillcolor("")
     else:
         turtle.color("#cccccc")
         turtle.fillcolor("")
     turtle.setposition(x, y)
     turtle.shape("circle")
     turtle.stamp()
开发者ID:hmc-lair,项目名称:multitarget_state_estimator,代码行数:15,代码来源:draw.py


示例20: stamp_block

def stamp_block():
    """
    Places a block in the center of the canvas.
    """
    ## HINT
    global STAMP_ID
    STAMP_ID = t.stamp()
开发者ID:mysticuno,项目名称:MEETY12015MiniProject,代码行数:7,代码来源:part3.py



注:本文中的turtle.stamp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python turtle.title函数代码示例发布时间:2022-05-27
下一篇:
Python turtle.speed函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap