Can't display embedded images in a menu in TADS 3 Web UI

I might have got this wrong, but it seems that it should be possible to display .jpg images in the WEB UI by

  1. Dropping the image into ‘Resource Files’ in Workbench
  2. Adding a path so that the WebUI security allows it.

The code I’ve included to do this is:

[code]WebResourceResFile
vpath = static new RexPattern(’/ResourceFiles/’)
;

mapMenu: MenuItem ‘Pfister Pharmaceuticals Research Complex’;

  • MenuItem ‘’;[/code]

However, when I run the game, all I see of the image when I call the menu is a small black box with an x in it.
There are a couple of other threads on this, but none of the solutions seem to work. If there are any other steps
I need to take to add an image, it’s not clear to me from the documentation what they are, at least, using Workbench
on Windows 10.

Many thanks if anyone has any ideas, or can spot something obvious that I’ve missed.

You also need to specify resource directory with -res “Resource Files” in your makefile.t3m (or some clicky way in workbench) and then it should work. However there is also a standard resource path named “webuires” used for images and javascript files of web ui. Unless you colide with filename with some of the files you can make directory of that same name (“webuires” in lowercase) in your source directory and add files here. Then you don’t need to add vpath, because it is already there and you don’t need to change makefile, because library definition already adds this whole directory. (Files in library folder and your folder are then mixed together with your files overriding library so this is also a mean to override default library javascript files to make changes to webui.)

If unsure see linker messages about added files (only in production build - in debug build resources are not embedded in file and are served on the fly).

Thanks Tomas -

the method of setting up the ‘webuires’ directory in the source directory and adding files works perfectly.

Otto