View Source Scenic.Primitive.Group (Scenic v0.11.2)
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
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
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
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
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
@type styles_t() :: [:hidden | :scissor | atom()]
@type t() :: [pos_integer()]
Link to this section Functions
@spec valid_styles() :: [:hidden, ...]
Returns a list of styles recognized by this primitive.