简体   繁体   中英

Rotate kivy widget

I have a layout scheme more or less like this:

#at build:

float_layout_1 = FloatLayout()
box_layout_1 = BoxLayout()
box_layout_2 = BoxLayout()
float_layout_2 = FloatLayout()
self.image = Image()

float_layout_2.add_widget(self.image)
box_layout_2.add_widget(float_layout_2)
box_layout_1.add_widget(box_layout_2)
float_layout_1.add_widget(box_layout_1)

return float_layout_1

I want to rotate just the Image widget, when I call a function do rotate the image, everything rotates:

#at a internal class method
with self.image.canvas:
    Rotate(angle, a, b, c)

在以相反数量旋转的窗口小部件之后添加另一个旋转,或者将窗口小部件画布包含在PushMatrix (之前)和PopMatrix (之后)指令中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM