[−][src]Function photon_rs::text::draw_text_with_border
pub fn draw_text_with_border(
photon_img: &mut PhotonImage,
text: &str,
x: u32,
y: u32
)
Add bordered-text to an image. The only font available as of now is Roboto. Note: A graphic design/text-drawing library is currently being developed, so stay tuned.
Arguments
photon_image
- A PhotonImage.text
- Text string to be drawn to the image.x
- x-coordinate of where first letter's 1st pixel should be drawn.y
- y-coordinate of where first letter's 1st pixel should be drawn.
Example
// For example to draw the string "Welcome to Photon!" at 10, 10: use photon::text::draw_text_with_border; // Open the image. A PhotonImage is returned. let img: PhotonImage = open_image("images/cats.PNG"); draw_text_with_border(&mut img, "Welcome to Photon!", 10, 10);