Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Windows phone 10 black borders
Started by welton-alexandre Mar 24 2016 01:10 PM

34 replies to this topic
windows phone 10
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

The WP8 CoronaCards daily build with this work-around is available now.

If you can test it out with the above "main.lua" code I posted above and do that touch test, then that would be great.  Thanks.



[TOPIC: post.html]
#27

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Regarding the Lumia 535 device, you guys said if you disable fullscreen rendering, then it was displayed correctly, right?

If so, then please try changing your MainPage() constructor code to the following.  It'll reduce your framerate on the device to 30 FPS, but I'm not sure what else to do on this device.

public MainPage()
{
	// Initialize this page's components that were set up via the UI designer.
	InitializeComponent();

	// Set up Corona to automatically start up when the control's Loaded event has been raised.
	// Note: By default, Corona will run the "main.lua" file in the "Assets\Corona" directory.
	//       You can change the defaults via the CoronaPanel's AutoLaunchSettings property.
	fCoronaPanel.AutoLaunchEnabled = true;

	// Set up the CoronaPanel control to render fullscreen via the DrawingSurfaceBackgroundGrid control.
	// This significantly improves the framerate and is the only means of achieving 60 FPS.
	fCoronaPanel.BackgroundRenderingEnabled = true;
	fDrawingSurfaceBackgroundGrid.SetBackgroundContentProvider(fCoronaPanel.BackgroundContentProvider);
	fDrawingSurfaceBackgroundGrid.SetBackgroundManipulationHandler(fCoronaPanel.BackgroundManipulationHandler);

	// Disable fullscreen rendering on the Lumia 535 device if it's running Windows 10 Mobile
	// Note: This device has bugs where it reports the wrong resolution and scale factor.
	if (Environment.OSVersion.Version.Major >= 10)
	{
		var manufacturerName = Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer;
		var modelName = Microsoft.Phone.Info.DeviceStatus.DeviceName;
		if (!string.IsNullOrEmpty(manufacturerName) && !string.IsNullOrEmpty(modelName))
		{
			manufacturerName = manufacturerName.Trim().ToLower();
			modelName = modelName.Trim().ToLower();
			switch (manufacturerName)
			{
				case "microsoft":
				case "microsoftmdg":
				case "nokia":
					if (modelName.StartsWith("rm-1089") ||
						modelName.StartsWith("rm-1090") ||
						modelName.StartsWith("rm-1091") ||
						modelName.StartsWith("rm-1092"))
					{
						fCoronaPanel.BackgroundRenderingEnabled = false;
					}
					break;
			}
		}
	}
}

Run the above with the "main.lua" test code that I've posted and test Corona's touch events.  Drag your finger from the top of the screen to the bottom and make sure that the touch/drag circle is always centered around your finger.



[TOPIC: post.html]
#28

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Bad news.  I've done some more testing with the newest build on different Win10 resolution devices... but unfortunately apps are still scaling incorrectly.  And "touch" and "tap" points are offsetted too.  Each different resolution devices (WXGA, 720P, and 1080P) are all broken in their own way and there is no single reliable Microsoft API for us to use.  So, it looks like we have no choice but to avoid high-performance rendering via the "DrawingSurfaceBackgroundGrid" just as @primoz as suggested.  Unfortunately, the negative consequences of not rendering straight to the background is...

1) You can't render at 60 FPS.  Rendering is significantly slower.

2) The displayed contents will be blurry.  On a 720P device, it'll render at 480x800 scaled up.  On a 1080P device, it'll render at 768x1280 scaled up.

 

I *think* I've found a reliable way of detecting when Windows 10 Mobile's UI scaling is broken.  So, I think I can rig CoronaCards to not do fast background rendering on these devices.  This way, users of Windows 10 Mobile devices that have physical navigation buttons (aka: the ones that don't have scaling bugs) will have fast rendering using the actual resolution of the device.

 

I'll look into this tomorrow.  Thanks for your patience.  And sorry about the inconvenience.



[TOPIC: post.html]
#29

mimoz

[GLOBAL: userInfoPane.html]
mimoz
  • Observer

  • 14 posts
  • Corona SDK

I have tested newest CC on my devices. There is still black border on top (portrait), and touches are wrong. Anyway, black border on top is smaller. There is no more black border from side.

Maybe another workaround is to disable Nav buttons? In corona cannon they are hidden. How can I achieve this?

Thank you for all your work and help!



[TOPIC: post.html]
#30

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I acquired the WP8 Corona Cannon project yesterday.  When I run it on a Windows 10 Mobile device that has an onscreen navigation bar, it has the exact same scaling problems you guys mentioned.  So, I'm not sure how it could scale correctly for you @primoz.  And the C# code hasn't been changed at all.  Pretty much everything was left at its defaults, except for the app name and icon/tiles of course.

 

And as far as I know, there are no native APIs for showing/hiding the bottom navigatoin bar in Silverlight apps.  And the 1 Silverlight API for enabling/disabling fullscreen mode only hides/shows the top statusbar, not the bottom nav bar.  And my understanding is that Windows 10 Mobile doesn't allow users to swipe away the bottom nav bar while running a Silverlight app... but Windows 10 Mobile isn't supposed to overlap the bottom nav bar on top of a Silverlight app anyways.  On Windows Phone 8.1, the bottom nav bar does overlap the app, but can always be dismissed by the user. Anyways, that's been my experience.



[TOPIC: post.html]
#31

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Daily build #2861 will provide a much more reliable work-around for this issue.  Once the daily build becomes available, please give it a go and let me know how it works for you.  The scaling issues should be gone in that build.  But since my only recourse is to implment what I've mentioned in the above post, the framerate will be worse and the graphics will appear scaled up.  Not sure what else we can do at this point.



[TOPIC: post.html]
#32

mimoz

[GLOBAL: userInfoPane.html]
mimoz
  • Observer

  • 14 posts
  • Corona SDK

Have tested #2861, but it works so slow that we can not use it. Max framerate is 30, most of the time lower than 15. If I build one of our game with #2830 and comment out lines regarding BackgroundRenderingEnabled, then it works much faster and it is rendered almost correctly :). At bottom only about 5px are missing... It is overlapped by nav buttons. Max frame rate is 55, but newer lower than 40.
 
When Corona Cannon is started on my Lumia WP 10 devices, nav buttons are hidden and Corona Cannon downloaded from MS Store works perfectly in full screen, on all my WP 10 devices. I am unable to reproduce this behavior when I build Corona Cannon.
Looks like it has something to do with versions used when building game (VS or CC)?


[TOPIC: post.html]
#33

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

>> Looks like it has something to do with versions used when building game (VS or CC)?

 

Nope. Corona Cannon was built with Visual Studio 2013.  No C# changes were made to the project template.  When I build it and run it on a Lumia 550, I can see the same scaling issue as you.  But if I install the Corona Cannon app on the same device from the app store, it does not have any scaling issues and it allows me to swipe the bottom navigation bar on/off the screen.

 

So, I'm starting to *think* that this bad behavior only happens when you side-load the app onto your Windows 10 Mobile device.  If you take the same app you built and install it via the Microsoft app store, then your app will behave more like a Windows Universal app without the scaling issues and with a dismissible navigation bar.  (Well, except on the Lumia 535 unfortunately.)

 

To test this theory I've installed other Corona made apps such as "My Boo"...

   https://www.microsoft.com/en-us/store/apps/my-boo/9wzdncrdgbjx

 

And "Feed OmNomster"...

   https://www.microsoft.com/en-us/store/apps/feed-omnomster-the-hungry-monster/9wzdncrdlbnb

 

Both of the above apps do not have scaling issues and the bottom navigation bar is dismissible.

Try testing you own app currently on the app store on a non-Lumia 535 device, such as a Lumia 550 or Lumia 640 XL.  I'll bet it'll display correctly on those devices.

 

 

>> At bottom only about 5px are missing... It is overlapped by nav buttons

 

Yes, I've noticed the same thing on a 720P and WXGA resolution devices.  Unfortunately, there is nothing we can do about it.  Microsoft is incorrectly sizing the Silverlight native UI (ie: the MainPage) just under the navigation bar.  And there are no native Silverlight APIs to give us any navigation bar information.  So, there's nothing more we can do.

 

 

>> If I build one of our game with #2830 and comment out lines regarding BackgroundRenderingEnabled, then it works much faster

 

Yeah, I noticed the performance issue too.  The daily build you tested effectively prevents you from enabling background rendering, but unfortunately those SetBackgroundContentProvider() and SetBackgroundManipulationHandler() method calls cause a severe performance issue too because they're unnecessarily calling our code on every frame.  I'll look into getting you guys another update soon to resolve the performance issue.



[TOPIC: post.html]
#34

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Everyone,

 

Give daily build #2682 a try, which should come out sometime tomorrow.  This build will significantly improve the performance on the Windows 10 Mobile device having an onscreen navigation bar, while still providing that scaling work-around we've added in build #2681.  This work-around effectively disables background rendering for you so that don't have to do it yourself in your MainPage code... *AND* it'll only do so if Corona detects this scaling bug in Microsoft's APIs (such as the 2 native scale factor APIs returning different values).



[TOPIC: post.html]
#35

mimoz

[GLOBAL: userInfoPane.html]
mimoz
  • Observer

  • 14 posts
  • Corona SDK

Have tested #2682, it is slow, but it works. Already updated our apps. Thanks! 




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]