ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Daniel Bundzik <Daniel.Bundzik@vicitra.se>
To: ntg-context@ntg.nl
Subject: How do you position/move a MPgraphic?
Date: Fri, 23 Oct 2009 10:20:28 +0200	[thread overview]
Message-ID: <4AE1674C.2010400@vicitra.se> (raw)

Hi!

How do you position/move a MPgraphic?

Let us us say that you have the MPgraphics "somebackground" and 
"somecolorcircle" (See example below). These MPgraphics are both framed 
and used as a background,  upon which "sometext" is written on. How can 
you freely move or position "somecolorcircle"? ( I want to move 
"somecolorcircle" below "sometext") Naturally, I have read Metafun and 
tried "shifted (x,y)", \definelayer, \setlayer, register, \setMPlayer, 
\getMPlayer...

In general, if you have defined two or more MPgraphics how do you 
position them (In my case "somebackground" is fixed while 
"somecolorcircle" could be anywhere on "somebackground")?

How would you solve this?

Regards,
Daniel

\setupcolors[state=start]
\setuppapersize[S6][S6]
\setuplayout [width=fit,
rightmargin=0cm,
leftmargin=0cm,
leftmargindistance=0pt,
rightmargindistance=0pt,
height=fit,
topspace=0cm,
header=0pt,
footer=0cm,
bottomspace=0cm,
backspace=0cm,
location=singlesided]

\definecolor[Orange][r=1.,g=.47,b=.0] % dark orange
\setupinteractionscreen[option=max]

\startbuffer[sometext]
\switchtobodyfont[sansserif,1.0cm]
\midaligned{\white \bf This is the text}
\stopbuffer

\starttext

\startuseMPgraphic{somebackground}
    fill fullsquare
        scaled 10cm
        withcolor .625red ;
    fill fullsquare
        scaled 10cm
        shifted (10cm,0)
        withcolor black ;
    fill fullsquare
        scaled 10cm
        shifted (20cm,0)
        withcolor \MPcolor{Orange} ;
    currentpicture := currentpicture 
xysized(OverlayWidth+.5pt,OverlayHeight+.5pt) ;
\stopuseMPgraphic

\startuseMPgraphic{somecolorcircle} % How do you move "somecolorcircle". 
I want this to be below "sometext"
    colorcircle(2cm,white,.625red,\MPcolor{Orange}) ;
\stopuseMPgraphic

\startTEXpage

\defineoverlay[somebackground][\useMPgraphic{somebackground}]
\defineoverlay[somecolorcircle][\useMPgraphic{somecolorcircle}]

\framed
  [background={somebackground,somecolorcircle},height=12cm,frame=off]
  {\getbuffer[sometext] }

\stopTEXpage

\stoptext
___________________________________________________________________________________
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
___________________________________________________________________________________


             reply	other threads:[~2009-10-23  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23  8:20 Daniel Bundzik [this message]
2009-10-25  9:49 ` Taco Hoekwater
2009-10-25 10:09 ` Peter Rolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AE1674C.2010400@vicitra.se \
    --to=daniel.bundzik@vicitra.se \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).