Is there anyone around that is familiar with the scripting for creating custom content??
I could use some help.
Thanks
Is there anyone around that is familiar with the scripting for creating custom content??
I could use some help.
Thanks
I might be able to help you, if you post your question.
Cheers,
Chris
is there a way to make a region of text on a card print out at a specified angle? or is it only xy axis?
zebuleon said:
is there a way to make a region of text on a card print out at a specified angle? or is it only xy axis?
You'll want to apply an affine transform to the graphics context before drawing the text (and then restore the original transform afterward). This example performs a rotation in the paintFront() function. It draws an image instead of text, but the concepts are the same.
Note the example calls a version of drawImage that takes an affine transform as an argument. You'll need to do something like this instead:
var transform = // (the transform to apply: see the example code)
// store the current transform so we can restore it later
var oldTransform = g.getTransform();
// you should concatenate the new transform with the existing one,
// or you will end up getting wrong results when the card is printed/exported,
// or even when previewed depending on settings
// NOTE: remember that matrix multiplication is not commutative;
// the order that you do the concatenation in matters. Affine transforms
// provide both a concatenate and preConcatenate method:
// see the
AffineTransform docs
for more information.
// apply the new transform that specifies the rotation
g.setTransform( transform );
// do some drawing at strange angles
// ...
// once you are done, restore the original transform
g.setTransform( oldTransform );
// any drawing after this will be "normal" again
// ...
Cheers,
Chris
thanks, that helped a bunch.