Changes

Jump to navigation Jump to search
3,926 bytes added ,  19:08, 18 August 2013
m
no edit summary
Brand information for the makers of tea and iced tea beverages< [[Graphics]] == What are Overlays? == Overlays are predefined snippets that you can stack on each other. Includes recipesIn contrast to [[Layers|layers]],tea history and developmentwhich regard whole pages, glossaryoverlays mostly are only single pictures, and answers to frequently asked questionswords or the like. == Defining == <texcode>* \defineoverlay[reference name][http:commands]</texcode> Better put your commands in braces. == Using == You can use defined overlays everywhere, where there's a <tt>background</wwwtt> option.teainfo.org/  <context source=yes>\setupcolors[state=start] \defineoverlay[tea][{\green\ss\bf GREEN TEA}] * \framed[http://www.teainfo.org/ background=tea-bag.php tea bag, align={middle,hilo}]{ \em today \blank[2* [http:big] for sale}<//wwwcontext> You can use this also with pictures.teainfoSee also [[Logos|logos]].org/tea-gardner Another use for overlays is for adding a graphic to every page to indicate chapters (sometimes known as a [[Thumb index|thumb index]]).php Tea Gardner]* [http://www== Overlays vs.teainfoLayers == Overlays and Layers are different mechanisms, which are powerful when combined.org/green-tea === Overlays === ConTeXt has an overlay environment that can be used in the text to stack the arguments on the same spot. In the example below, each new element is placed on top of the previous element.php  <context source=yes>\setupbodyfont[40pt] \starttext \startoverlay {\strut\red m} {\strut\green teaa} {\strut\blue l}\stopoverlay \stoptext</context> Without the \strut argument each argument is horizontally and vertically centered: <context source=yes>\setupbodyfont[40pt]* [http:\starttext \startoverlay {\red m} {\green a} {\blue l}\stopoverlay \stoptext<//wwwcontext>   Overlays are created with the \defineoverlay command, which takes an overlay name and content.teainfoThe overlays are then applied to a \framed command or the background to the page the textblock, header, and so forth.org/herbal-teas The next example shows two overlays (“behind” and “before”), which are activated in the frame with a background key.php herbal teas <context source=yes>\starttext \defineoverlay[behind][{\blackrule[height=2cm,width=8cm,color=yellow]}]* \defineoverlay[before][{\blackrule[height=8cm,width=2cm,color=orange]}] \framed [width=10cm, height=10cm, background={color,behind,foreground,before}, backgroundcolor=red] {\blackrule[http:width=6cm,height=6cm,color=blue]} \stoptext<//wwwcontext> The arguments of the background key used two names in addition to the “behind” and “before” overlays.pizzaguideThe first name is “color”, which is needed when using the backgroundcolor key to put a color in the entire frame's area.org/ pizza]The second is “foreground”, which can place overlays *before* [http://wwwthe content of the frame because “foreground” is the frame text itself.pizzaguide The overlay environment and overlay mechanism for \framed are similar.org/pizza-dough The methods to set them because in the first case you set the content for each level which the argument in braces ({…}{…}) and in the second case you define them first with \defineoverlay and set the order in the background key.php pizza dough]* [http://www=== Layers === With layers the content from each command can be positioned at a certain horizontal and vertical position.pizzaguideThe following example creates a new layer and set three texts.org/italian-pizzaThe texts are placed in the page using the \flushlayer command.php italian pizza <context source=yes>\starttext \definelayer[test] \setlayer[test][x=3cm,y=6cm]{ONE}* \setlayer[test][http://www.pizzaguide.org papa johns pizzax=8cm,y=2cm]{TWO}* \setlayer[test][http://www.coffee-guide.us/ coffeex=2cm,y=9cm]{THREE} * \flushlayer[http:test] \stoptext<//wwwcontext> When you put new some text after \flushlayer would be surprised because it would end put on the following page but you shouldn’t wonder about this because layers have nothing to do with the page background or foreground.coffee-guide What makes the layer and overlay mechanism is interesting is when you combine them and put the \flushlayer command in a overlay which does now place the texts before or after the content of a frame.us/gourmet-coffeeWith my next example we’re finally in the process to combine them.php gourmet coffee <context source=yes>\setupbodyfont[30pt]* \starttext \definelayer[behindtext]\definelayer[http://www.coffee-guide.us/coffee-makers.php coffee makersbeforetext]* \setupbackgrounds[text][http://www.coffee-guide.us/coffee-tables.php coffee tablesbackground={behindtext,foreground,beforetext}]* \setlayer[behindtext][http://www.coffeex=-guide2cm,y=.us/organic-coffee.php organic coffee75ex]{\red Behind}* \setlayer[beforetext][http://wwwx=+2cm,y=.chocolateplanet.org Chocolate75ex]{\yellow Before}* The Text! \setlayer[behindtext][http://www.chocolateplanet.org chocolate factoryx=5cm,y=4cm]{\red More background text!}* \setlayer[beforetext][http:x=3cm,y=8cm]{\yellow More foreground text!} \stoptext</context> When you look at the example you can see that haven't created a overlay for layer even though I said you need it to put the layer after the text. This isn’t necessary because when you create a new layer context does also create a overlay with the same name in which the layer is placed. The other question is how you can place overlays on the text/wwwpage when I told before overalls can only be placed on frame, this is possible because all page elements (textblock, header, footer and even the page and paper itself) are frames.chocolateplanetEven though these elements are frames they don’t provide all the options from \framed because they are a special version with less functionality.org chocolate candy] == See Also == * [http[:Category:Command//www.chocolateplanet.org charlie and chocolate factoryOverlays]]* [[httpCategory://www.chocolateplanet.org chocolate chipsGraphics]]
419

edits

Navigation menu