Logo ROOT   6.18/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
19R__LOAD_LIBRARY(libROOTGpadv7)
20
21#include "ROOT/RCanvas.hxx"
22#include "ROOT/RColor.hxx"
23#include "ROOT/RText.hxx"
24#include "ROOT/RPadPos.hxx"
25
26void text()
27{
28 using namespace ROOT::Experimental;
29
30 // Create a canvas to be displayed.
31 auto canvas = RCanvas::Create("Canvas Title");
32
33 for (int i=0; i<=360; i+=10) {
34 auto opts = canvas->Draw(RText({0.5_normal, 0.6_normal}, "____ Hello World"));
35
36 RColor col(0.0015*i, 0.0025*i ,0.003*i);
37 opts->SetColor(col).SetSize(10+i/10).SetAngle(i).SetAlign(13).SetFont(42);
38 }
39
40 canvas->Show();
41}
#define R__LOAD_LIBRARY(LIBRARY)
Definition: Rtypes.h:473
A color: Red|Green|Blue|Alpha, or a position in a RPalette.
Definition: RColor.hxx:28
A text.
TText * text