0

enter image description here

This is a Chinese word "夜". The word's outline build by UIBezierPath and CAShapeLayer.

like that:

enter image description here

I want to know, How to fill the word background color with the animation that like no.1 picture.

I know the word's medians position.

Do you have any idea? thanks.

some references:

=== Update

let anim = CABasicAnimation(keyPath: "strokeEnd")
anim.fromValue = 0.0
anim.toValue = 1.0

That's not my want. @LouFranco

enter image description here

Yifan
  • 1,185
  • 12
  • 18
  • some ideas here: https://stackoverflow.com/questions/29365732/how-to-animate-a-human-written-stroke-using-swift-ios?rq=1 -- the easy (and probably not good enough answer) is to animate strokeEnd from 0->1 on the CAShapeLayer. That simulates drawing the path – Lou Franco Oct 16 '17 at 11:56
  • @LouFranco thanks your ideas, this is outline-based fonts not stroke-based fonts, so I can't use `strokeEnd` – Yifan Oct 16 '17 at 12:18
  • I know this question is old, but could you solve that problem? I'm trying to animate chinese characters as well in the same way and don't know how to do it. – kirkyoyx Jan 13 '21 at 14:12

0 Answers0