playMaker

Author Topic: Draw Texture as full-screen image [SOLVED]  (Read 3416 times)

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
    • View Profile
Draw Texture as full-screen image [SOLVED]
« on: January 16, 2014, 04:27:09 PM »
When my game starts, there are a few images I've created that display to introduce the player to the game.

I made the image 1920 x 1080 pixels. I figured bigger is better, because [in other programs] you can always shrink the image down and retain crispness. It seems that Unity handles shrinking of images differently.

I'm using the playmaker "draw texture" action and setting the image as the texture. When the game starts, Unity tries to fit the image to the screen. My monitor resolution is 1680 x 1050, and the image looks pretty bad.

Is there another method to display a full-screen image that might work better?  If not, is there an implementable action for checking the user's screen size and displaying a properly sized image?

Thanks!!
« Last Edit: April 03, 2014, 08:12:06 PM by Breadman »

redikann

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Draw Texture as full-screen image
« Reply #1 on: January 17, 2014, 08:34:39 PM »
Did you try the 3 different scale modes.

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
    • View Profile
Re: Draw Texture as full-screen image
« Reply #2 on: January 17, 2014, 08:47:53 PM »
Yeah, I gave them a shot but the texture still gets messed up :/

I did a weird workaround by using "gui box" with no background/style, and set the box image to the texture I need - this helps the image not look AS compressed and weird (I guess Unity handles guibox differently than draw texture), but it's still not perfect. Additionally, using Gui Box gives less control over the size of the image - changing the box size doesn't change the image size, it's strange.

I wonder if there even is a way to optimize image shrinking within Unity's GUI, or if I'll just have to create a separate set of GUI images for each possible resolution X_X

redikann

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Draw Texture as full-screen image
« Reply #3 on: January 17, 2014, 09:47:58 PM »
Did you check your texture in your asset folder. Bumping up the resolution might help.

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
    • View Profile
Re: Draw Texture as full-screen image
« Reply #4 on: January 18, 2014, 11:45:02 AM »
That's the problem, the resolution is already higher than my monitor size. The image is 1920 x 1080, my monitor (and therefore the game when full screen) only measures 1680 x 1050.

So, I thought to myself the image will be too big and get reduced, which is better than having an image which is too small and having to enlarge it. However, it seems that my current methods result in a blurry picture even if the source image is larger than the desired size.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Draw Texture as full-screen image
« Reply #5 on: January 21, 2014, 05:20:06 AM »
Hi,

 check this:

http://pixelplacement.com/2010/12/17/the-solution-to-image-backgrounds-in-unity/

I think this is what you need, it could help you setting it up properly.

bye,

 Jean

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
    • View Profile
Re: Draw Texture as full-screen image
« Reply #6 on: January 21, 2014, 09:29:34 AM »
Thanks Jean! I'll give this a try later on today :D

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
    • View Profile
Re: Draw Texture as full-screen image
« Reply #7 on: April 03, 2014, 08:11:56 PM »
Quickly bringing this thread back from the dead in case anyone has the same issue and arrives here by searching:

To ensure textures/images etc display correctly, for any GUI /non 3D uses:

  • Select the image in your project window
  • In the inspector window, set "texture type" to "GUI"

key

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: Draw Texture as full-screen image [SOLVED]
« Reply #8 on: November 05, 2017, 03:59:48 PM »
To quote Breadman:
Quote
Quickly bringing this thread back from the dead in case anyone has the same issue and arrives here by searching:
This script doesn't work in Unity 2017. :(