Quick search

Table Of Contents

Scatter Layout

New in version 1.6.0.

This layout behaves just like a RelativeLayout. For example, if you create a ScatterLayout, add a widget with position = (0,0), the child widget will also move when you change the position of the ScatterLayout. The child widget’s coordinates remain (0,0), i.e. they are relative to the containing layout.

However, since ScatterLayout is implemented using a Scatter widget, you can also translate, rotate and scale the layout using touches (mouse or fingers) just like 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.Scatter

RelativeLayout class, see module documentation for more information.