Hello Guest

Author Topic: Creating a FullScreen texture problem  (Read 4835 times)

gonzalez.martin90

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 24
    • View Profile
Creating a FullScreen texture problem
« on: April 06, 2015, 02:06:47 pm »
Hi!
 i'm using a tk2d camera with the native resolution 960x640 and when i want to create a texture (Unity texture) of the Screen.width and Screen.height it doesnt fit unless the resolution is 960x640.
 Also it depends on the aspect ratio.

 is there a solution to create a full screen texture?

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Creating a FullScreen texture problem
« Reply #1 on: April 06, 2015, 03:08:46 pm »
Either
1. Resize your sprite to fit the ScreenExtents. This won't be pixel perfect, or even have square pixels for obvious reasons.
or
2. Create a second tk2dCamera that holds the background (use layer masks to make it only draw in there) with override set to StretchToFit. This will stretch the background to fit the screen, but won't be pixel perfect or have square pixels for obvious reasons.
or
3. Make your background sprite bigger to fit all the aspect ratios you care about, so when it draws more it has something to draw.

gonzalez.martin90

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Creating a FullScreen texture problem
« Reply #2 on: April 06, 2015, 03:58:19 pm »
Either
1. Resize your sprite to fit the ScreenExtents. This won't be pixel perfect, or even have square pixels for obvious reasons.
or
2. Create a second tk2dCamera that holds the background (use layer masks to make it only draw in there) with override set to StretchToFit. This will stretch the background to fit the screen, but won't be pixel perfect or have square pixels for obvious reasons.
or
3. Make your background sprite bigger to fit all the aspect ratios you care about, so when it draws more it has something to draw.

Thanks for the answer but the texture that im creating is a Unity Texture2D
 This is the problem.
I have a coloring app that the image is in black and white (black the borders)
So i want to take a screenshot with RenderTexture that its working fine and create a texture with the screenshot i took and put to it the screen size. But if i put screen.width and height depending the resolution is smaller.

Here i took a picture.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Creating a FullScreen texture problem
« Reply #3 on: April 06, 2015, 04:15:42 pm »
Same thing applies to Unity textures as well.

gonzalez.martin90

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Creating a FullScreen texture problem
« Reply #4 on: April 06, 2015, 04:20:47 pm »
Same thing applies to Unity textures as well.

Worked!

Thanks