Quantcast
Channel: Twine Forum
Viewing all articles
Browse latest Browse all 3830

Display image with click or button

$
0
0
Hello,
First a quick big thx to all the members who ask and answer here, the forum is a real gold mine. Just started twine a short week ago and i and found so much useful informations thanks to all of you. Among all, big thx to GreyElf and TheMadExile.

As i said, i only started a week ago with 0 knowledge in code or whatever, i managed to learn a lot and found myself or with the help of the forum answers/twine documentation, solutions to most of my problems.
But i'm stuck on something simple.


Ok, so now here is my question:
I want an hidden image (image link) inside a passage to be displayed when the player press a "show" button.
(Note; i'm on sugarcube)

I will this illustrate with a exemple:

I have a passage with text, at some point in this passage, the player meet a character, who give him a map of the place (as an image).
At this moment i want to make a button for the player, so he can "display" the map (the image).

why not making the image link directly visible in the passage ? I don't want the player, when he open the passage to spoil himself, and see the map below before i'm sure he have fully read the text before.

What i already tried;
In the main passage:

-I made a <<button "show">> <img src="image-link.jpg"> <</button>> doesn't work, same with <<click>><</click>>

-I made a <<button "show">> [img[image-link.jpg]] <</button>> doesn't work

-I made a <<button "show">> <<display [[PassageImage]]>> <</button>>
Where [[PassageImage]] is a second passage with written in it : <img src="image-link.jpg">
But, display work with text and macros, but don't show the image either, so it doesn't work.

-I made a a the start of the passage a <<set $visible to 0>> where the variable $visible work as an on/off value 1 for on, 0 for off.
Then:
<<button "show">> <<set $visible to 1>> <</button>>
<<if $visible is 1>> <img src="image-link.jpg"> <<endif>> and still doesn't work. As i understand this method, twine just read from top to bottom then stop, if i press the "show" button it only execute that part of the macro and not the <<if>> so it won't update its statut.

-I fell on a post in the forum i can't seem to find again, with someone mentioning a "span id box" or something as an alternative to display an image, but i'm still at level 0 with css (only thing i know how to use is the <span class="colorid">
to change font color).

And i'm here..., if anyone have any (simple) idea to solve my problem.

Thank you, and sorry for my english :)

Viewing all articles
Browse latest Browse all 3830

Trending Articles