variables as image file names

65 views
Skip to first unread message

gillian blekkenhorst

unread,
May 18, 2013, 1:06:38 PM5/18/13
to twee...@googlegroups.com
I'm making a game for a jam that I want to have a bunch of images to represent variables. I have tried a bunch of different things but nothing works yet. 


For a basic idea:

<html><div id="turtle"><img src="</html><<print $turtle>><html>.png">
</div></html>

I figure it should be easy if I have the images as the same name as the variable, but I can't figure out how to implement this.

I can make it work with "if" tags, but using so much code for such a simple operation breaks my formatting because of twine insisting extra lines of code means line breaks. Thanks!

Leon Arnott

unread,
May 22, 2013, 5:01:14 AM5/22/13
to twee...@googlegroups.com

Try this: <<print "[img[" + $var + "]]">>

gillian

unread,
May 24, 2013, 11:22:52 AM5/24/13
to twee...@googlegroups.com
That worked!  Thanks so much!


On Wed, May 22, 2013 at 5:01 AM, Leon Arnott <leona...@gmail.com> wrote:

Try this: <<print "[img[" + $var + "]]">>

--
You received this message because you are subscribed to a topic in the Google Groups "Tweecode / Twine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tweecode/K74ni_bNY-E/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to tweecode+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gillian Blekkenhorst
Film & Illustration
http://blekkenhorst.ca

Alex Whitington

unread,
Aug 29, 2013, 10:02:55 PM8/29/13
to twee...@googlegroups.com
Related to this I would still really, really like to know if there's a way to use variables as part of the tags your HTML blocks. I've just spent my night suffering through every way I could think of.
Reply all
Reply to author
Forward
0 new messages