From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31376 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: Fielstack and Layers for Presentation Date: Sat, 14 Oct 2006 12:12:31 +0200 Message-ID: <4530B80F.3050103@gmx.net> References: <452E823F.6040503@nibua-r.org> <45300B19.3020203@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 1160820783 19229 80.91.229.2 (14 Oct 2006 10:13:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Oct 2006 10:13:03 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Oct 14 12:12:59 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 1GYgVe-0008Vu-Bc for gctc-ntg-context-518@m.gmane.org; Sat, 14 Oct 2006 12:12:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A79AE1FE7C; Sat, 14 Oct 2006 12:12:49 +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 21398-01; Sat, 14 Oct 2006 12:12:40 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 726CA1FD7D; Sat, 14 Oct 2006 12:12:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 69E1D1FE2D for ; Sat, 14 Oct 2006 12:12:28 +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 16922-06-3 for ; Sat, 14 Oct 2006 12:12:20 +0200 (CEST) Original-Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by ronja.ntg.nl (Postfix) with SMTP id 8D6981FD54 for ; Sat, 14 Oct 2006 12:12:20 +0200 (CEST) Original-Received: (qmail invoked by alias); 14 Oct 2006 10:12:19 -0000 Original-Received: from i577BB1B8.versanet.de (EHLO [192.168.1.3]) [87.123.177.184] by mail.gmx.net (mp036) with SMTP; 14 Oct 2006 12:12:19 +0200 X-Authenticated: #24293357 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) Original-To: mailing list for ConTeXt users In-Reply-To: <45300B19.3020203@nibua-r.org> X-Enigmail-Version: 0.94.0.0 X-Y-GMX-Trusted: 0 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:31376 Archived-At: Hi Renaud, I tried your example code and it is really fun. But you should exchange the buffers with setups to minimize runtime. On my machine it's 4x faster this way. I'll better not imagine, how often you have compiled your example code, before it reached this nice and clean state ;) Renaud AUBIN wrote: > 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... > What I can think of is to initialize the random seed value of MP (name?) with the same value, every time before you fill a new layer. Another way would be to add the 'random' parameters to your FrameTitle macro. But I don't have much experience with random stuff, so there maybe better ways. Greetings, Peter > 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 > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context > >