That's what the examples are for!
In the example case I've attached the dynamic_entity.lua script to the decals and named the decals appropriately, i.e. by the name I want to call them in the script.
Then I've attached the de_ test.lua script to the chalkboard entity, in that script is the control logic to decide which decals to use and when to show them, which is as simple as I could make it!, and finally a call to update the decals.
(So there are 9 entities, 3 chalkboards with the de_test.lua script and 6 decals with the dynamic_entity.lua script attached.)
In the de_test.lua script you will find a DE_Register call, this passes the name of the decal and a list containing it's positional offsets relative to the origin of the chalkboard. Scaling of the entities to fit nicely must be done manually in the editor as currently there is no way to get an objects shape/size parameters from within Lua.
Once set up you can position/rotate the control entities (i.e. the chalkboards) any way you like and the decals will be repositioned/rotated to suit by the Lua scripts.
The functions provided are:
DE_Register( e, name, list )
DE_Show( e, name )
DE_Hide( e, name )
DE_Update( e, x, y, z, q )
In all cases 'name' is the name of the decal and e is the entity id of the controlling entity (iow the same 'e' passed in from GG to the 'main' function). 'list' is a list containing positional info for the entity which takes the form:
{ xo = <value>, yo = <value>, zo = <value>, angQ = <quaternion> }
the <values> are simply the offsets in each axis, angQ is optional and is the rotational difference between the two entities in quaternion form. I'll post another example later today which uses this.
DE_Hide will hide all entities registered that have 'name', DE_Show will show them.
DE_Update simply updates the position/rotation of all registered entities that are currently 'showing'. x, y, z is the position of the control entity and q is the quaternion representation of its rotation (which you get from the quatlib function FromEuler).
DE_Update should be called whenever the controlling entity is repositioned or rotated, for simple examples like this calling it every frame is fine.
I'm not done with this yet, will be expanding this gradually but I thought I'd publish something usable to begin with.
Been there, done that, got all the T-Shirts!