Hi guys,
I recently started working with 2DToolkit and it is great!
Right now I am working on a game that utilizes the camera on the iPad and I would like to be able to at runtime, to take a picture and then add a small version as a thumbnail on a sprite.
What I am doing right now is I have four sprites loaded in with a placeholder texture on, and then as I take a picture I would like to replace that placeholder with the picture that I take. The picture that I take is in 600x600 resolution and the thumbnails is in 100x100 resolution.
The problem that I am facing right now is that when I chance the texture of the tk2dsprite at runtime it becomes stretches and blurry and doesn't fit.
The wierd thing is, if I use a normal unity plane the picture will resize perfectly to fit, but I would like to use the tk2dsprite, because I am in need of some of the functionality.
So my question is: How do I change the texture of a tk2dsprite at runtime and make sure that texture resizes to fit?
Here is the code where I change it:
thumbnailBoxes[currentActiveThumbnail].gameObject.renderer.material.mainTexture = frontCamTex;
Where ThumbnailBoxes is an array of 4 tk2dsprites.
I have also tried to change the texture using this command: sprite.GetCurrentSpriteDef().material.mainTexture
but that is giving me the same result as the other.
Hope my question is clear and that there is a solution
Thank you in advance
Peter