Resizing with NGUI labels causing weird behaviour - facebook

I had a Facebook game, made with Unity utilizing NGUI. When the game loaded up for the first time, Facebook's dialog showed asking for permissions. To do this, the Unity container of the game is minimized.
The problem is when the game regained focus, some labels of the game were HUGE (And I mean huge, I could tell it was a label due to the color showing up, which was all I could see).
This happened everytime the game resized.

The problem was, in fact, in the labels. I had to make sure that all the labels had the Keep Crisp option set to "Never", so it wouldn't try to resize it and make everything weird and broken.

Related

How to make UI's border disappear in Play mode in Unity

In Game mode, the UI's border does not disappear, I have tried many times to fixed it but it still there.
Try disabling gizmos in the game view, but it's not likely to be the case.
Another thing may be any of your UI elements, try disabling and enabling them to see if the border disappears.
Or simply restarting Unity.

Unity AR UI not showing up

I have created a simple Unity AR Foundation app which places objects on a plane whenever the screen is touched. I would like to add some UI so the user can press a button rather than anywhere on the screen.
I have followed several different tutorials which seem to be doing mostly the same thing. I right-click the Hierarchy -> UI -> Button. I have scaled it so it should fit my mobile screen and anchored it to the center so it should be easy enough to find.
These are the canvas settings:
Might the UI somehow be hidden behind the camera feed from the AR Session Origin -> AR Camera? Am I missing any steps to anchor the UI to the screen?
As you can probably tell, I am very new to Unity but I feel like I have followed the tutorials for creating a UI, but it simply won't show. If you need more information, please just ask and I will provide.
Not sure but sounds like you might need to have that Canvas Scalar to scale with the screen size. Change the UI scale mode to Scale with Screen Size.
I was compiling the wrong scene. I had two very similar scenes, so when I compiled I didn't realize there were no changes and that I was inspecting the entirely wrong scene.
Once I changed to the correct scene the setup above worked as expected.

How do I keep the title bar from causing rendering issues in Metal?

When I draw any shape (Whether it's textured or not) it will flicker when I go to fullscreen and make the title bar show when I move the mouse to the top. It will turn lighter and then back for like a split second. I don't know if this happens with solid colors, but when I color the vertices and draw a gradient or apply textures, this happens. It's annoying, even though it's subtle. How can I fix it?
How to reproduce: Create a shape in Metal, either color the vertices differently to create a gradient, or apply a texture to it, and make the window fullscreen. Move the cursor to the top of the window. When the title bar shows up, the shape/texture will flash briefly. How can I fix that?
I am using macOS 1.15 Catalina.
This can be demonstrated even with the Xcode's example Metal game. Just go to fullscreen, show the title bar, and it will be unsmooth when you show and unshow the titlebar.
UPDATE: I have realized, that if I put the drawing code in viewDidLoad() instead of draw() this behavior will cease. How do I make it so that it's not buggy without having to only render ONE frame?
ANOTHER UPDATE: It does occur for solid colors.
This is a very difficult question, because I don't know what to try. This bug is also very hard to fix, because it only sometimes happens.
Example of the bug (Video)
Another example of the bug that displays the "white flicker" (Video)
Also this question was only half answered, because it turns out that I managed to fix the problem of the titlebar blocking the framerate, but there is still a problem with the white flash.
After watching your video, I understand what your problem is. In your case UI (Tittle Bar) is blocking the main thread, it's normal behavior because MTKView rendering occurs on the main application threads. You need to create a custom metal view and implement a render loop on a background thread.
Your best bet is to report this as a bug to Apple. I tried to research and there seems to be no results about this bug.
I assume you want a fix, but all I got is a workaround:
It doesn't seem to occur while the drawing code only runs once, in viewDidLoad. Maybe you could keep it there, and manually call the MetalView's draw method 60 times a second. I figured out how to get what I said to work. Leave the drawing code in draw, but make sure to set the preferred framerate to 0. Then manually redraw it 60 times a second. Because the draw method auto redrawing is buggy in this sense.

Sprites are disappearing when I zoom in Unity

In the scene view when I zoom in past a certain point all the sprites (apart from one) disappear and it makes it near impossible for me to edit them because they become too small to see clearly.
This only just started happening everything was fine before and I don't think I have really changed anything that could have affected their ability to show when zoomed in.
The z positions have to be same as that of the canvas I am using
Press the F key a couple of times after selecting the sprite... it's for focus or something after you see it focus ...you will be able to zoom in endlessly to edit this is for sure a bug....I tried restarting unity first..then I tried adjusting the clipping low rate on the camera that is usually 0.3 to pure 0...and that was not it... the F key always gets it done I don't know why...also I changed the cameras near clipping plane back to 0.3 because it was not the issue.

UIScrollView sporadically loses bounce and fluid scrolling

I have successfully implemented a working UIScrollView layer on top of Cocos2d using this fantastic tutorial:
http://bitbattalion.com/2011/09/uikit-uiscrollview-and-cocos2d/
However, the scroll view sporadically becomes sluggish and choppy, including almost always upon loading the scene. When it happens, the scrolling and is no longer is able to be flicked up or down with any sort of variable velocity. It also loses all of it's bounce and just stay partially of screen until the next touch is registered.
The weird thing is though, that if I simply pull down my Notification Center, it fixes the scroll view every time. The scrolling all of a sudden becomes perfectly fluid and the edges bounce beautifully into place.
What is happening here?
Instruments may help to tackle the problem. Run using the CoreAnimation Tool so you can get a good handle on where you might be experiencing the drop in frame rate. You'll need to have your device connected to run the CoreAnimation tool.
This tutorial is also available at http://mobileoverlord.com/instruments-optimizing-core-animation/
Select Profile from the build scheme.
Select the CoreAnimation Profiling Tool
When the tool is running scroll around in your scroll view and keep an eye on frame rate. 60 is great.
If you need to dial in on it any more you can turn on Color Blended Layers from the Debug Options in the Instruments Panel View(Menu) -> Instruments
Without Color Blended Layers (Left)
With Color Blended Layers (Right)
The basic rule of thumb here is, the more red you see the less optimized the view is for the animation. Although, you don't want to remove all red either, %50 is about right.