From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31374 Path: news.gmane.org!not-for-mail From: Renaud AUBIN Newsgroups: gmane.comp.tex.context Subject: Re: Fielstack and Layers for Presentation Date: Fri, 13 Oct 2006 23:54:33 +0200 Message-ID: <45300B19.3020203@nibua-r.org> References: <452E823F.6040503@nibua-r.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1160776524 6951 80.91.229.2 (13 Oct 2006 21:55:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Oct 2006 21:55:24 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 13 23:55:23 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GYUzr-0000l5-9C for gctc-ntg-context-518@m.gmane.org; Fri, 13 Oct 2006 23:55:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 30A851FECB; Fri, 13 Oct 2006 23:55:14 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06916-01; Fri, 13 Oct 2006 23:55:05 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A2FBE1FD7D; Fri, 13 Oct 2006 23:55:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0A0D41FD7D for ; Fri, 13 Oct 2006 23:55:00 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06731-02 for ; Fri, 13 Oct 2006 23:54:47 +0200 (CEST) Original-Received: from 42.mail-out.ovh.net (42.mail-out.ovh.net [213.251.189.42]) by ronja.ntg.nl (Postfix) with SMTP id C776C1FD60 for ; Fri, 13 Oct 2006 23:54:44 +0200 (CEST) Original-Received: (qmail 26930 invoked by uid 503); 13 Oct 2006 21:54:29 -0000 Original-Received: from b6.ovh.net (HELO mail178.ha.ovh.net) (213.186.33.56) by 42.mail-out.ovh.net with SMTP; 13 Oct 2006 21:54:29 -0000 Original-Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 13 Oct 2006 21:54:42 -0000 Original-Received: from d83-179-99-76.cust.tele2.fr (HELO ?192.168.78.10?) (aubin@nibua-r.org@83.179.99.76) by ns0.ovh.net with SMTP; 13 Oct 2006 21:54:40 -0000 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: fr, en Original-To: mailing list for ConTeXt users In-Reply-To: <452E823F.6040503@nibua-r.org> X-Ovh-Remote: 83.179.99.76 (d83-179-99-76.cust.tele2.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:31374 Archived-At: Hi all, After several trial-error experiments, I obtained what I want with the attached code. I use only one background for the frames within definesymbol because the use of several background "failed" (only the last one is eventually displayed). Now, I would like to know if it is possible to obtain a deterministic random-like shapes, i.e. to get always the same shape for Overlay1... Renaud PS: Thanks to Peter, Andrea and Hans for the thread absolute positioning of figures ;) \setupcolors[state=start] \usemodule[pre-original] \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut{TEST}\hss}} % initialize the text variable \startuseMPgraphic{FunnyFrame} picture p ; numeric o ; path a, b ; pair c ; p := textext.rt(\MPstring{FunnyFrame}) ; a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ; o := BodyFontSize ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a randomized (o/2) ; fill b withcolor .85white ; draw b ; c := center p ; c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ; p := p shifted (c-center p) ; b := (boundingbox p) randomized (o/8) ; fill b withcolor .85white ; draw b ; draw p withcolor black; setbounds currentpicture to a ; \stopuseMPgraphic \starttext \Topic{Stacks \& Layers} \startbuffer[buf1] \FrameTitle{Overlay1} \StartFrame[width=.75\textwidth] This is the first funny frame ! \StopFrame \stopbuffer \startbuffer[buf2] \FrameTitle{Overlay2} \StartFrame[width=.75\textwidth] This is the second funny frame ! \StopFrame \stopbuffer \startbuffer[buf3] \FrameTitle{Overlay3} \StartFrame[width=.75\textwidth] This is the third funny frame ! \StopFrame \stopbuffer \definelayer[layer1][] \definelayer[layer2][] \definelayer[layer3][] \setlayer[layer1][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer2][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer2][x=.1\textwidth,y=.1\textheight,location=br]{\getbuffer[buf2]} \setlayer[layer3][x=.05\textwidth,y=.05\textheight,location=br]{\getbuffer[buf1]} \setlayer[layer3][x=.1\textwidth,y=.1\textheight,location=br]{\getbuffer[buf2]} \setlayer[layer3][x=.15\textwidth,y=.15\textheight,location=br]{\getbuffer[buf3]} \defineoverlay[overlay1][{\placelayer[layer1]}] \defineoverlay[overlay2][{\placelayer[layer2]}] \defineoverlay[overlay3][{\placelayer[layer3]}] \definesymbol[one][{\framed[width=\textwidth,height=.3\textheight,background=overlay1,frame=off]{}}] \definesymbol[two][{\framed[width=\textwidth,height=.3\textheight,background=overlay2, align=right,frame=off]{}}] \definesymbol[three][{\framed[width=\textwidth,height=.3\textheight,background=overlay3, align=right,frame=off]{}}] \definefieldstack[sequence][one,two,three][height=fit,width=fit,frame=off,offset=overlay,clickin=JS(Walk_Field{sequence})] {{\fieldstack[sequence]}} \goto{next}[JS(Walk_Field{sequence})] \stoptext