파이썬[Python]: kivy - Label 인스턴스 (core)
kivy.core.text 모듈 - Label 객체(Instance)
/// 설명
텍스트를 표현하는 core 인스턴스입니다.
참고: animation to gesture 모듈 목록
※ 형식
Label
reference
https://kivy.org/doc/stable/api-kivy.core.text.html
참고: animation to gesture 모듈 목록
※ 형식
Label
reference
https://kivy.org/doc/stable/api-kivy.core.text.html
/// 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | import kivy kivy.require('2.0.0') from kivy.app import App from kivy.core.window import Window from kivy.core.text import Label as CLabel from kivy.uix.floatlayout import FloatLayout from kivy.graphics import Color, Rectangle, Rotate Window.clearcolor = (.6, 1, .8, 1) Window.size = (563, 1001) Window.top, Window.left = 30, 700 class FantasticApp(App): def build(self): fl = FloatLayout(size=Window.size) cim = CLabel(text='____rotate____', font_size=30) cim.refresh() fl.canvas.before.add(Color(0, 0, 0, 1)) fl.canvas.before.add(Rotate(angle=45, origin=fl.center)) fl.canvas.before.add(Rectangle(texture=cim.texture, pos=fl.center, size=cim.texture.size)) fl.canvas.before.add(Rotate(angle=90, origin=fl.center)) fl.canvas.before.add(Rectangle(texture=cim.texture, pos=fl.center, size=cim.texture.size)) fl.canvas.before.add(Rotate(angle=90, origin=fl.center)) fl.canvas.before.add(Rectangle(texture=cim.texture, pos=fl.center, size=cim.texture.size)) fl.canvas.before.add(Rotate(angle=90, origin=fl.center)) fl.canvas.before.add(Rectangle(texture=cim.texture, pos=fl.center, size=cim.texture.size)) return fl FantasticApp().run() | cs |
/// 출력
* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)
– 당신을 응원합니다. –
댓글
댓글 쓰기