You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/overview_scene.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Structure of a Scene
2
2
3
-
A `Scenic.Scene` is a `GenServer` process which creates and manages a [Graph](overview_graph.html) that gets drawn to the screen. Scenes also respondss to user input and other events.
3
+
A `Scenic.Scene` is a `GenServer` process which creates and manages a [Graph](overview_graph.html) that gets drawn to the screen. Scenes also respond to user input and other events.
4
4
5
5
Scenes can reference each other, creating a logical hierarchy that lives above
6
6
the Graphs themselves. This allows scenes to be reusable, small, and simple. A
@@ -11,7 +11,7 @@ Scenes that are specifically meant to be reused are called components.
11
11
Components have sugar apis that make them very easy to use inside of a parent
12
12
scene.
13
13
14
-
For example, if you create a dashboard. It may have buttons, text input,
14
+
For example, if you create a dashboard, it may have buttons, text input,
15
15
sliders, or other input controls in it. Each of those controls is a component
16
16
scene that is dynamically created when the dashboard scene is started. This
17
17
collection of scenes forms a graph, which can be quite deep (scenes using scenes
@@ -30,7 +30,7 @@ defines what is to be drawn to the screen, any referenced components, and the
30
30
overall draw order. When the Scene decides the graph is ready to be drawn to the
31
31
screen, it pushes it to the Viewport.
32
32
33
-
In general, a graph is immutable data structure that you manipulate through
33
+
In general, a graph is an immutable data structure that you manipulate through
34
34
transform functions. In the example below `Graph.build()` creates an empty
35
35
graph, which is piped into functions that add things to it. The `text/3`
36
36
function accepts a graph, adds some text to it, then applies a list of options
@@ -130,7 +130,7 @@ option | description
130
130
----------- | -----------
131
131
`:id` | If this scene is a component, then the id that was assigned to its reference in the parent's graph is passed in as the `:id` option. Typically, controls that generate and send events to its parent scene use this id to identify themselves. If this is the root scene, the id will not be set.
132
132
`:styles` | This is the map of styles inherited from the parent graph. The scene can use these styles (or not) as makes sense for its needs.
133
-
`:viewport` | This is gives the pid of the viewport running this scene. It is very useful if you want to generate input or change the currently showing scene. If you are managing the scene in your own supervisor, it will not be set. See [life-cycle of a scene](scene_lifecycle.html) for more information.
133
+
`:viewport` | This gives the pid of the viewport running this scene. It is very useful if you want to generate input or change the currently showing scene. If you are managing the scene in your own supervisor, it will not be set. See [life-cycle of a scene](scene_lifecycle.html) for more information.
134
134
135
135
## Pushing a Graph
136
136
@@ -183,7 +183,7 @@ event that you handle.
183
183
## User Input
184
184
185
185
A Scene also responds to messages. The two types of messages Scenic will send to
186
-
scene are user input, and events.
186
+
the scene are user input and events.
187
187
188
188
## Events
189
189
@@ -198,7 +198,7 @@ to use from within another scene. To make a component, call the
198
198
`use Scenic.Component` macro instead of the Scene version.
199
199
200
200
You will then need to add `info/0` and `verify/1` callbacks. The `verify/1`
201
-
accepts the `scene_args`parameter that will be passed to the `init/2` function,
201
+
accepts the `scene_args`parameter that will be passed to the `init/2` function
202
202
and verifies that it is correctly formatted. If it is correct, return
203
203
`{:ok, data}`. If it is not ok, return `:invalid_data`.
204
204
@@ -274,5 +274,5 @@ With helper functions, the above graph would be re-written like this:
274
274
## What to read next?
275
275
276
276
Next, you should read about the [life-cycle of a scene](scene_lifecycle.html).
277
-
This will explain how scenes get started, when the stop, and how they relate to
278
-
each other.
277
+
This will explain how scenes get started, when they stop, and how they relate to
Copy file name to clipboardExpand all lines: guides/overview_styles.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Styles are optional modifiers that you can put on any primitive. Each style does a specific thing and some only affect certain primitives.
4
4
5
-
There is a fixed list of primitives styles, which are understood by the drivers. Some Components may introduce their own optional styles, but the only ones sent down to the drivers for rendering is the list below.
5
+
There is a fixed list of primitive styles which are understood by the drivers. Some Components may introduce their own optional styles, but the only ones sent down to the drivers for rendering are contained in the list below.
6
6
7
7
In general, the primitive styles are each defined in their own module, but you apply them as options in a primitive's option list.
8
8
@@ -34,7 +34,7 @@ The `Fill` and `Stroke` styles accept a paint type. This describes what to fill
34
34
35
35
There is a fixed set of paint types that the drivers know how to render.
36
36
37
-
*[`BoxGradient`](Scenic.Primitive.Style.Paint.BoxGradient.html) fills an primitive with a box gradient.
37
+
*[`BoxGradient`](Scenic.Primitive.Style.Paint.BoxGradient.html) fills a primitive with a box gradient.
38
38
*[`Color`](Scenic.Primitive.Style.Paint.Color.html) fills a primitive with a solid color.
39
39
*[`Image`](Scenic.Primitive.Style.Paint.Image.html) fills a primitive with an image that is loaded into `Scenic.Cache`.
40
40
*[`LinearGradient`](Scenic.Primitive.Style.Paint.LinearGradient.html) fills a primitive with a linear gradient.
Copy file name to clipboardExpand all lines: guides/scene_lifecycle.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Life-cycle of a Scene
2
2
3
-
A very important part of Scenic is the Scene life-cycle management. Most scenes' live-cycles will be managed automatically by their [ViewPort](overview_viewport.html). The ViewPort determines when to start and stop these dynamic scenes.
3
+
A very important part of Scenic is the Scene life-cycle management. Most scenes' life-cycles will be managed automatically by their [ViewPort](overview_viewport.html). The ViewPort determines when to start and stop these dynamic scenes.
4
4
5
5
In effect, when you create a graph and add components like `button`, `checkbox` and more, you are doing more than just saying, "Draw a button here". You instructing the `ViewPort` how and when to start and stop the processes that drive those components.
0 commit comments