本文整理汇总了Python中turtle.end_fill函数的典型用法代码示例。如果您正苦于以下问题:Python end_fill函数的具体用法?Python end_fill怎么用?Python end_fill使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了end_fill函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: draw_tree
def draw_tree(x,y):
startPosX = x
startPosY = y
turtle.setpos(x,y)
turtle.fillcolor("green")
turtle.begin_fill()
for i in range(0,4):
x -=40
y -=80
turtle.goto(x,y)
coords.append(turtle.pos())
x += 20
turtle.goto(x,y)
bottomCorner = turtle.pos()
x = startPosX
y = startPosY
turtle.setpos(x,y)
for i in range(0,4):
x +=40
y -=80
turtle.goto(x,y)
coords.append(turtle.pos())
x -= 20
turtle.goto(x,y)
turtle.goto(bottomCorner)
turtle.end_fill()
开发者ID:nyep,项目名称:learning-prog,代码行数:26,代码来源:turtleTree+[WIP].py
示例2: draw_star
def draw_star(size, color):
turtle.pendown()
turtle.begin_fill()
turtle.color(1,1,1)
turtle.forward(2.5)
turtle.left(size)
turtle.forward(2.5)
turtle.right(144)
turtle.forward(2.5)
turtle.left(size)
turtle.forward(2.5)
turtle.right(144)
turtle.forward(2.5)
turtle.left(size)
turtle.forward(2.5)
turtle.right(144)
turtle.forward(2.5)
turtle.left(size)
turtle.forward(2.5)
turtle.right(144)
turtle.forward(2.5)
turtle.left(size)
turtle.forward(2.5)
turtle.right(144)
turtle.end_fill()
turtle.penup()
开发者ID:mukasama,项目名称:portfolio,代码行数:27,代码来源:Project++04.py
示例3: draw_circle
def draw_circle(x,y):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
开发者ID:roni16-meet,项目名称:MEET-YL1,代码行数:7,代码来源:paint.py
示例4: block
def block( x, y, width, height, fill, color ):
goto( x, y )
print 'block(): drawing block of size', width, height
# tell the turtle to go foward by width
# tell the turtle to turn left by 90 degrees
# tell the turtle to go forward by height
# tell the turtle to turn left by 90 degrees
# repeat the above 4 commands
# if the parameter fill is true then do this
if fill == "True":
''' draw a block at position (x,y) with the
given width and height, and fill with
the color '''
t.begin_fill()
t.color(color)
for i in range(2):
t.forward(width)
t.left(90)
t.forward(height)
t.left(90)
t.end_fill()
# if the parameter fill is false then do this
else:
''' draw a block at position (x,y) with the
given width and height, and fill with
the color '''
for i in range(2):
t.forward(width)
t.left(90)
t.forward(height)
t.left(90)
开发者ID:akaralekas,项目名称:cs151-colby,代码行数:33,代码来源:better_shapelib.py
示例5: grass
def grass( x, y, scale ):
'''draws a huge blue square given location and scale'''
t.tracer(False)
t.begin_fill()
t.color('green')
buildingblock(x-1000*scale, y-1000*scale, 2000*scale, 1075*scale)
t.end_fill()
开发者ID:akaralekas,项目名称:cs151-colby,代码行数:7,代码来源:better_shapelib.py
示例6: circunferencia
def circunferencia(simbolos,identificador,linea):
p1= obtener_punto(2,identificador,simbolos)
radio = obtener_radio(identificador,simbolos)
x1 = obtener_x(p1,simbolos)
y1 = obtener_y(p1,simbolos)
escalar = obtener_escalar(identificador, simbolos,linea)
relleno = obtener_color(obtener_relleno(identificador,simbolos,linea))
borde = obtener_color(obtener_borde(identificador,simbolos,linea))
turtle.color(borde)
if escalar == 0:
escalar=1
tx = obtener_tx(identificador, simbolos,linea)
ty = obtener_ty(identificador, simbolos,linea)
turtle.pensize(8)
turtle.penup()
#Trasladar circunferencia
x1 = x1 + tx
y1 = y1 + ty
#turtle.setposition(x1, y1-(radio*44))
#turtle.pendown()
#turtle.circle(radio*44)
#Escalar circunferencia
turtle.penup()
#turtle.setposition(x1, y1-(radio*44*escalar))
turtle.setposition(x1*44, (y1*44)-(radio*44*escalar))
turtle.pendown()
turtle.fillcolor(relleno)
turtle.begin_fill()
turtle.circle(radio*44*escalar)
turtle.end_fill()
开发者ID:joenco,项目名称:compiladorg,代码行数:35,代码来源:figuras.py
示例7: star
def star( x, y, scale, fill, color ):
'''draws a star given location, scale, and color'''
goto( x, y )
if fill == "True":
'''if the scale is 1, and fill == True
then this function will draw a star
with its left point at (x,y) and
will have star ray lengths of 50
and filled with the color given'''
t.begin_fill()
t.color(color)
for i in range(10):
t.forward(50*scale)
t.right(108)
t.forward(50*scale)
t.left(144)
t.end_fill()
else:
'''if the scale is 1, and fill == False
then this function will draw a star
with its left point at (x,y) and
will have star ray lengths of 50
and with no color fill'''
t.begin_fill()
for i in range(10):
t.forward(50*scale)
t.right(108)
t.forward(50*scale)
t.left(144)
开发者ID:akaralekas,项目名称:cs151-colby,代码行数:30,代码来源:better_shapelib.py
示例8: drawCircleAt
def drawCircleAt(turtleX, turtleY, circleSize):
turtle.penup()
turtle.goto(turtleX,turtleY)
turtle.pendown()
turtle.begin_fill()
turtle.circle(circleSize)
turtle.end_fill()
开发者ID:cparker,项目名称:pythonclub,代码行数:7,代码来源:one.py
示例9: draw_rectangle
def draw_rectangle():
Fline = line.split()
if Fline[1] == 'not_int':
print(Fline)
print("I'm sorry, I cannot understand that integer")
return
if len(Fline) < 4:
print(Fline)
print("I'm sorry, I do not understand that value")
return
x = int(Fline[1])
y = int(Fline[2])
width = int(Fline[3])
height = int(Fline[4])
turtle.penup()
turtle.setpos(x, y)
turtle.setheading(0)
turtle.pendown()
turtle.begin_fill()
turtle.forward(width)
turtle.setheading(-90)
turtle.forward(height)
turtle.setheading(180)
turtle.forward(width)
turtle.setheading(90)
turtle.forward(height)
turtle.end_fill()
开发者ID:thatsmysky,项目名称:Python-Program-Four,代码行数:27,代码来源:PROGRAM+4+CODE.py
示例10: drawHead
def drawHead(circum, colour="yellow"):
#turtle.pencolor("yellow")
turtle.color("black", colour)
turtle.begin_fill()
drawCircle(circum)
turtle.end_fill()
开发者ID:rckc,项目名称:CoderDojoUWA2016,代码行数:7,代码来源:ManyFaces.py
示例11: draw_vertrect
def draw_vertrect(length,width,color):
turtle.pendown()
turtle.color(color)
turtle.begin_fill()
#uses color to determine length of cross
if(color=="blue" or color == "red" or color == "light coral" or color=="yellow"):
length*=.4375
elif(color == "snow"or color=="navy" ):
length*=.42857
else:
length*=.375
print("the length of the first " , length, " and the width is ", width)
#loops to draw vertical rectangle
for x in range(5):
if(x%5==0):
#draws first half of left vertical line
turtle.forward((length))
print("drawing length")
#draws from top of vertical to bottom of flag
elif(x%2==0):
turtle.forward(length*2+width)
print("drawing long side")
#draws small side of vertical rectangle
elif(x!=5):
turtle.forward(width)
turtle.right(90)
turtle.end_fill()
开发者ID:joshbenner851,项目名称:CSE231,代码行数:27,代码来源:proj06.py
示例12: draw_rectangle
def draw_rectangle(x,y,width,height):
"""
Draws a rectangle with the upper left hand corner starting at point (x,y).
The said rectangle has the dimensions width x height.
:param x:
:param y:
:param width:
:param height:
:return: None
"""
turtle.penup()
turtle.setx(x)
turtle.sety(y)
turtle.pendown()
turtle.setheading(0) # Set heading in x+ direction
turtle.begin_fill()
turtle.begin_poly()
turtle.fd(width)
turtle.right(90)
turtle.fd(height)
turtle.right(90)
turtle.fd(width)
turtle.right(90)
turtle.fd(height)
turtle.end_poly()
turtle.end_fill()
return None
开发者ID:brendanoconnor913,项目名称:pythonwork,代码行数:27,代码来源:Assignment4-turtlegraphics.py
示例13: draw_leaf
def draw_leaf(no_of_leafs):
"""
Draws leafs at the end of branch. Min 0 and max = no_of_leafs
:pre: pos(0,0), heading east, up
:post: pos(0,0), heading east, up
:param no_of_leafs: maximum number of leads drawn
:return: None
"""
for i in range(no_of_leafs):
# draws random poylgon from triangle to hexagon
sides = random.randint(3, 6)
color = random.choice(COLORS)
size = 10
angle = 360/sides
t.left(90 - i * angle)
t.right(90)
t.begin_fill()
t.down()
t.color(color)
for _ in range(sides):
t.forward(size)
t.left(angle)
t.left(90)
t.up()
t.end_fill()
t.right(90 - i * angle)
global LEAF_COUNTER
LEAF_COUNTER += 1
开发者ID:AnushaBalusu,项目名称:PythonCodes,代码行数:29,代码来源:enhanced_tree.py
示例14: drawFins
def drawFins(size):
turtle.fillcolor("red")
turtle.setheading(90)
turtle.begin_fill()
turtle.forward(0.2*size)
turtle.left(120)
turtle.forward(0.6*size)
turtle.right(120)
turtle.forward(0.3*size)
turtle.right(40)
turtle.forward(0.8*size)
turtle.end_fill()
turtle.setheading(0)
turtle.begin_fill()
turtle.penup()
turtle.forward(size)
turtle.pendown()
turtle.begin_fill()
turtle.right(50)
turtle.forward(0.8*size)
turtle.right(40)
turtle.forward(0.3*size)
turtle.right(120)
turtle.forward(0.6*size)
turtle.end_fill()
开发者ID:rckc,项目名称:CoderDojoUWA2016,代码行数:29,代码来源:Peter+-+Space+Rocket.py
示例15: dope_flowers
def dope_flowers(x, y):
turtle.pendown()
turtle.begin_fill()
move(turtle, 100)
flower(turtle, 10, 20.0, 60.0)
turtle.end_fill()
turtle.penup()
开发者ID:TeenFAQ,项目名称:omgglaura.github.io,代码行数:7,代码来源:flowers.py
示例16: drawPoint
def drawPoint(x, y):
turtle.penup() # Pull the pen up
turtle.goto(x, y)
turtle.pendown() # Pull the pen down
turtle.begin_fill() # Begin to fill color in a shape
turtle.circle(3)
turtle.end_fill() # Fill the shape
开发者ID:EthanSeaver,项目名称:Python-Projects,代码行数:7,代码来源:UsefulTurtleFunctions.py
示例17: pythagoras_tree
def pythagoras_tree(size, n):
turtle.begin_fill()
for _ in range(4):
turtle.forward(size)
turtle.left(90)
turtle.end_fill()
if n > 0:
roof = .5 * math.sqrt(2) * size
turtle.left(90)
turtle.forward(size)
turtle.right(45)
pythagoras_tree(roof, n - 1)
turtle.forward(roof)
turtle.right(90)
pythagoras_tree(roof, n - 1)
turtle.left(90)
turtle.backward(roof)
turtle.left(45)
turtle.backward(size)
turtle.right(90)
开发者ID:greut,项目名称:turtle-and-l-system,代码行数:26,代码来源:10_01_pythagoras_tree.py
示例18: rand_circle
def rand_circle():
color = choice(colors)
turtle.color(color, color)
radius = randint(10, 100)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
开发者ID:lvidarte,项目名称:python-raspberry,代码行数:7,代码来源:turtle-4.py
示例19: drawmountain
def drawmountain(x,y,color):
t.up
t.goto(x,y)
t.down
t.color(color)
t.begin_fill()
t.backward(200)
t.right(120)
t.backward(200)
t.right(120)
t.backward(200)
t.right(120)
t.end_fill()
t.up
t.goto(x-75,y+125)
t.down
t.color("White")
t.begin_fill()
t.backward(50)
t.right(120)
t.backward(50)
t.right(120)
t.backward(50)
t.right(120)
t.end_fill()
t.up
开发者ID:ccasey645,项目名称:OldMachine,代码行数:27,代码来源:drawchristmas.py
示例20: cross
def cross( x, y, scale, color ):
'''draws a cross given location, scale, and color'''
goto( x, y )
turtle.begin_fill()
turtle.color(color)
turtle.forward(50*scale)
turtle.right(90)
turtle.forward(50*scale)
turtle.left(90)
turtle.forward(15*scale)
turtle.left(90)
turtle.forward(50*scale)
turtle.right(90)
turtle.forward(50*scale)
turtle.left(90)
turtle.forward(15*scale)
turtle.left(90)
turtle.forward(50*scale)
turtle.right(90)
turtle.forward(50*scale)
turtle.left(90)
turtle.forward(15*scale)
turtle.left(90)
turtle.forward(50*scale)
turtle.right(90)
turtle.forward(50*scale)
turtle.left(90)
turtle.forward(15*scale)
turtle.end_fill()
开发者ID:akaralekas,项目名称:cs151-colby,代码行数:29,代码来源:shapelib.py
注:本文中的turtle.end_fill函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论