-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
Binary file added
BIN
+194 KB
documentation/docs/docs/04-concepts/04-Audience/assets/audience_entries.riv
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
difficulty: Easy | ||
--- | ||
|
||
import RiveBoard from "@site/src/components/RiveBoard"; | ||
|
||
# Audience Entries | ||
|
||
Audience entries are a specific type of [Manifest Entry](./Manifest) that is used to conditionally display content to a group of players. | ||
Players can be in the audience of an entry. | ||
In other words, the content of an audience entry will be displayed to the players in its audience. | ||
|
||
There are two types of Audience entries: | ||
|
||
### Audience Display Entry | ||
|
||
The Audience Display is meant to display content to a group of players. | ||
It can be things like: applying a potion effect, or showing a boss bar. | ||
|
||
### Audience Filter Entry | ||
|
||
Audience Filter entries have a list of children that can include both Audience entries and Audience Filter entries. | ||
They are used as a way to filter the audience of an Audience Display Entry. | ||
|
||
Audience Filters can both: | ||
|
||
#### Filter Players | ||
Filter the audience of itself and its children. Like the `CriteriaAudience`, where players are allowed to be in the audience if they meet the criteria. | ||
|
||
#### Display Content | ||
Display content just like a normal Audience Display Entry, but use the children for the content on what to display. Like the `Sidebar` does with `Lines` entries. | ||
|
||
|
||
# How does filtering work? | ||
|
||
When a player joins the server, they are added to all of the root audience entries. | ||
A root audience entry is an entry that has no parents. | ||
|
||
## Root Entries | ||
|
||
<RiveBoard stateMachines="State Machine 1" artboard="Roots" aspectRatio={500/300} src={require('./assets/audience_entries.riv').default} /> | ||
|
||
|
||
As seen above, any entry that has no parents is a root entry. | ||
The filters can still allow or deny players from being in their own audience. | ||
However, if nothing is linked, they don't influence the audience of other entries. | ||
|
||
## Chaining | ||
|
||
We can chain filter together to create a more complex filter. | ||
Now the player is in the `Display` only if both conditions are met. | ||
|
||
<RiveBoard stateMachines="State Machine 1" artboard="Chained" aspectRatio={500/350} src={require('./assets/audience_entries.riv').default} /> | ||
|
||
Try turning on and off some conditions and see what happens. | ||
|
||
## Multiple Parents | ||
|
||
When an entry has multiple parents, the player is in the audience of the entry if any of the parents allow the player to be in the audience. | ||
|
||
<RiveBoard stateMachines="State Machine 1" artboard="Or" aspectRatio={500/310} src={require('./assets/audience_entries.riv').default} /> | ||
|
||
Try turning on and off some conditions and see what happens. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters