constrain coronaview in CoronaCards PhoneGap/Cordova Android

Hi Guys,

I am n00b to CoronaCards and trying to figure out some basic stuff. I have gone through the docs and developed some simple games as well with CoronaSDK. I am trying to port them to CoronaCards (mostly to learn).

  1. The coronaview shows up fine, but only took a small portion of the screen. A scaling factor of 3 seems to work on the 3-4 devices I have tested, but it’s a hack. I would think there is a perhaps a better way to do this ?

view = new CoronaView(0, 0,Math.floor(3 * $window.innerWidth), Math.floor(3 * $window.innerHeight)); 

 

  1. is it possible to constrain the coronaview to a div in HTML ? 

 

Thanks for your help. 

 

Avi

I’m not sure I follow. Are you saying you can’t use the full screen or you only want to use part of the screen?

Rob

Thanks for your reply Rob.

There are two use cases (both for CoronaCards Phonegap with app being developed in Ionic currently for Android)

For 1. I want to use the full screen, but CoronaView shows up only in a small space when I initialize it with window.innerHeight/innerWidth. I scale it by a factor of 3 (which I found by trial and error), and then it occupies the full screen which is great , but I am afraid that this factor of 3 might not work on all devices. So, I am looking for the correct way to do this.

For 2., I want to constrain the CoronaView to a div so that I can show more UI elements on the screen and hide the view when appropriate. (Yes, I can control the x,y,w,h params of coronaview so that it takes the appropriate screen space after using the scaling factor above, but adding it to a div will allow me to use Ionic features like ng-show / ng-hide etc). 

Hopefully, this all makes sense. Thanks for your help. 

I’m not sure I follow. Are you saying you can’t use the full screen or you only want to use part of the screen?

Rob

Thanks for your reply Rob.

There are two use cases (both for CoronaCards Phonegap with app being developed in Ionic currently for Android)

For 1. I want to use the full screen, but CoronaView shows up only in a small space when I initialize it with window.innerHeight/innerWidth. I scale it by a factor of 3 (which I found by trial and error), and then it occupies the full screen which is great , but I am afraid that this factor of 3 might not work on all devices. So, I am looking for the correct way to do this.

For 2., I want to constrain the CoronaView to a div so that I can show more UI elements on the screen and hide the view when appropriate. (Yes, I can control the x,y,w,h params of coronaview so that it takes the appropriate screen space after using the scaling factor above, but adding it to a div will allow me to use Ionic features like ng-show / ng-hide etc). 

Hopefully, this all makes sense. Thanks for your help.