简体   繁体   中英

Draw string with chalk effect (cocoa/cocoa touch)?

is there good way to draw string with chalk effect? Can I draw a transparent string over a chalk texture image?

For iOS:

  1. Get a chalk texture image.
  2. Create a colour using [UIColor colorWithPatternImage:[UIImage imageNamed:@"chalkImage"]];
  3. Set this as the text colour for your label or text view or whatever.

For OSX:

  1. Get a chalk texture image.
  2. Create a colour using [NSColor colorWithPatternImage:[NSImage imageNamed:@"chalkImage"]];
  3. Set this as the text colour for your label or text view or whatever.

实际上,如果仅使用拉丁字母,则在MacOS和iOS中有一种叫做Chalkduster的很棒的字体。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM