[][src]Function photon::text::draw_text

pub fn draw_text(photon_img: &mut PhotonImage, text: &str, x: u32, y: u32)

Add 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

Example

// For example to draw the string "Welcome to Photon!" at 10, 10:
use photon::text::draw_text;
 
// Open the image. A PhotonImage is returned.
let img: PhotonImage = open_image("images/cats.PNG");
 
draw_text(&mut img, "Welcome to Photon!", 10, 10);