Any samples for Windows 8 Native with Corona in the middle

Does anyone have an example of how to use Corona in the middle of the screen ( contents area ) and have 1 or 2 Native Windows Phone sections / panels / whatever.

Maybe one for adds and another for Microsoft Native Controls.

See attached image

Also I would like to see a few different Corona Windows 8 Templates that could help with speeding up development. One that supplies the Ads area and also has this native control area as well with the Windows hooks in place.

That would be a big help.

Thanks

Larry

Corona is implemented as a XAML control on WP8.  So, yes, you can definitely lay it out as you have described on WP8 using the XAML layout containers Microsoft already provides.

If you double click on your “MainPage.xaml” file in Visual Studio, it’ll display the UI designer.  Notice that our CoronaPanel XAML control is embedded in a DrawingSurfaceBackgroundGrid container.  What you can do is set up the DrawingSurfaceBackgroundGrid with 3 rows as follows:

  1. Left click on the “DrawingSurfaceBackgroundGrid” text in the XML panel.  (This will display its settings in the “Properties” panel.)

  2. In the “Properties” panel, expand the “Layout” section.

  3. Click the “…” button for the “RowDefinitions” property.  (You might have to click the “down” button to see this property.)

  4. In the RowDefinitions window, click the “Add” button 3 times to add 3 rows.  (You can modify their heights later.)

  5. Click the OK button to close the window and accept the change.

  6. Drag and drop the CoronaPanel control into the middle row.  (This would be “Row 1”, because the row numbers are zero based.)

  7. Right click on the CoronaPanel control and click on the “Layout\Fill All” in the popup menu to make sure it’ll fill that row for all screen resolutions.  (This is in case you didn’t position in perfectly within the row and the UI designer added an x/y coordinate to your XAML.)

  8. To the left of each row line in the UI designer, you should see a triangle.  Drag it to the height that you want.

Now, there is 1 problem with the above.  In the “MainPage.xaml.cs” file, notice that your C# code is set up to render fullscreen to the background.  Instead of just within the CoronaPanel control’s area.  It is set up this way because this is the only means of achieving 60 FPS, which is a WP8 limitation.  If you don’t mind having your app render at 30 FPS, then the simple solution is to disable background rendering as follows…

  1. Modify your “config.lua” to render at 30 FPS, because 60 FPS will be impossible.

2) Double click on the “MainPage.xaml.cs” file in the “Solution Explorer” panel.

3) Delete or comment out the following lines from your MainPage constructor.

fCoronaPanel.BackgroundRenderingEnabled = true; fDrawingSurfaceBackgroundGrid.SetBackgroundContentProvider(fCoronaPanel.BackgroundContentProvider); fDrawingSurfaceBackgroundGrid.SetBackgroundManipulationHandler(fCoronaPanel.BackgroundManipulationHandler);

When you build and run your app after the above changes, notice that it renders within CoronaPanel exactly how you’ve set it up in the XAML UI designer.

Also note that the reason 60 FPS is impossible is because the CoronaPanel has to use Microsoft’s “DrawingSurface” XAML control, which Microsoft document as having performance issues because its content is rendered to a texture on every frame instead of directly to the screen.  The reason it does this is because this is the only means of rendering to a “portion” of the screen on WP8.  If this isn’t acceptable for your app, then you’re not going to want to use the above solution.  What you’ll want to do instead is keep the CoronaPanel fullscreen and display the ad XAML controls inside of the CoronaPanel control.  For example, notice in the XAML UI designer that you can drag-and-drop XAML controls inside of the CoronaPanel, and by doing so, you’ll see that the added control’s XML is added as a child element under the CoronaPanel XML node.  So, the only trick here is that you have to calculate what the height of the XAML control is onscreen dynamically so that your Lua script won’t render content behind the ad XAML control.  This is much more complicated, so, let me know which way you want to go.

Regarding your Windows 8 question, I assume that you’re talking about “Windows Store Apps”, aka: Metro apps, right?

If so, Corona does not support this platform yet.  This is because Windows Store apps compile to a completely different binary (*.appx files) and uses a different XAML UI framework which is WinRT C++/CX component based.  These kind of apps cannot run on Windows Phone 8.0, but can run on 8.1.

Windows Phone 8.0 Silverlight apps, which is what Corona currently targets, produces a *.xap file and uses the Silverlight XAML UI framework, which is .NET based.  These apps cannot run on Windows 8 (or Windows RT), but can run on Windows Phone 8.0 and 8.1.  Windows Phone 8.0 is the dominant version in the market right now and if you’re part of a Microsoft incentive program, that’s the version Microsoft wants you to target.

I would say that Windows 8 is months away because only about 60% of our WP8 code base is re-usable on that platform.  We would have to rewrite the UI code from scratch because, as I mentioned above, it uses a different UI class framework (ie: it’s not Silverlight based).

Yeah, we’re catching Microsoft during a painful transition period.  It used to be that you would have to code your WP8 and Win8 apps separately, because Microsoft did not support Universal apps before.  That changed as of last Spring when Windows Phone 8.1 was released, but we have Corona developers who are partaking in Microsoft’s incentive program to port their apps to Windows Phone 8.0, so, that’s the top priority platform at the moment.  Our plan is not to support every Corona feature on 8.0 since we will eventually have to transition to 8.1 and Win8, which involves rewriting 40% of our code to support it.  So, yeah, that’s the challenge we all face.  :slight_smile:

Love the responses - BUT sorry for the confusion - I meant Windows Phone 8.1 apps based on the design image provided above.

And since you told me that - I can go check it out in more detail now.

Thanks a bunch.

Larry

Oh, gotcha.  Are there are any compelling features in a Windows Phone 8.1 Silverlight project that you’re not seeing in an 8.0 project?  From what I’ve played with, and admittedly I haven’t played with it much, it appears that the project settings and UI have been re-arranged.  I kind of like sticking to an 8.0 project template from a tech-support and documentation standpoint, but if there is something that I’m unaware of in 8.1 that you or other need, then yes, creating a project template for 8.1 Silverlight is something we can do.  Although, you’ve probably seen that Visual Studio has an option to convert an 8.0 project to 8.1.

Worked like a champ, thanks much.

Larry

Corona is implemented as a XAML control on WP8.  So, yes, you can definitely lay it out as you have described on WP8 using the XAML layout containers Microsoft already provides.

If you double click on your “MainPage.xaml” file in Visual Studio, it’ll display the UI designer.  Notice that our CoronaPanel XAML control is embedded in a DrawingSurfaceBackgroundGrid container.  What you can do is set up the DrawingSurfaceBackgroundGrid with 3 rows as follows:

  1. Left click on the “DrawingSurfaceBackgroundGrid” text in the XML panel.  (This will display its settings in the “Properties” panel.)

  2. In the “Properties” panel, expand the “Layout” section.

  3. Click the “…” button for the “RowDefinitions” property.  (You might have to click the “down” button to see this property.)

  4. In the RowDefinitions window, click the “Add” button 3 times to add 3 rows.  (You can modify their heights later.)

  5. Click the OK button to close the window and accept the change.

  6. Drag and drop the CoronaPanel control into the middle row.  (This would be “Row 1”, because the row numbers are zero based.)

  7. Right click on the CoronaPanel control and click on the “Layout\Fill All” in the popup menu to make sure it’ll fill that row for all screen resolutions.  (This is in case you didn’t position in perfectly within the row and the UI designer added an x/y coordinate to your XAML.)

  8. To the left of each row line in the UI designer, you should see a triangle.  Drag it to the height that you want.

Now, there is 1 problem with the above.  In the “MainPage.xaml.cs” file, notice that your C# code is set up to render fullscreen to the background.  Instead of just within the CoronaPanel control’s area.  It is set up this way because this is the only means of achieving 60 FPS, which is a WP8 limitation.  If you don’t mind having your app render at 30 FPS, then the simple solution is to disable background rendering as follows…

  1. Modify your “config.lua” to render at 30 FPS, because 60 FPS will be impossible.

2) Double click on the “MainPage.xaml.cs” file in the “Solution Explorer” panel.

3) Delete or comment out the following lines from your MainPage constructor.

fCoronaPanel.BackgroundRenderingEnabled = true; fDrawingSurfaceBackgroundGrid.SetBackgroundContentProvider(fCoronaPanel.BackgroundContentProvider); fDrawingSurfaceBackgroundGrid.SetBackgroundManipulationHandler(fCoronaPanel.BackgroundManipulationHandler);

When you build and run your app after the above changes, notice that it renders within CoronaPanel exactly how you’ve set it up in the XAML UI designer.

Also note that the reason 60 FPS is impossible is because the CoronaPanel has to use Microsoft’s “DrawingSurface” XAML control, which Microsoft document as having performance issues because its content is rendered to a texture on every frame instead of directly to the screen.  The reason it does this is because this is the only means of rendering to a “portion” of the screen on WP8.  If this isn’t acceptable for your app, then you’re not going to want to use the above solution.  What you’ll want to do instead is keep the CoronaPanel fullscreen and display the ad XAML controls inside of the CoronaPanel control.  For example, notice in the XAML UI designer that you can drag-and-drop XAML controls inside of the CoronaPanel, and by doing so, you’ll see that the added control’s XML is added as a child element under the CoronaPanel XML node.  So, the only trick here is that you have to calculate what the height of the XAML control is onscreen dynamically so that your Lua script won’t render content behind the ad XAML control.  This is much more complicated, so, let me know which way you want to go.

Regarding your Windows 8 question, I assume that you’re talking about “Windows Store Apps”, aka: Metro apps, right?

If so, Corona does not support this platform yet.  This is because Windows Store apps compile to a completely different binary (*.appx files) and uses a different XAML UI framework which is WinRT C++/CX component based.  These kind of apps cannot run on Windows Phone 8.0, but can run on 8.1.

Windows Phone 8.0 Silverlight apps, which is what Corona currently targets, produces a *.xap file and uses the Silverlight XAML UI framework, which is .NET based.  These apps cannot run on Windows 8 (or Windows RT), but can run on Windows Phone 8.0 and 8.1.  Windows Phone 8.0 is the dominant version in the market right now and if you’re part of a Microsoft incentive program, that’s the version Microsoft wants you to target.

I would say that Windows 8 is months away because only about 60% of our WP8 code base is re-usable on that platform.  We would have to rewrite the UI code from scratch because, as I mentioned above, it uses a different UI class framework (ie: it’s not Silverlight based).

Yeah, we’re catching Microsoft during a painful transition period.  It used to be that you would have to code your WP8 and Win8 apps separately, because Microsoft did not support Universal apps before.  That changed as of last Spring when Windows Phone 8.1 was released, but we have Corona developers who are partaking in Microsoft’s incentive program to port their apps to Windows Phone 8.0, so, that’s the top priority platform at the moment.  Our plan is not to support every Corona feature on 8.0 since we will eventually have to transition to 8.1 and Win8, which involves rewriting 40% of our code to support it.  So, yeah, that’s the challenge we all face.  :slight_smile:

Love the responses - BUT sorry for the confusion - I meant Windows Phone 8.1 apps based on the design image provided above.

And since you told me that - I can go check it out in more detail now.

Thanks a bunch.

Larry

Oh, gotcha.  Are there are any compelling features in a Windows Phone 8.1 Silverlight project that you’re not seeing in an 8.0 project?  From what I’ve played with, and admittedly I haven’t played with it much, it appears that the project settings and UI have been re-arranged.  I kind of like sticking to an 8.0 project template from a tech-support and documentation standpoint, but if there is something that I’m unaware of in 8.1 that you or other need, then yes, creating a project template for 8.1 Silverlight is something we can do.  Although, you’ve probably seen that Visual Studio has an option to convert an 8.0 project to 8.1.

Worked like a champ, thanks much.

Larry