Unity Game for Universal Windows 10 Platform - multiple devices confusion? - c#

I am going to develop simple 2D game in Unity for Universal Windows Platform (Windows 10) and I am confused with these multiple devices.
Windows 10 Mobile phone is absolutely different from large desktop so:
How to make menu gui and game user interface compatible with all devices?

Add a Canvas Scaler component to the Canvas. This will automatically resize the elements, to match the current resolution. You can even change it runtime to resize all the UI elements at once.
Set the scale mode to Scale with screen size.

Related

How to access camera frames in Universal Windows Platform

I am developing an application for Windows 10 phone on Universal Windows Platform. I need to get a frame from the devices camera and do some processing; this is supposed to happen in the background, the user is not supposed to see the camera feed anywhere in the UI.
There are two classes that handle the most common use cases, namely CameraCaptureUI and MediaCapture. The MediaCapture class allows to grab the so called preview frame but the whole workflow revolves around binding a MediaCapture instance to a UI control (ie CaptureElement) and if I do not do it then I am unable to get the preview frames. This makes the MediaCapture class unsuitable for my case unless there is another way to use it that I am not aware of.
An answer to a related question How to get preview buffer of MediaCapture - Universal app suggests usage of Lumia Imaging SDK but it is targeted at Windows 8 family and the classes and methods used there are now deprecated in the current Lumia Imaging SDK for Windows 10.
Additionaly, the aforementioned answer brings up custom media sinks but I am unsure if that can help me in my scenario and if yes, then where should I start.
To sum up, how do I acquire frames from a camera device that can be used for further processing in a Windows 10 universal app?
There are multiple options available to you for this. CameraCaptureUI is not one of them.
Hide the CaptureElement
Opacity = 0
Visibility.Collapsed
Create it in code and don't add it to your layout
etc.
StartPreviewToCustomSink (https://msdn.microsoft.com/en-us/library/windows/apps/hh700850.aspx) although I've never done this. This link might also help.
Once you've done that, you can take photos or just get preview frames. The CameraStarterKit will teach you the former, CameraGetPreviewFrame will teach you the latter.
How about you put a CaptureElement in UI, but hide it with overlay or set width / height to 1 ? Its kind of a hack but it will provide you the frame.

Windows Phone 8.1 play a sound effect in C# WPF application

I'm making a simple 2d game using WPF where the game objects need to emit a sound when they hit the walls of the screen, but I can't find anything that lets me play a sound effect in Windows Phone 8.1.
In Windows Phone 8 I was using the SoundEffect class from XNA, but I don't think XNA is supported in 8.1 any longer. Is there any equivalent class I can use?
Use a <MediaElement> with MediaElement.AudioCategory set to ForegroundOnlyMedia
If you want more controlled sound playback, you'll need to use DirectX.

What are the limitations of scaling to multiple resolutions on WP7

I 'am developing an app targeted to WP7.1 but I want it to work well on WP8 devices too. Assuming creating layout using dynamic resizng elements (grids with auto height etc) will the app scale just like WP8 app under Windows Phone 8 (WP8 handles WVGA HD WXGA resolutions)? If yes, is this possible to get a exact screen size under WP7 and what about in-app images in high resolution? If not, should I build 2 different apps to handle scaling well? One for WP7 and another for WP8 (even if the only change is build target?)
WP7 only supports 800x480 resolution and will automatically scale on WP8.
WP7 app cannot however do any resolution dependant tweaks when app runs on WP8. You need to recompile it to WP8

Windows Phone 8 - Run XNA in higher resolution

We have an XNA game, that is meant to run on Windows Phone 8 as well as 7.1.
Everything in-game works on higher resolution phones like WXGA, but our game runs at 800x480 since that is the only supported size for WP7.
Is there a way to detect higher res phones for XNA and set the PreferredBackBufferWidth and PreferredBackbufferHeight appropriately?
Or is there basically not a way to do this with the available XNA support on Windows Phone 8?
XNA may not support this but it looks like MonoGame (open source port of XNA which works on WP8) will support the higher resolutions. See Nokia's topic on MonoGame and WP8 for a primer.
You need to port your game to DirectX for WP8 to support higher resolutions.

How to develop screen resolution independent smart device application in C#?

I am developing smart device application in C#. I am developing this application for 240*320 screen resolution. I want to make this application screen resolution independent so that it can run on different mobile devices with different screen resolutions. Currently I am testing my application on different emulators for platform- Pocket PC 2003, Windows mobile 6 standard SDK & Windows Mobile 6 professional SDK . When I run the application on emulator for 240*320 screen resolution or less than that it works well ( only it provide the horizontal & vertical scrall bar in case of resolution less tha 240*320). If I run my application on emulator with more than 240*320 screen resolution its User Inferface gets badly affected. How to make the smart device application screen resolution independent ? Can you provide me the code or link through which i can resolve the above issue? Is there any setting for making the application screen resolution independent?
You should apply the Docking or Anchoring techniques.
http://www.codeproject.com/KB/mobile/MOB4DEVS03.aspx

Categories

Resources