本文整理汇总了Python中caca.canvas.Canvas.rotate_left方法的典型用法代码示例。如果您正苦于以下问题:Python Canvas.rotate_left方法的具体用法?Python Canvas.rotate_left怎么用?Python Canvas.rotate_left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类caca.canvas.Canvas
的用法示例。
在下文中一共展示了Canvas.rotate_left方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from caca.canvas import Canvas [as 别名]
# 或者: from caca.canvas.Canvas import rotate_left [as 别名]
def main():
""" Main function. """
try:
pig = Canvas(0, 0)
pig.import_from_memory(STRING, "text")
cv = Canvas(pig.get_width() * 2, pig.get_height() * 2)
except CanvasError as err:
sys.stderr.write("%s\n" % err)
sys.exit(2)
cv.blit(0, 0, pig, NullCanvas())
pig.flip()
cv.blit(pig.get_width(), 0, pig, NullCanvas())
pig.flip()
pig.flop()
cv.blit(0, pig.get_height(), pig, NullCanvas())
pig.flop()
pig.rotate_180()
cv.blit(pig.get_width(), pig.get_height(), pig, NullCanvas())
for j in range(0, cv.get_height()):
for i in range(0, cv.get_width(), 2):
cv.set_color_ansi(caca.COLOR_LIGHTBLUE + (i + j) % 6,
caca.COLOR_DEFAULT)
a = cv.get_attr(-1, -1)
cv.put_attr(i, j, a)
cv.put_attr(i+1, j, a)
print("%s" % cv.export_to_memory('utf8'))
cv.rotate_left()
print("%s" % cv.export_to_memory('utf8'))