Frame

A Frame is a Scene2D Object in Incari that acts as a 'container' to its children and has rigid boundaries. It is the only Object in Scene2Ds which can be a parent.

Create

When a Frame is created, its boundaries are displayed in green, an example of which can be seen in the image below. It can then be populated with other Objects.

The dimensions of the Frame are provided in its Attributes.

Without any Objects as children, a Frame doesn't look like much:

An Ellipse and Rectangle are now added as children. Notice the Position and Size describe these boundaries numerically. The top-left corner starts at 0,0 and it extends 100 units in both the X and Y-axes. Objects, however, will still appear in full outside the boundaries of the Frame if they happen to not be entirely encapsulated.

Attributes

Find a description of a Frame's crucial Attributes in the sections below.

Hug Content

When Hug Content is toggled on, the size of the Frame is always automatically recalculated to perfectly fit all its elements. If a Layout is used on the Frame and then an Object is added while Hug Content is on, the size of the Frame will increase. The same happens when a Gap or Padding is added.

Layout

The Layout of the Frame can be adjusted to display its children horizontally or vertically. Please note that changing the Layout causes Objects to be placed at their default positions in the Frame. Here the gap between the Ellipse and Rectangle disappears when it is first changed to vertical.

Gap

This Attribute adds a gap between each of the Objects placed in the frame, with the specified distance given by the user.

Padding

This Attribute adds padding to a Frame depending on what sizes are specified and for which sides. The options are t for top, r for right, b for bottom, and l for left. Padding is often seen in the context of CSS. Similarly, in Incari, it is the extra space around elements within the confines of the Frame.

Crop

Crop cuts off all content which is outside of the Frame. However, this only applies to its children and not any unrelated Objects in the Scene2D.

If a child Object (or part of a child Object) is moved outside the boundary of the Frame and Crop is toggled on, the Object (or part of it) will no longer be visible.

Last updated