Logo ROOT   6.16/01
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/RCanvas.hxx"
20#include "ROOT/RColor.hxx"
21#include "ROOT/RText.hxx"
22#include "ROOT/RPadPos.hxx"
23
24void text()
25{
26 using namespace ROOT::Experimental;
27
28 // Create a canvas to be displayed.
29 auto canvas = RCanvas::Create("Canvas Title");
30
31 for (int i=0; i<=360; i+=10) {
32 auto opts = canvas->Draw(RText({0.5_normal, 0.6_normal}, "____ Hello World"));
33
34 RColor col(0.0015*i, 0.0025*i ,0.003*i);
35 opts->SetTextColor(col);
36 opts->SetTextSize(10+i/10);
37 opts->SetTextAngle(i);
38 opts->SetTextAlign(13);
39 opts->SetTextFont(42);
40 }
41
42 canvas->Show();
43}
TText * text