Using the result from .cfdg file as a backgroud

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Veliko
Posts: 4
Joined: Sun Oct 16, 2011 5:36 am

Using the result from .cfdg file as a backgroud

Post by Veliko »

Hello!

I want to use the result from a CF file as a backgroud for another. Is it possible?

Thanks in advance.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Using the result from .cfdg file as a backgroud

Post by MtnViewJohn »

Not within Context Free itself. You can set the background of the top cfdg file to transparent and them composite them using a bitmap editor. The code for setting a transparent background is:

Code: Select all

background {a -1}    // version 2
or

Code: Select all

CF::Background = [a -1]  // version 3 

Veliko
Posts: 4
Joined: Sun Oct 16, 2011 5:36 am

Re: Using the result from .cfdg file as a backgroud

Post by Veliko »

Thank you very much!

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Using the result from .cfdg file as a backgroud

Post by MtnViewJohn »

Actually, you could do it in Context Free using the z-axis. If you have a shape called foreground and a shape called bkground then you could do this:

Code: Select all

startshape scene

shape scene {
    foreground [z 1000]
    bkground [z -1000]
} 
Giving the foreground shape a larger z than the bkground shape ensures that all of its parts are drawn on top.

User avatar
DeFleur
Posts: 41
Joined: Sat Feb 07, 2009 7:49 am
Location: Switzerland

new FILL primitive shapes

Post by DeFleur »

In the New Feature I found quote New FILL primitive shape, fills the canvas with the specified color at the specified Z. Similar to the background, but you can interleaves shapes and FILLs in Z. unquote. I do not fully understand this nor did I find a specific entry in the documentation. Help is welcomed.
kind regards from DeFleur

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Using the result from .cfdg file as a backgroud

Post by MtnViewJohn »

Oops, I forgot to document that one. FILL works like SQUARE or CIRCLE except that the shape that it draws is a fill of the entire canvas with the specified color. The X/Y plane information is ignored but Z axis is used to determine when the FILL is drawn with respect to the other primitive shapes.

Post Reply