This macro demonstrate the text attributes for RText.
Angle, size and color are changed in a loop. The text alignment and the text font are fixed.
#include "ROOT/RText.hxx"
void rtext_angle()
{
for (double angle = 0; angle <= 360; angle += 10) {
auto draw = canvas->Draw<RText>(
RPadPos(0.5_normal, 0.6_normal),
"____ Hello World");
draw->text.color =
RColor((
int)(0.38 * angle), (
int)(0.64 * angle), (
int)(0.76 * angle));
draw->text.size = 0.01 + angle / 5000.;
draw->text.angle = angle;
}
canvas->Show();
}
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
A position (horizontal and vertical) in a RPad.
Namespace for ROOT features in testing.
- 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 rtext_angle.cxx.