android - Painting texture in cocos2d-x -


i working on baby app , there bath scene in user applies soap baby's body. drags soap bar on body painting , soap bubbles appear on body wherever soap applied painting soap texture brush (soap bar).

i have soap bar sprite , texture sprite , baby sprite.

how can achieve effect ?

edit: have bubbles sprite. , want wherever user touches, opacity of point in sprite becomes 1 or 255. in start opacity 0 won't visible , when user drags soap on baby's body opacity become 255 every point user drags soap over.

here see soap bubbles sprite

i think achieve following way:

  1. place "baby bubbles" in cclayer (as sprite). background.
  2. create second layer in front of first , put cctexture2d it, filled white.
  3. whenever user touches screen, @ point, draw brush sprite texture. brush sprite must draw transparency.

this reference may help.

was helpful?


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -