Hello Guest

Author Topic: Drawing sprites and merging together  (Read 4255 times)

Euthyphro

  • Newbie
  • *
  • Posts: 20
    • View Profile
Drawing sprites and merging together
« on: June 17, 2014, 10:48:26 pm »
For my project I need to merge two transparent sprites onto one sprite by sampling data from one and merging certain pixels of that sprite onto another. Is there a way with tk2d to do this? Looking through the support docs I don't see any functionality that allows a dev to even sample what colour is at a pixel coordinate of a sprite image. Any suggestions? Coming from Systems.Drawing (which isn't supported in Unity, I'm kind of looking fo something along the lines of Bitmap.GetPixel(x,y) to sample and then redrawing the image from there.

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Drawing sprites and merging together
« Reply #1 on: June 18, 2014, 10:42:11 am »
Well you can use Texture2D.GetPixel and SetPixel to do what you like, but be warned its really really slow and uses a ton of memory.
You cant do this in tk2d directly, and for good reason - performance takes a dive as soon as you do this.