DEV Actors - GiuseppeChillemi/VID-Extension-Kit GitHub Wiki

Documentation on how to create actors

Actors are created by the function Set-Actor defined in ..blob/master/source/feel.r

...

    set-actor: func [face type args] [
        insert-actor-func face type make function! [face value event actor] bind args ctx-content
    ]
...

It is part of a sect of function defined in:

Actors Fuctions

...

;-- Actor Functions:

insert-actor-func: func [fc actor fn /from fac] [
    if in fc 'actors [
        if none? get in fc/actors actor [
            fc/actors/:actor: make block! []
        ] 
        unless find fc/actors/:actor :fn [
            insert/only insert fc/actors/:actor if from [fac] :fn
        ]
    ]
] 
remove-actor-func: func [face actor fn /local act] [
    if in face 'actors [
        any [
            none? act: get in face/actors actor 
            act: find act :fn 
            act: back act 
            remove/part act 2
        ]
    ]
] 
pass-actor: func [src-face target-face actor] [
    if all [in src-face 'actors in target-face 'actors] [
        foreach [fc act] any [get in src-face/actors actor []] [
            insert-actor-func/from target-face actor :act any [fc src-face]
        ]
    ]
] 
act-face: func [[catch] face event actor] [
    unless in face 'actors [
        throw make error! join "Actors do not exist for " describe-face face
    ] 
    unless find first face/actors actor [
        throw make error! reform ["Actor" actor "not found"]
    ] 
    if find ctx-vid-debug/debug 'actor [
        print ["Face:" describe-face face] 
        print ["Actor:" actor]
    ] 
    if block? get in face/actors actor [
        foreach [fc act] get in face/actors actor [
            act any [fc face] get-face any [fc face] event actor
        ]
    ]
]
...