World: r3wp
[AGG] to discus new Rebol/View with AGG
older newer | first last |
Anton 9-Oct-2008 [1173x2] | 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". | |
amacleod 9-Oct-2008 [1175] | I got it working... I do not know what i was doing before but its doing what I need...Thanks |
Anton 9-Oct-2008 [1176] | Ok, no problem. |
DideC 9-Oct-2008 [1177] | Maybe you were inserting in the draw block instead of appending (insert tail) !? |
amacleod 9-Oct-2008 [1178x4] | 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 | |
Anton 9-Oct-2008 [1182x3] | 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. | |
amacleod 9-Oct-2008 [1185] | 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... |
Anton 9-Oct-2008 [1186x4] | 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). | |
amacleod 9-Oct-2008 [1190x4] | 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 | |
Anton 9-Oct-2008 [1194] | No problem. |
Brock 26-Oct-2008 [1195x2] | Are there any demo's that show the manipulation of AGG graphics within a GUI? For example, dragging points of a bezier curve to reshape the line etc? I thought I saw some from either Cypher or the AGG demos done by others. Can anyone point me to them? |
I'd like to see if I can't create a very small, very simple example of a vector drawing program... but would need some place to start as at the moment, I don't have a clue. | |
Gregg 26-Oct-2008 [1197] | I remember something too Brock, but can't find it now either. |
Brock 26-Oct-2008 [1198] | Thanks for trying to find something. Maybe it will show up in the next few days. |
Anton 27-Oct-2008 [1199] | Brock: do http://anton.wildit.net.au/rebol/gfx/demo-intersection-point-of-two-lines.r |
Brock 27-Oct-2008 [1200] | Thanks Anton, that will be helpful. |
Brock 28-Oct-2008 [1201] | Have looked over your code Anton. There is alot of info I can use from it. Thanks for bringing it to my attention. |
Anton 29-Oct-2008 [1202x2] | do http://anton.wildit.net.au/rebol/gfx/demo-intersection-points-of-circle-and-line.r |
The circle/line intersection function could be used to help connect lines to nodes in a graph (eg. text-boxes with rounded corners, or just circles), and collision detection, both things I'm thinking of using it for. | |
Pekr 29-Oct-2008 [1204] | Excellent, as always. Anton - don't you want to "volunteer" to do text handling for VID3.4? As per Henrik's words, Carl's VID so far has only basic text handling. And so far, as for REBOL GUI in overall, you text area is the best ... |
Anton 29-Oct-2008 [1205] | Thanks, Pekr. The time is not quite right for me to launch into another edit-panel. I want to make some improvements to the existing one first, to bring it to "workable/useful" status. |
Pekr 29-Oct-2008 [1206] | My non professional guess is, that your area code would need to be rewritten for R3 anyway ... we now have gobs, rich-text, etc. But your area style would be nice to have for R3 GUI. IIIRC your area can scroll, when you hilite text by mouse. |
DideC 29-Oct-2008 [1207] | Pekr: not the area-scroll I see in Anton's rebsite (is this the last one ?) Mine does http://www.rebol.org/view-script.r?script=area-scroll-style.r |
Anton 29-Oct-2008 [1208] | DideC, no, not this one. See Editors group. |
DideC 29-Oct-2008 [1209] | I don't see "editors" folder on your rebsite. But there is plenty of folders and scripts there ! |
Pekr 29-Oct-2008 [1210] | DideC: what about Editors group here? :-) |
Anton 29-Oct-2008 [1211] | Yes, I meant Editors group in this Altme world. |
DideC 30-Oct-2008 [1212x2] | Oups ;-) |
(A "Search group name" gadget is missing in this altme world :-) | |
Pekr 30-Oct-2008 [1214] | my search is as follows - I change the sort order, then it is easy to find out, if such group exists, or not :-) |
DideC 30-Oct-2008 [1215] | I do too. But it start being painfull :-p |
Anton 8-Nov-2008 [1216x4] | Updated and renamed to intersection-points-of-line-and-circle: |
load-thru/update http://anton.wildit.net.au/rebol/gfx/intersection-points-of-line-and-circle.r do-thru/update http://anton.wildit.net.au/rebol/gfx/demo-intersection-points-of-line-and-circle.r | |
This should clean the old (inferior, and slightly different named) versions out of your cache: | |
site: http://anton.wildit.net.au/rebol/gfx/ old-file: %intersection-points-of-circle-and-line.r if exists? cache-file: path-thru site/:old-file [delete cache-file] if exists? cache-file: path-thru site/(join %demo- old-file) [delete cache-file] | |
Henrik 9-Nov-2008 [1220x2] | Did we ever get a successful SVG -> DRAW shape converter? |
I need a basic function to convert a monochrome SVG drawing to SHAPE. | |
Rebolek 9-Nov-2008 [1222] | Ask Cyphre, he has some converter. |
older newer | first last |