Thanks, as every. More information - I hope without overload.
I was trying to make a test suite... And failed depressingly...
I have a series of swf files that I'd like to position in exactly the
same location on a page.
Not all pages will have an swf on them.
The swf will be specific to that page.
Now I think need a layer to be able to position exactly - that is so
many pixels in and down from the top ('Paper' size is 1024 by 768) -
I don't know how to do this with overlays, and it seems to me that the
documentation suggests that layers are made for this job:
So I write:
\definepapersize[Screen][width=1024px,height=768px]
\setuppapersize[Screen][Screen]
\definelayer [SPTinteractivemedium] % name of the layer
[x=359px, y=140px, % from upper left corner of paper
width=642px, height=492px, repeat=yes] % let the layer be large
enough for the med swf
And then
\setupbackgrounds[page][state=page,background={SPTinteractivemedium}]
Then i the text I write
\starttext
Hello world, etc
\setlayer [SPTinteractivemedium] % name of the layer
[hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer)
{\externalfigure [plug][width=200px]} % the actual contents of the layer
But when I get to a new page I'd like to be able to change that plug,
or even have the layer blank
So
\page[yes]
\setlayer [SPTinteractivemedium] % name of the layer
[hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer)
{ \externalfigure [dummy][width=100px]} % the actual contents of the layer
And;
\page[yes]
\setlayer [SPTinteractivemedium] % name of the layer
[hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer)
{ \externalfigure ??????? } % HOW TO SET THE \externalfigure to
NOTHING, or hide the layer?
It seems this ought to be easy, but I tried guessing a 'state=page'
parameter in \setlayer... And trawling wiki, manuals. No joy.
I might try changing the backgrounds on a page by page basis, but this
seems inelegant, as the \setups ought to be before the \starttext..?
On 26 April 2011 13:35, Wolfgang Schuster
Am 26.04.2011 um 12:33 schrieb Ian Lawrence:
I have a layer that I'd like to appear on some pages but not others, and for which I'd like to switch the content by page. (I need the layer to precisely and reliably locate some graphics.
However, as I see it, you can only set the visibility of a layer in \definelayer, \setupbackgrounds - and these ought to preceed \starttext
Any pointers / elegant suggestions / neat solutions?
A better solution requires more information from you!
\definelayer[test]
\startsetups[test] \doifinset{\pagenumber}{1,3,7,10}{\setlayer[test][x=3cm,y=7cm]{\ssd Test: \test}} \stopsetups
\setupbackgrounds[page][background=test,setups=test]
\starttext \dorecurse{12} {\def\test{\convertnumber{A}{\recurselevel}}% \dontleavehmode\page} \stoptext
Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________