I create a empty image, give it a mask image, and load texture for it, but nothing changed.
Your code is correct, the only fix you need to make is set the Image Element color to white:
Yes it works !
But there is a very serious sawtooth ？
Yes, right now image masks support only single bit masking, so there is no fading:
Your best bet here is to remove any anti-alias from your mask texture or if you would like to enable smooth masking you can use a custom material with an opacity map in your element. Check this:
So I did as suggested and made a new material and added a black and white image as opacity map.
Then I set the blend type to alpha. However, I still cannot make it work.
This is my setup:
And this is the result:
Can you spot what I am missing?