piston
piston copied to clipboard
Why is transform required for drawing text at position?
For something like rectangle it's:
rectangle(
[1.0, 0.0, 0.0, 1.0], // RGBA
[0.0, 0.0, 100.0, 100.0], // [x, y, w, h]
context.transform, graphics
);
But for text it's:
let transform = context.transform.trans(10.0, 100.0);
text::Text::new_color([0.0, 0.0, 0.0, 1.0], 32).draw(
"Hello world!",
&mut font,
&context.draw_state,
transform, graphics
).unwrap();
Why does text require transform, and not just x and y coordinates?
I opened https://github.com/PistonDevelopers/graphics/issues/1137