Scenic.Primitive.Group (Scenic v0.11.0-beta.0) View Source

A container to hold other primitives.

Any styles placed on a group will be inherited by the primitives in the group. Any transforms placed on a group will be multiplied into the transforms in the primitives in the group.

Data

uids

The data for an arc is a list of internal uids for the primitives it contains.

You will not typically add these ids yourself. You should use the helper functions with a callback to do that for you. See Usage below.

Styles

The group is special in that it accepts all styles and transforms, even if they are non-standard. These are then inherited by any primitives, including SceneRefs.

Any styles you place on the group itself will be inherited by the primitives contained in the group. However, these styles will not be inherited by any component in the group.

Transforms

If you add a transform to a group, then everything in the group will also be moved by that transform, including child components. This is a very handy way to create some UI, then position, scale, or rotate it as needed without having to adjust the inner elements.

Usage

You should add/modify primitives via the helper functions in Scenic.Primitives

graph
  |> group( fn(g) ->
    g
    |> rect( {200, 100}, fill: :blue )
    |> test( "In a Group", fill: :yellow, translate: {20, 40} )
  end,
  translate: {100, 100},
  font: :roboto
)

Link to this section Summary

Functions

Returns a list of styles recognized by this primitive.

Link to this section Types

Specs

styles_t() :: [:hidden | :scissor | atom()]

Specs

t() :: [pos_integer()]

Link to this section Functions

Link to this function

insert_at(p, index, uid)

View Source

Specs

valid_styles() :: [:hidden, ...]

Returns a list of styles recognized by this primitive.