Skip to content

Commit

Permalink
Add example of how to use _set_extra_data. (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
AHuynh authored Jun 17, 2024
1 parent e3e2184 commit 5d354b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documentation/custom-portraits.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Different scenes might want to mirror differently (AnimationSprite.flip_h; self.
This is used for correctly sizing your scene, as it's mostly impossible to know the size of your portrait. If you implement this and return a rect2 that covers your portrait (relative to the root node's position), the portrait_containers size modes and the character editors `Full View` will work.

- `_set_extra_data(data: String) -> void` \
The Character event Join/Update mode allows specifying some extra information in the text editor. If some information is given, this method will be called. This can be very useful to enable certain things. For example, your character could have different modes or items.
The Character event Join/Update mode allows specifying some extra information in the text editor. If this extra information is provided, this method will be called. This can be very useful to enable certain things. For example, your character could have different modes or items. Using `CustomPortraitFaceAtlas` under `addons/dialogic/Example Assets/Portraits` as an example, to show the character's alien you can use a Character Update event: `update Character [extra_data="alien"]`.

- `_should_do_portrait_update(character: DialogicCharacter, portrait: String) -> bool` \
Rarely needed, but if overridden, this will be checked if the portrait change is performed to a portrait with the same scene. If you return false, then this instance will be deleted and a new instance will be made. If not implemented, this defaults to true, meaning this instance will be used for the portrait update too.
Expand Down

0 comments on commit 5d354b6

Please sign in to comment.