SizeLock

SizeLock "locks" the size of a node, limiting the amount of space it will use from the space it is given.

Size locks are extremely useful for responsible applications, as they can make sure the content doesn't span too much space on large screens. For example, a width limit can be set with sizeLimitX, preventing nodes from spanning the entire width of the screen.

Constructors

this
this(T args)
Undocumented in source.

Members

Functions

resizeImpl
void resizeImpl(Vector2 space)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

limit
SizeLimit limit;

The maximum size of this node. If a value on either axis is 0, limit will not be applied on the axis.

sizeLimit
FloatSizeLimit sizeLimit;

The maximum size of the node.

Examples

import fluid;

// The frame will appear horizontally-centered in the parent node,
// and will fill it vertically
sizeLock!vframe(
    .layout!(1, "center", "fill"),
    .sizeLimitX(400),
    label("Hello, World!")
);

Meta