Table Of Contents
Scatter Layout¶
New in version 1.6.0.
This layout behaves just like a
RelativeLayout.
When a widget is added with position = (0,0) to a ScatterLayout,
the child widget will also move when you change the position of the
ScatterLayout. The child widget’s coordinates remain
(0,0) as they are relative to the parent layout.
However, since ScatterLayout is implemented using a
Scatter
widget, you can also translate, rotate and scale the layout using touches
or clicks, just like in the case of a normal Scatter widget, and the child
widgets will behave as expected.
In contrast to a Scatter, the Layout favours ‘hint’ properties, such as size_hint, size_hint_x, size_hint_y and pos_hint.
Note
The ScatterLayout is implemented as a
FloatLayout
inside a Scatter.
Warning
Since the actual ScatterLayout is a
Scatter, its
add_widget and remove_widget functions are overridden to add children
to the embedded FloatLayout (accessible as
the content property of Scatter)
automatically. So if you want to access the added child elements,
you need self.content.children instead of self.children.
Warning
The ScatterLayout was introduced in 1.7.0 and was called
RelativeLayout in prior versions.
The RelativeLayout is now an optimized
implementation that uses only a positional transform to avoid some of the
heavier calculation involved for Scatter.
-
class
kivy.uix.scatterlayout.ScatterLayout(**kw)[source]¶ Bases:
kivy.uix.scatter.ScatterScatterLayout class, see module documentation for more information.
-
class
kivy.uix.scatterlayout.ScatterPlaneLayout(**kwargs)[source]¶ Bases:
kivy.uix.scatter.ScatterPlaneScatterPlaneLayout class, see module documentation for more information.
Similar to ScatterLayout, but based on ScatterPlane - so the input is not bounded.
New in version 1.9.0.