[AGG] to discus new Rebol/View with AGG
wondering what the 'dot' is that appears on the right side of the divider over the menu item "File > Recent Files"?
By the way, very nice looking menu.
the dot is me forgetting to put in an empty? check ;)
ICarii: Cool stuff Henrik: I don't see any problem to render such isometric layout using DRAW.
coming soon! New onyx styles: field, label, area, check, h1 /h2 / h3. Sample at - http://rebol.mustard.co.nz/new-onyx-styles.png
Draw a surface with 3-D Perspective and allow roation - http://peoplecards.ca/rebol/philb/utils/3D-surface.r & in the Rebol Library http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=surface.r
Is there a way to know the length in pixels of a text drawn with AGG?
I was just about to try view layout [b: box effect [draw [text "test"]]] planning to poke around with help b to see, then I remembered that REBOL Linux doesn't have draw text :( Sorry. But that's were I would start....poking around in the objects. May well be a waste of time... Then I'd fire up anamonitor and view through some of the system objects for that key ...size-text... kinda function. If that didn't work I'd give up and wait for Cyphre :) Excuse the babbling...
size-text will do it.
I doubt it. size-text expects a face argument and computes size based on face/text, face/font, face/edge and face/para values.
all of which you can change to expected agg fonts etc before calling size-text s: size-text make face compose [text: (t) font/name: "arial" para/wrap?: off] ;etc..
which is fine as long as you don't use vectorial ;)
as long as you use pen off/none with vectorial the results should still match :)
unless of course you are using rotations or scaling :)
I will test it soon, Thanks!
When drawing an object onto a face is there a way to insure that hte next object drawn is layed on top. I'm drawing boxes on a face but when I try to draw addional boxes (different colors) they are hidden behind the first drwn objects..
In most graphics programs there is something called the z-index or something to that effect, that controls the depth of the objects in a view. Usually range in value from 256 (top) to -256 (furthest away). I can't speak for AGG though as I have not played with it yet.
The AGG/Draw dialect will process and render things in the order they are specified inside the draw block for the face. There is no z-index for AGG.
I adding shape objects to a face by appending them to face/effect/draw but the appended shap is beneath the original face shapes.
If you draw onto a text field the text is on top. ..even if you 'paint' a box affter the text has been rendered. I do not understand what is going onthere?
Can you give a small example, eg:
view layout [box effect [draw [pen red line-width 2 shape [line 0x0 10x0 10x10 0x10] pen green shape [line 5x0 10x5 5x15 0x5]]]]
The above example draws the red box first, and the green kite on top of it.
face/text rendering is separate to face/effect/draw rendering, and will always be on top.
So, please show us a small example of what you're doing.
I'm doing something like this: view layout [ b: box effect [draw [pen red fill-pen red line-width 2 shape [line 0x0 40x0 40x40 0x40] ] ] btn "append draw" [append b/effect/draw compose ['pen green 'fill-pen green 'shape ['line 5x0 30x5 5x25 0x20]]show b] ] Its much more complicated as I'm painting highlights on a series of faces in a panel. I go back and highlight in another color where a specified word is found. The hi-lite shows if its on a section of text not yet painted but not if it falls on painted text. The above example works! so it must be some where else in my app... Thanks. I'll look it over...
You can't really "paint on a face". Faces redraw themselves from their specification every time they are shown.
Each face has an internal image buffer (that we don't have access to directly). This buffer is blanked just before the face redraws itself.
But anyway, face/text always renders after the face/effect/draw dialect.
view layout [box effect [draw [pen red line-width 5 line 0x0 100x100]] "hello"]
That shows the red line drawn behind the face/text, "hello".
I got it working... I do not know what i was doing before but its doing what I need...Thanks
Ok, no problem.
Maybe you were inserting in the draw block instead of appending (insert tail) !?
Actually I don't like this behavior...its too complicated to remove it again.Back to my original plan of moving and resizing a box form face to face... view layout [ bx: box 100.100.255 0x0 b: box effect [draw [pen red fill-pen red line-width 2 shape [line 0x0 40x0 40x40 0x40]]] at 40x40 text "Hello World" btn "append draw" [append b/effect/draw compose ['pen green 'fill-pen green 'shape ['line 5x0 30x5 5x25 0x20]]show b] btn "Moving box" [bx/offset: 20x20 bx/size: 90x90 show bx] ] for example. Now if I draw the box after the face it covers the textt which I want to avoid too.view layout [ bx: box 100.100.255 0x0 b: box effect [draw [pen red fill-pen red line-width 2 shape [line 0x0 40x0 40x40 0x40]]] at 40x40 text "Hello World" btn "append draw" [append b/effect/draw compose ['pen green 'fill-pen green 'shape ['line 5x0 30x5 5x25 0x20]]show b] btn "Moving box" [bx/offset: 20x20 bx/size: 90x90 show bx]
Can you use alpha channel in vid or only in draw?
DidC, I thought about that but I was appending. I think I was not drawing the box properly.
Above code : ignore the second code example. I hit ctrl-v instead of cntrl-s
If you want to process face/text rendered text, then you're going to have to put a (semi-transparent) face on top of it (or in its pane).
; in its pane view layout [h1 "hello" with [pane: make face [offset: 5x5 size: 20x10 effect: [merge luma 90] edge: none]]]
This will affect how events are handled, unfortunately. As far as I know, there is no way to make a face "event transparent" at this time. I spent a lot of time looking at this already.
Got it! I draw a box with 0 size at the end of the panel: bx: box 0x0 edge [color: red size: 2x2] Then I size it , move it to where I need it , and append an effect: bx/offset: face/offset + khead - 0x3 bx/size: as-pair (ktail/x - khead/x) 21 bx/effect: append [merge][multiply 100.0.0] Works great. I'm using it to highlight a search word as I step through all the text faces in a panel. Thanks for the help...
Are you doing the APPEND more than once ? (the block will grow and grow...)
You only need to set the effect once.
bx: box edge [color: red size: 2x2] with [show?: false]
then you only need to set the offset and size. The above also shows how to make the face initially invisible. (An alternative to size: 0x0).
SHow? false...good idea! I've abandoned the append draw idea as it would take some parsing code to remove it again when I move to the next face... Moving a box around is alot easier.
Oh...You mean the effect append...Yeah I've been appending every time I do the search. But I probed bx/effect but it does not look like its growing unless i"m only seeing the tail in the probe I got an out of memory crash before that I've been trying to track down. This might be it.
probe on head bx/effect but I only get a single occurance of the effect block. But teh code looks like it would do what you suggest.
got rid of the append function and just used teh effect on hte creationof the box...no reason to append it. Good eye Anton, thanks