Logo ROOT  
Reference Guide
text.cxx File Reference

Detailed Description

/*************************************************************************
* Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#include "ROOT/RCanvas.hxx"
#include "ROOT/RColor.hxx"
#include "ROOT/RText.hxx"
#include "ROOT/RPadPos.hxx"
void text()
{
using namespace ROOT::Experimental;
// Create a canvas to be displayed.
auto canvas = RCanvas::Create("Canvas Title");
for (int i=0; i<=360; i+=10) {
auto text = canvas->Draw<RText>(RPadPos(0.5_normal, 0.6_normal), "____ Hello World");
RColor col((int) (0.38*i), (int) (0.64*i), (int) (0.76*i));
text->AttrText().SetColor(col).SetSize(10+i/10).SetAngle(i).SetAlign(13).SetFont(42);
}
canvas->Show();
}
Date
2017-10-17
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Author
Olivier Couet Olivi.nosp@m.er.C.nosp@m.ouet@.nosp@m.cern.nosp@m..ch

Definition in file text.cxx.

ROOT::Experimental::RColor
The color class.
Definition: RColor.hxx:46
RPadPos.hxx
ROOT::Experimental::RCanvas::Create
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Definition: RCanvas.cxx:70
RColor.hxx
text
TText * text
Definition: entrylist_figure1.C:10
RCanvas.hxx
TCanvas::Draw
virtual void Draw(Option_t *option="")
Draw a canvas.
Definition: TCanvas.cxx:841
TCanvas::Show
void Show()
Show canvas.
Definition: TCanvas.cxx:2236
ROOT::Experimental
Definition: RDirectory.hxx:36
ROOT::Experimental::RPadPos
A position (horizontal and vertical) in a RPad.
Definition: RPadPos.hxx:40