Unity- windowed fullscreen black borders - windows

Hi I'm new to unity and playing around to get used to everything.
I have been doing some tests and so far everthing is going ok but I stumbled on something I could not find a descent solution for.
When building the game I have black borders on the side. how can I get rid of them so the game is really full screen?
I disabled the display resolutiong box and hard coded in that the window goes 'Windows fullscreen' but now I have these anoying black borders.
Can anybody push me in the right direction?
Thanks.
This is what i tried as code. but no success.
Debug.Log(Screen.currentResolution); // check if i find the native screen resolution. test passed
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, true); //getting black borders. set test failed

What is your main camera setup like?
Could also be related to aspect ratio. If you're on a widescreen and it is set to 4:3 then you'll have black borders.

Related

Misplaced UI made with UI in hololens emulator

I got a small problem and I can’t really find the source of it. I just created a Canvas and put a Panel in the top right corner. I got it to the right scale at 3: for the Hololens and loaded it up in the Holoemulator. The problem is that even though the panel is supposed to be in the corner, it is placed almost in the middle of the screen in the end.
Is there anything I can do to fix this or is there something I am missing?
If I need to provide more information then please tell me.
Could you double-check the [Render mode] of your Canvas? Is it set as World Space? In this render mode, the Canvas will behave as any other 3D object and will render in front of or behind other objects in the scene based on 3D placement in the scene. You need to adjust the position of the canvas from the perspective of the camera.
However, according to your post, it seems that you want to place UI elements on the screen rendered on top of the scene. If so, You should turn the [Render mode] to [Screen Space - Camera]. More information please see: Canvas

SKSceneScaleModeResizeFill on ios8 scales improperly

I have written a game in SpriteKit using objective C and it works perfectly on ios9 but it looks hideous on ios8. I would really like to know how to fix this problem, either by “correcting” my mistake, or if I have no mistake then by finding a workaround for the bug in ios8.
I think I have really done all I can to make the problem as clear as possible, including making loads of screenshots to illustrate the problem and also making a new Xcode project that is as simple as possible while still showing the problem.
If you want to try the Xcode project, here is a link for it….
xcode project
If you want to see the screenshots of the problem, then here is a link for the screenshots.
Screenshots
Now I will try to explain the code I wrote and the problem illustrated in the screenshots.
PLEASE REMEMBER: My code works perfectly on iOS9.3. So my code is obviously not complete gargage. But admittedly, I am not an expert on handling screen rotation, so probably my code could be better.
I should probably mention that both scenes have scale mode set to SKSceneScaleModeResizeFill. I chose this mode because I had tremendous difficulty doing proper layouts for all possible screen sizes (including iPhone) when working with SKSceneScaleModeAspectFill. I do I hope I can solve this problem while sticking with SKSceneScaleModeResizeFill.
Anyway, my app is a SpriteKit game with two scenes. The main scene is the GameScene, where you play the game. And this scene has a pointer to the SettingsScene, where you can change the settings of the scene. (e.g. change the level of difficulty).
Anytime the user rotates the screen, GameViewController detects this change in viewWillTransitionToSize and tells the GameScene object about the new screen width and screen height. Game Scene then adjusts the positions of its sprites in consideration of the new screen orientation and then tells its SettingsScene object about the new screen width and height to that the Settings scene is properly laid out as well.
Please note that with this design, all sprites on BOTH scenes get repositioned any time the user rotates the screen REGARDLESS of which scene is actually active at that time..
As I said before, all works as expected on ios9.3. But on ios8, the result is attrocious. The screenshots illustrate one example of typical experience on ios8. If the user rotates the screen while using the game and then goes to the settings screen, he will see something awful. And will often be trapped in this terrible experience because the button for going back to the main game might not even be fitting on the screen anymore.
At first, it might seem like I am failing to reposition sprites for landscape mode in the settings scene. But this explanation is wrong. The text on the screen shows that the last layout was performed with the landscape orientation in mind.
So what is going wrong here?
Any suggestions would be highly highly highly highly appreciated.
Thanks!
-j
p.s. In case you don't want to look directly at the linked project file, here are some details about the example code. GameViewController implements viewTransitionToSize to handle any screen rotation. It directly tells the new screen dimensions to GameScene, which then tells SettingsScene. Both scenes rearrange their sprites in consideration of the new screen dimensions. And all goes well on ios9. On ios8, however, the inactive scene ends up looking hideaous when it is presented even though it clearly did reposition its sprites according to the new dimensions.
the problem is easily resolved by these lines....
gameScene.size = newScreenSize;
settingsScene.size = newScreenSize;
anytime the orientation changes.
This code is not required for ios9. The scene knows what size the screen is without assistance. But for ios8, it seems to be needed to add this code.

JavaFX animations are flickering

I have a window displaying a video stream with a twitter feed as an overlay.
When a new tweet is displayed, the current tweet animates out using a rotate animation and the next tweet is rotated into view. The animations are performed using a RotateTransition.
The app also switches between different cameras to display different streams. To give an indication of when the app switches to the next camera, I have a progressbar that fills using a Timeline object.
This works well, until I resize the window. The rotate animations start to flicker, along with the progressbars as they gradually fill.
As a test, I disabled the video stream, to see what's happening. The 'artifact' doesn't occur then and I can resize as much as I want. If I play the stream and don't resize, everything works well.
The video player is based on VLCJ, but the actual pixels are drawn on a WritableImage in an Imageview.
See the following images that illustrate the problem.
At the bottom right you can see 2 different progress bars (a ProgresBar and a ProgressIndicator).
A part of the flickering result is still visible below the second image. It somehow stays visible, probably because the area doesn't get redrawn.
Any idea what makes the flickering happen? Is there anything I can do to fix or avoid this?
I tried some VM options in IntelliJ: -Dsun.java2d.d3d=true -Dprism.forceGPU=true to somehow enable hardware acceleration, but that doesn't seem to help.
Disabling the progressbar fill animation doesn't help either.
I had a similar problem with some arcs and shapes that would flicker when its attributes / sizes were changed.
The solution to my problem was to make sure that the methods used to change the shapes were called from inside the JavaFX thread.
Platform.runLater(() -> {
arc.setStartAngle(30);
arc.setLength(45);
}

Gamesalad actor image mask with wiping mouse input

I've tried searching for 'actor mask with gamesalad', 'actor image mask with game salad', and 'image mask with gamesalad', but can't seem to even find the fundamentals for creating a mask on game salad.
Basically, I would like my final result to look like something splats on the screen, and then the player wipes it off with their finger which is where the mask part comes in.
I'm not 100% sure what you're asking but I think i know what you're getting at. Do you mean that you want to erase the part of a picture where a users finger has been? Abit like some sort of finger eraser tool?
If so I hate to say that Gamesalad doesn't do this at the moment. I had a quick play to see if it could be done with image modes but didn't have any luck. The only way I could think that you could do it is by having a solid colour background (which may not be in favour of you app design) and then spawning a 1x1pixel sized actor every 0.01 second when the touch is pressed on location of the finger. This would create the illusion that an item is being erased.
Hope that helps.

Achieving rolling image effect?

I am a newbie in designing flash content. I am designing a flash movie to put up in my website. I need clouds to roll in the background. I have a cloud image, but I want it to roll in the background as below.
<---cloud_img
---cloud_img<
--cloud_img<-
-cloud_img<--
cloud_img<---
loud_img<---c
oud_img<---cl
Is it possible to achieve this kind of effect in flash. I am using swish max to develop flash. Give me some ideas to achieve this effect smoothly.
The easiest way to achieve that is to make your image doubled horizontally, and then simply scroll it from left to right. When you reach the rightmost position (whole right image is showing), reset the position to the display the whole left image. Rinse. Repeat.
You might want to apply a single-image wide mask to the movieclip/sprite/image, so the extras don't show in the display.

Resources