Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Breadman on January 16, 2014, 06:27:09 PM

Title: Draw Texture as full-screen image [SOLVED]
Post by: Breadman on January 16, 2014, 06: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!!
Title: Re: Draw Texture as full-screen image
Post by: redikann on January 17, 2014, 10:34:39 PM
Did you try the 3 different scale modes.
Title: Re: Draw Texture as full-screen image
Post by: Breadman on January 17, 2014, 10: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
Title: Re: Draw Texture as full-screen image
Post by: redikann on January 17, 2014, 11:47:58 PM
Did you check your texture in your asset folder. Bumping up the resolution might help.
Title: Re: Draw Texture as full-screen image
Post by: Breadman on January 18, 2014, 01:45:02 PM
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.
Title: Re: Draw Texture as full-screen image
Post by: jeanfabre on January 21, 2014, 07: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
Title: Re: Draw Texture as full-screen image
Post by: Breadman on January 21, 2014, 11:29:34 AM
Thanks Jean! I'll give this a try later on today :D
Title: Re: Draw Texture as full-screen image
Post by: Breadman on April 03, 2014, 11: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:

Title: Re: Draw Texture as full-screen image [SOLVED]
Post by: key on November 05, 2017, 05: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. :(