python - Kivy understand self.pos and self.size -
whenever try span canvas across layout, have this
<floatlayout>: canvas: color: rgba: 54 / 255, 60 / 255, 72 / 255, 1 rectangle: pos: self.pos size: self.size
i have been playing around , fail understand self.pos referring to? reading documentation seems points current widget should rectangle. when enter debug mode, notice default value of self.size (100, 100).
rectangle not widget, it's canvas instruction, widget representation (a set of canvas instructions) + behavior (various methods 'on_touch_down'). in kv, self designate current widget, here, floatlayout.
widget's default size indeed '(100, 100)' it's default any.
Comments
Post a Comment