0 votes
asked by (350 points)
Well the question tells it all

2 Answers

0 votes
answered by (4.4k points)
Do you mean having a button in the header or something and bringing up a screen with all the characters stats?
commented ago by (350 points)
yes,but i want a smaller screen which appears on top of the main screen
+1 vote
answered by (109k points)

If you are asking how to add a menu item to the left side-bar that opens a passage that displays the characters stats then you can do that by adding the StoryMenu special passage to your project and place a link to your Stats passage in it.

[[Stats]]


You have two options when it comes to exiitng your Stats passage, you can either use the Undo navigator button found at the top of the left sode-bar or you can include a "Return" link in your Stats passage.

If you choose to add a "Return" link then you will likely want that link to always return the reader to the last non-menu related passage they were viewing. To do this you will need to do the following.

1. Edit your Stats passage and assign it a menu Passage Tag, then add the following link to the content of the passage.

<<link "Return" $return>><</link>>


2. Add the following code to your project's Story Javascript area, it updates a $returns story variable if the current passage being shown doesn't include a menu passage tag.

predisplay['set-return'] = function (taskName) {
	if (!tags().includes('menu')) {
		State.variables.return = State.passage;
	}
};


3. If you add other menu related passage to your project then you will need to also assign them a menu passage tag.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...