In Unity a UI image is resized in web player - unity3d

I am making a 2D game with Unity 3D. I have a canvas and an image inside it. When I run the project in Unity I can see the whole image, but when I run it on the web player I can only see a part of it. It looks like the image has been scaled up in the web player.
In the inspector I have set the size of the image to make it fit the size of a canvas. Why is it so big in the web player?

I have just noticed that actually the image is not resized. It's simply much less detailed.

Related

How to set Camera View a Specific Area in UI

My all project works in UI. One of my scene has videoPlayer and I would like to set my MainCamera to that specific Area. This scene is my Recording scene but for recording I have to use canvas Render Mode and has to be "Screen Space - Camera". How I can set my camera view to that specific area.
I tried 2nd camera with culling mask but didn't work because videoplayer is already my UI's child when camera Renders UI showing all children objects.
Is it possible show to camera whereever I want in UI?
enter image description here
Yessir it sure is. I literally had to do this a couple of days ago. Here is a tutorial/video I followed to figure out how to do it for my application. From the sounds of it, all you need to do is follow the video up to ~3 minutes. Then utilize the end product of getting a camera to showcase something in a UI window for your application.
For reference if the video gets deleted the process is as follows:
Create a new GameObject within the Canvas
Add a Raw Image as a child to to the new GameObject
We want a raw image because Raw Images in particular support the addition of a 2d Texture and this is what we need in order to display the Camera view.
Add a new Camera as a child to the GameObject
Create a new Render Texture in you Project Folder
Add the Render Texture to your Camera's Camera Component in the Target Texture field
Add the Render Texture to you Images Raw Image Component in the Texture field
Move the Camera to what you want to view and it should project to your UI GameObject.
If it doesn't do this correctly or the image has weird aspect ratios, check the dimensions in the Render Texture and your Image. It took me a while to get everything to look normal but it really just takes dimension adjustments.
Hope this helps!

What objects and APIs would I use to fill the unity game window with custom graphics?

I need to build an app using Unity which doesn't use a traditional camera to generate the graphics. I'll build them using some custom shaders and a few cameras whose results get stuffed in rendertextures and then frobbed. (Think http://www.purplefrog.com/~thoth/art/kaleidescope/kaleid1.html but even weirder)
I'm not sure what objects I would put in the scene to accomplish this. In any normal app you just put a camera and point it at the right spot and Unity gets the pixels into the window, but that is just not how this thing will work.
I'm not sure if I should be using a UI Canvas or what APIs would be used to copy various render textures into the proper locations.
If you are not targeting WebGL you can create a RenderTexture of the proper size (maybe using RenderTexture.GetTemporary) and use Graphics.CopyTexture or other techniques to assemble the image you want displayed in the game window.
Once you have the pixels you want in the RenderTexture you can use Graphics.Blit(src, (RenderTexture)null); which will copy the pixels into the game window. These pixels will be stretched if the game window is not the same size as the RenderTexture.
This technique worked for me in the editor's game window, but when I compile it to WebGL, all I get is a mostly-grey screen with a really big black rectangle in the bottom left.

Sprites quality is very bad in Game window in Unity

I have created a 2D project. The images I used for sprites are all with high resolution. However I do not know what settings I have changed today, the sprites in game window started look terrible when I tested the game(good quality in scene window). And this happens to all of the projects I created earlier. But when I build the exe file to play, the graphics look all good with original quality. Could anyone tell me how to fix this issue?
Scale back the game view to 1x and change the size of your camera instead or set your sprites to their original size if they have been resized
If you have a Retina screen, make sure you uncheck the following checkbox.
Watch this screencast
For 2D game also make sure Projection property in Camera component is set to Orthographic

Google Cardboard "Game Over" screen with a designed image

I am trying to implement a game over screen for my Unity 3D based game for Google Cardboard. I have tried using the image UI component on a canvas component. The image appears just fine but the issue is that it seems to show up over the reticles. I would like to have the image perfectly fit the inside of the reticle. I am considering somehow finding out (somehow) the size of the reticle and exporting my image as a png with transparency around its graphics.
My Question:
Is there a better way to do this? If not, what are the dimensions i can use for the duplicate images (for the two reticles) to perfectly fit the Google Cardboard reticle openings.
When using Google Cardboard (Now GVR), I think it is best to use Quad GameObject for Game Over screens to which you can add images and child objects like 3D Text and collection of child quads.
The best thing about using quads and 3d text is the extent of scripting that can be done to make them dynamic as well as styling. And in your case, Physics Raycasters work well for the reticle to interact with those GameObjects.
You can add materials and textures to the quad and what not! I personally love quads for GameOver screens as well as a lot of other interact-able things.

How to create an image as a smaller scale of the present scene?

I'm working on this ios app project with cocos2d, and I need to create an image that looks the same as the present scene but smaller, so I wonder if there's any way I can form an image directly from the scene with any functions?
You can check this link: Cocos2d ScreenShot. It's a small extension to make a screen shot as a 2D texture.
After you just have to create a sprite with this texture and scale it down.