Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Sugarcube 2.7.0 Is it possible to set an image as a variable?

$
0
0
Hello All,

In the game I'm working on, I'm having the player write their team name and choose an icon to represent that team.

So far, I've got:
What is your team name?
<<textbox "$team.name" "">>

Choose a symbol to represent your team:

<<click [img[images/01.png]]>><<set $team.icon to '<img src="01.png" />'>>
<</click>><<click [img[images/02.png]]>><<set $team.icon to '<img src="02.png" />'>>
<</click>>

I'm setting up the widget macro so that it displays the team name and icon along the top of the story throughout the duration, like this:
<<set $team to {
	name : "",
	icon : ""
}>>
	
<<widget "stats">>\
$team.icon <b>@@.emboss;<h1>$team.name</h1>@@
...

The image displays just fine, and when I clicked on the image and set the $team.icon to text, it displayed no problem. Is it possible to have an image stored as a variable? Or is my syntax just off? Thank you!

Viewing all articles
Browse latest Browse all 1844

Trending Articles