Hello everybody,
I would like to copy un jsxGraph objet. I tried to do this with any js tolls, but without succes.
I would like to duplicate a text before to rotate it in order to conserve the antecedent.
Thanking you in advance.
JXG.Options.text.display = 'internal';
var brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-2, 2, 2, -2], axis:true, showCopyright:false, showNavigation:false});
var point = function(a, b){
return brd.create('point', [a, b]);
};
var texte = function(message, taille){
return brd.create('text',[-2,-1, message], {fontSize:taille});
};
var rotation = function(centre, angle, text){
//var image = texte('Salut', 50);
var image = jQuery.extend(true, {}, text);
var tRot = brd.create('transform',[Math.PI/180.0 * angle,function(){return centre.X();},function(){return centre.Y();}],{type:'rotate'}
);
tRot.bindTo(image);
brd.update();
return image;
};
var A= point(-1, -1);
var monTexte = texte('Salut', 50);
//monTexte.hideElement();
var monTexte1 = rotation(A, 45, monTexte);