ios - How to merge SKSpriteNode into a SKTexture to form new SKSpriteNode in Swift 3? -


i'm developing ios app. have skspritenode on screen , i'm getting drawing user i'm storing sktexture. combine these 2 , introduce them new skspritenode.

the problem: cannot find documentation how merge skspritenode sktexture. i'm sure there's way this. have example code this?

you have use coregraphics this. convert both sktextures cgimage using sktexture.cgimage() method, combine them using coregraphics , create new texture result. sktexture.init(cgimage:) method let use cgimage object construct texture.

i haven't used core graphics much, here few links related reads. think want use cglayer class tell coregraphics how stack textures , reuse sprite texture on time coregraphics can cache make things faster.

core graphics uses quartz 2d fast 2d graphics operations. haven't played it, think should looking for.

references :

keep me posted, think it's interesting!

edit 1: have use skmutabletexture on sprite. class allows texture data changed dynamically.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -