Table Of Contents

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.

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.

Index to insert the widget in the list. Notice that the default
of 0 means the widget is inserted at the beginning of the list
and will thus be drawn on top of other sibling widgets. For a
full discussion of the index and widget hierarchy, please see
the Widgets Programming Guide.

New in version 1.0.5.

canvas: str, defaults to None

Canvas to add widget’s canvas to. Can be ‘before’, ‘after’ or
None for the default canvas.