Last active
November 7, 2016 18:19
-
-
Save mousebird/b1914f1833c39e137d4b90eec5c4a2d7 to your computer and use it in GitHub Desktop.
Smiley Face Stickers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func addStickers (_ arrayComp: NSArray , baseViewC: MaplyBaseViewController) { | |
// Pick up a smiley face image | |
let startImage = UIImage(named: "Smiley_Face_Avatar_by_PixelTwist") | |
var stickers = [MaplySticker]() | |
// Add a sticker for each input point | |
for object in arrayComp { | |
let sticker = MaplySticker() | |
let center = (object as! MaplyVectorObject).center() | |
sticker.ll = center | |
sticker.ur = MaplyCoordinate(x: center.x + 0.1, y: center.y+0.1) | |
sticker.image = startImage | |
stickers.append(sticker) | |
} | |
// Add all the stickers at once. It'll draw faster | |
baseViewC.addStickers(stickers, desc: [kMaplyFade: (1.0)]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment