Logo ROOT   6.14/05
Reference Guide
text.cxx
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_v7
3 ///
4 /// \macro_code
5 ///
6 /// \date 2017-10-17
7 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
8 /// is welcome!
9 /// \author Olivier couet <Olivier.Couet@cern.ch>
10 
11 /*************************************************************************
12  * Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
13  * All rights reserved. *
14  * *
15  * For the licensing terms see $ROOTSYS/LICENSE. *
16  * For the list of contributors see $ROOTSYS/README/CREDITS. *
17  *************************************************************************/
18 
19 #include "ROOT/TCanvas.hxx"
20 #include "ROOT/TColor.hxx"
21 #include "ROOT/TText.hxx"
22 #include <ROOT/TPadPos.hxx>
23 #include "ROOT/TDirectory.hxx"
24 
25 void text()
26 {
27  using namespace ROOT;
28  using namespace ROOT::Experimental;
29 
30  // Create a canvas to be displayed.
31  auto canvas = Experimental::TCanvas::Create("Canvas Title");
32 
33  for (int i=0; i<=360; i+=10) {
34  auto opts = canvas->Draw(Experimental::TText({0.5_normal, 0.6_normal}, "____ Hello World"));
35 
36  Experimental::TColor col(0.0015*i, 0.0025*i ,0.003*i);
37  opts->SetTextColor(col);
38  opts->SetTextSize(10+i/10);
39  opts->SetTextAngle(i);
40  opts->SetTextAlign(13);
41  opts->SetTextFont(42);
42  }
43 
44  canvas->Show();
45 }
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
TText * text
static std::shared_ptr< TCanvas > Create(const std::string &title)
Definition: TCanvas.cxx:74