uptechteam / MotionViews-Android

Code Guide: How to create Snapchat-like image stickers and text stickers.
https://blog.uptech.team/how-to-create-snapchat-like-stickers-for-android-50512957c351
MIT License
479 stars 112 forks source link

How to set sticker on predefine location using dp or px? #42

Open patelmanthan777 opened 6 years ago

patelmanthan777 commented 6 years ago

You already user PointF but i want to use dp or px so, Is there any method in library to set location of text sticker place at predife location which is in dp or px?

mianaliasjad commented 4 years ago

Di you find any solution for this issue?

daniel-stoneuk commented 4 years ago

Call entity.moveCenterTo like so:

val entity = ImageEntity(layer, pica, motionView.width, motionView.height)
motionView.addEntityAndPosition(entity)
entity.moveCenterTo(PointF(motionView.width * 0.2f, motionView.height * 0.2f))