My text appears to be stretched, but my square and circle do not.

NkSxlcW.png

I added CoronaCards to my landscape game, setting the frame of the CoronaView to the frame of the UIView it is a subview of.  (578 x 271).  CoronaView sits on top of a UIView which routes the user’s camera through it, using OpenCV for processing.  The black bar at the bottom is a TabBar.

Config.lua file set up as follows:

application = { content = { width = 578, height = 271, scale = "zoomStretch", fps = 24, }, orientation = { default = "landscapeRight", supported = { "landscapeRight" }, }, }

Main.lua is:

display.setDefault( "background", 0, 0, 0, 0 ) local myText = display.newText( "Hello World!", 500, 200, native.systemFont, 144 ) myText:setFillColor( 1, 0, 0 ) local myRectangle = display.newRect( 200, 100, 80, 80 ) myRectangle.strokeWidth = 3 myRectangle:setFillColor( 0.5 ) myRectangle:setStrokeColor( 1, 0, 0 ) local myCircle = display.newCircle( 500, 300, 30 ) myCircle:setFillColor( 0.5 ) myCircle.strokeWidth = 5 myCircle:setStrokeColor( 1, 0, 0 )

Try removing the orientation portion of config.lua.

Hi @bryan.m.mitchell,

In addition to this, “zoomStretch” is a scale setting that I highly recommend you do not use. It’s useful in a very small percentage of cases, but generally it should be avoided.

Best regards,

Brent

Try removing the orientation portion of config.lua.

Hi @bryan.m.mitchell,

In addition to this, “zoomStretch” is a scale setting that I highly recommend you do not use. It’s useful in a very small percentage of cases, but generally it should be avoided.

Best regards,

Brent

Similar problem, on landscape ipad it still setup portrait the coronaview. Here some code:

config.lua

application = { launchPad = false, content = { antialias = false, width = 768, height = 1024, scale = "zoomEven", fps = 60, imageSuffix = { ["@2x"] = 2, }, }, }

build.settings

settings = { orientation = { default ="landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, },

- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. \_coronaController = [[CoronaViewController alloc] init]; [self addChildViewController:\_coronaController]; CoronaView \*coronaView = (CoronaView \*)\_coronaController.view; coronaView.coronaViewDelegate = self; coronaView.frame = self.view.frame; NSLog(@"frame %f %f", self.view.frame.size.height, self.view.frame.size.width); [self.view addSubview:coronaView]; [coronaView run]; }

\<?xml version="1.0" encoding="UTF-8" standalone="no"?\> \<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="ol5-Eu-ixQ"\> \<dependencies\> \<deployment defaultVersion="1552" identifier="iOS"/\> \<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/\> \</dependencies\> \<scenes\> \<!--View Controller--\> \<scene sceneID="Gy2-91-4cd"\> \<objects\> \<viewController extendedLayoutIncludesOpaqueBars="YES" id="ol5-Eu-ixQ" customClass="ViewController" sceneMemberID="viewController"\> \<view key="view" contentMode="scaleToFill" id="JkB-aJ-IyO"\> \<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/\> \<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/\> \<color key="backgroundColor" red="1" green="0.66501517290000001" blue="0.23641310760000001" alpha="1" colorSpace="calibratedRGB"/\> \<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/\> \</view\> \<navigationItem key="navigationItem" id="czX-PL-kEJ"/\> \<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/\> \</viewController\> \<placeholder placeholderIdentifier="IBFirstResponder" id="MW0-5r-00B" userLabel="First Responder" sceneMemberID="firstResponder"/\> \</objects\> \<point key="canvasLocation" x="-1472" y="-37"/\> \</scene\> \</scenes\> \<simulatedMetricsContainer key="defaultSimulatedMetrics"\> \<simulatedStatusBarMetrics key="statusBar"/\> \<simulatedOrientationMetrics key="orientation"/\> \<simulatedScreenMetrics key="destination"/\> \</simulatedMetricsContainer\> \</document\>

CoronaCards operates differently from Corona SDK in a few respects.

First, build.settings is ignored, because CoronaCards only controls ann individual view, not the entire app. If you need to control orientation for your entire app, you would edit the Info.plist directly.

Second, the orientation of the CoronaView is controlled by iOS’s viewcontroller mechanism directly. 

Third, if you want a CoronaView with a landscape *aspect ratio*, set the width/height in landscape orientation (e.g. w=480, h = 320) in config.lua. This is *different* from Corona SDK where config.lua is set in portrait orientation (e.g. w=320, h=480).

And if you are going to change config.lua, it should be set to the same aspect ratio you use for your CGRect frame for the CoronaView instance on the Obj-C side.

Similar problem, on landscape ipad it still setup portrait the coronaview. Here some code:

config.lua

application = { launchPad = false, content = { antialias = false, width = 768, height = 1024, scale = "zoomEven", fps = 60, imageSuffix = { ["@2x"] = 2, }, }, }

build.settings

settings = { orientation = { default ="landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, },

- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. \_coronaController = [[CoronaViewController alloc] init]; [self addChildViewController:\_coronaController]; CoronaView \*coronaView = (CoronaView \*)\_coronaController.view; coronaView.coronaViewDelegate = self; coronaView.frame = self.view.frame; NSLog(@"frame %f %f", self.view.frame.size.height, self.view.frame.size.width); [self.view addSubview:coronaView]; [coronaView run]; }

\<?xml version="1.0" encoding="UTF-8" standalone="no"?\> \<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="ol5-Eu-ixQ"\> \<dependencies\> \<deployment defaultVersion="1552" identifier="iOS"/\> \<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/\> \</dependencies\> \<scenes\> \<!--View Controller--\> \<scene sceneID="Gy2-91-4cd"\> \<objects\> \<viewController extendedLayoutIncludesOpaqueBars="YES" id="ol5-Eu-ixQ" customClass="ViewController" sceneMemberID="viewController"\> \<view key="view" contentMode="scaleToFill" id="JkB-aJ-IyO"\> \<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/\> \<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/\> \<color key="backgroundColor" red="1" green="0.66501517290000001" blue="0.23641310760000001" alpha="1" colorSpace="calibratedRGB"/\> \<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/\> \</view\> \<navigationItem key="navigationItem" id="czX-PL-kEJ"/\> \<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/\> \</viewController\> \<placeholder placeholderIdentifier="IBFirstResponder" id="MW0-5r-00B" userLabel="First Responder" sceneMemberID="firstResponder"/\> \</objects\> \<point key="canvasLocation" x="-1472" y="-37"/\> \</scene\> \</scenes\> \<simulatedMetricsContainer key="defaultSimulatedMetrics"\> \<simulatedStatusBarMetrics key="statusBar"/\> \<simulatedOrientationMetrics key="orientation"/\> \<simulatedScreenMetrics key="destination"/\> \</simulatedMetricsContainer\> \</document\>

CoronaCards operates differently from Corona SDK in a few respects.

First, build.settings is ignored, because CoronaCards only controls ann individual view, not the entire app. If you need to control orientation for your entire app, you would edit the Info.plist directly.

Second, the orientation of the CoronaView is controlled by iOS’s viewcontroller mechanism directly. 

Third, if you want a CoronaView with a landscape *aspect ratio*, set the width/height in landscape orientation (e.g. w=480, h = 320) in config.lua. This is *different* from Corona SDK where config.lua is set in portrait orientation (e.g. w=320, h=480).

And if you are going to change config.lua, it should be set to the same aspect ratio you use for your CGRect frame for the CoronaView instance on the Obj-C side.