intfiction.org

The Interactive Fiction Community Forum
It is currently Wed May 22, 2013 12:07 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Mar 14, 2012 9:28 am 
Offline
User avatar

Joined: Sat Dec 22, 2007 6:00 pm
Posts: 355
Location: Western Australia
I've been working on a web-playable version of It, and I pretty much have everything compatible with WebUI now. There's just one problem left, and I'm finding it a doozy. I can't get the WebUI version of the game to display images.

For testing purposes, I've dropped this code into gameMain.showIntro():
Code:
"""<.p><img src="cover art/cover.jpg"><.p>""";


It works just fine in the original UI version of the game, but when I run the WebUI version, all I get is a broken image link icon (you know, that irritating red-cross-in-a-box thing). The .t3 and .t3m files for both versions are all in the same folder, so they shouldn't have any trouble finding the cover art, and I added the file to the Resources section of the project file. I tried placing the cover art file in the same folder as the .t3m and .t3 files, rather than a subfolder. I tried messing with the format of the <img> tag. I tried compiling the game for release. I tried running the game (both the debug version and the release version) in the stand-alone HTML TADS for Windows interpreter, rather than through Workbench. I created a new WebUI project from scratch and tried getting an image to display in that. I even uninstalled and reinstalled the TADS Author's Kit and Player's Kit. No dice.

I'm completely baffled. Anyone have any ideas?

_________________
Emily Boegheim


Top
 Profile Send private message  
 
PostPosted: Wed Mar 14, 2012 10:27 am 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
WebUI games won't serve up resources from anywhere but webuires by default, for various security-flavored reasons.

You'll need to add something like this to one of your source files:
Code:
WebResourceResFile
   vpath = static new RexPattern('/cover<Space>art/')
;


(Untested; the syntax may be a bit fiddly with the space in the directory name.)


Top
 Profile Send private message  
 
PostPosted: Fri Mar 16, 2012 6:58 pm 
Offline
User avatar

Joined: Sat Dec 22, 2007 6:00 pm
Posts: 355
Location: Western Australia
Works perfectly, thank you!

I'm just wondering - where in the documentation would I have had to look to find that out? Even now I know what I'm looking for, I can't find any mention of it. I was wondering if I'd just skimmed through the System Manual article on WebUI too quickly and missed it, but I'm still not seeing an explanation there.

_________________
Emily Boegheim


Top
 Profile Send private message  
 
PostPosted: Fri Mar 16, 2012 7:19 pm 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
I discovered the WebResourceResFile class when reading through the webui.t source code. I'm not aware that it's documented, outside of the Library Reference Manual.


Top
 Profile Send private message  
 
PostPosted: Fri Feb 01, 2013 6:25 am 
Offline

Joined: Wed Jan 02, 2013 4:17 am
Posts: 17
It is in the system manual.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group