Answer (Panel): Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
(Created page with "{{stub}} A panel can be given "answers". These are buttons that are added to a panel and allow the end-user to close the panel by selecting from the specified options. These...")
 
No edit summary
 
(12 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{stub}}
A [[Panel]] can be given Answers. These are buttons that are added to a [[Panel]] and allow the end-user to close the [[Panel]], and at the same time trigger one or more [[Event]]s in the [[Session]].


A panel can be given "answers". These are buttons that are added to a panel and allow the end-user to close the panel by selecting from the specified options. These "answers" can be further supplemented through the attachment of [[event]]s. When the user selects an "answer" that has one or more events attached to it, these events will get fired (triggered) and will affect the session accordingly.
==When to use==
Answers can be used to provide an additional way to interact with the [[Session]]. They are always used as an additional function of [[Panel]]s. A [[Panel]] provides information and if Answers are added to a [[Panel]] the end-user can act on the provided information by selecting one of the Answers.


===Adding/removing answers===
Panels can always be closed by clicking on their "X" on the top right of their window. For this reason, Answers should not be used for restrictive control-flow of a user's actions.
{{Editor location|Panels|Panel}}


{{Editor steps|title=add an answer to a panel|Select the panel you wish to add an answer to in the [[left panel]].|Select "Add Answer".}}
===Answers as part of Template Panels===
When an Answer is attached to a [[Template Panel]], it is part of the properties that are carried over to its instances. The name is kept verbatim. The [[Event]]s are copied over intelligently. Specifically, if the [[Event]] has as one of its parameters an [[Item]] of the type which the [[Template Panel]] is applied to, then the [[Event]] of the instance created will have that parameter refer to the item the instance belongs to. For example, if the Answer has a NEIGHBORHOOD_SET_ATTRIBUTE [[Event]], and the [[Template Panel]] is applied to [[Neighborhood]]s, then each instanced [[Panel]] will relate to a specific [[Neighborhood]], and the NEIGHBORHOOD_SET_ATTRIBUTE [[Event]] of that [[Panel]] will be configured to change an [[Attribute]] of that specific [[Neighborhood]].


{{Editor steps|title=remove an answer from a panel|Select the answer you wish to remove.|Select "Remove".}}
==Properties==
Answers have a number of properties, which can be configured in the Editor. They define the Answer's text and its effects.


===Configuring answers===
; Name
{{Editor location|Panels|Answer of a panel}}
: When the Answer is displayed, this is the text on the button. Note that Answers can have the same name as other Answers.


When selecting an ''answer'', a number of properties can be configured in the [[right panel]].
; Events
: These are the [[Event]]s fired when this Answer is chosen.


[[File:panels-right-answer.jpg|framed|left|The [[right panel]] for panel ''answers'' in the editor.]]
{{article end
 
|notes=
{| class="wikitable"
* A [[Panel]] can have at most 10 Answers.
|-
* Answers provide a simple way to add interactivity to a [[Panel]]. However, users who are well-versed in [[HTML]], [[CSS]], and [[Javascript]] may find more flexibility in creating their own [[HTML]] elements to facilitate interaction.
! Property
|howtos=
! Description
* [[How to add an Answer to a Panel]]
! Example
* [[How to add an Event to an Answer of a Panel]]
|-
|seealso=
| Answer Text
* [[Panel]]
| This text will be displayed to the end user if the panels is opened and form one of the selectable options in the case of multiple ''answers''.
}}
| [[File:panels-right-answer-name.jpg|center|Input field for the ''answer'' text.]]
|-
| Events
| One or more events can be coupled to this answer, which will then be fired (triggered) upon selecting this answer. The events are divided into 'server events' and 'client events'. Server events will also trigger changes in the state of the [[session]], whereas client events will only affect the visualization for the end user who selected the answer.
''{{:Editing Events}}
| [[File:panels-right-answer-events.jpg|center|The events fired when the ''answer'' is selected.]]
|}
 
{{clear}}
 
===Answers as part of template panels===
Template panels can also have ''answers'' attached to them, which will then also apply to all of its instances. In the case that a template panel has a specific target object (e.g., NEIGHBORHOODS) and one of the ''answers'' features an event (e.g., NEIGHBORHOOD_SET_ATTRIBUTE), the event will only affect the specific target object it was created for.

Latest revision as of 10:25, 2 March 2023

A Panel can be given Answers. These are buttons that are added to a Panel and allow the end-user to close the Panel, and at the same time trigger one or more Events in the Session.

When to use

Answers can be used to provide an additional way to interact with the Session. They are always used as an additional function of Panels. A Panel provides information and if Answers are added to a Panel the end-user can act on the provided information by selecting one of the Answers.

Panels can always be closed by clicking on their "X" on the top right of their window. For this reason, Answers should not be used for restrictive control-flow of a user's actions.

Answers as part of Template Panels

When an Answer is attached to a Template Panel, it is part of the properties that are carried over to its instances. The name is kept verbatim. The Events are copied over intelligently. Specifically, if the Event has as one of its parameters an Item of the type which the Template Panel is applied to, then the Event of the instance created will have that parameter refer to the item the instance belongs to. For example, if the Answer has a NEIGHBORHOOD_SET_ATTRIBUTE Event, and the Template Panel is applied to Neighborhoods, then each instanced Panel will relate to a specific Neighborhood, and the NEIGHBORHOOD_SET_ATTRIBUTE Event of that Panel will be configured to change an Attribute of that specific Neighborhood.

Properties

Answers have a number of properties, which can be configured in the Editor. They define the Answer's text and its effects.

Name
When the Answer is displayed, this is the text on the button. Note that Answers can have the same name as other Answers.
Events
These are the Events fired when this Answer is chosen.

Notes

  • A Panel can have at most 10 Answers.
  • Answers provide a simple way to add interactivity to a Panel. However, users who are well-versed in HTML, CSS, and Javascript may find more flexibility in creating their own HTML elements to facilitate interaction.

How-to's

See also