Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Write Text

SkyCraft78 edited this page Jan 6, 2021 · 2 revisions

Now we have our image, we can write text on it. Text have special type, called font. You have to create new font, with specific size and name, and then use it while drawing text on the image. First, let's create a new font style, with size 16 and font family Arial Black:

set {_font} to new font style with name "Arial Black" and with size 16

Now we have our font, we can draw our text at specific location and with special color.

See Colors page of the wiki to know how use SkImage's colors!

draw "Hello World" with font {_font} at 50, 50 with color from rgb 165, 8, 139 on {_image}

Our all code looks like that. I just added a simple command trigger to test it later.

command image:
    trigger:
        set {_image} to new image with size 150, 150
        set {_font} to new font style with name "Arial Black" and with size 16
        draw "Hello World" with font {_font} at 50, 50 with color from rgb 165, 8, 139 on {_image}

You can now go to next page to see how to save this image!

Clone this wiki locally