Closed Joncom closed 5 years ago
This results in an ugly black letterbox effect.
Oh boy, guess we don't get around that storyboard crap after all.
From Discord chat:
Robert: Some weird backwards compatibility measures from Apple I suppose. Robert: It's a common thing in Apple and Microsoft operating systems.
if (exists(somenewfilenormallycreatedbyidesinceversionxyz)) return actualdata; else return someoldthing;
Robert: But to make sure you could create a regular iOS project, remove the storyboard thing, see if the result is the same.
With unmodified Xcode template:
With <key>UILaunchStoryboardName</key>
removed from Info.plist
:
Yay, my theory was accurate.
Oh noes, that means we have to add a storyboard.
Or maybe we can sell that as cinematic mode?
The following seems to work:
LaunchScreen.storyboard:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="qVO-8e-Oj3"/>
<viewControllerLayoutGuide type="bottom" id="Y9C-1R-Fay"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0" green="0" blue="0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
The solution for this involves:
Kore/Backends/System/iOS/Sources/Kore/LaunchScreen.storyboard
diff --git a/Kha/Kore/Tools/koremake/out/Exporters/XCodeExporter.js b/Kha/Kore/Tools/koremake/out/Exporters/XCodeExporter.js
index af887d7f..d3128ba1 100644
--- a/Kha/Kore/Tools/koremake/out/Exporters/XCodeExporter.js
+++ b/Kha/Kore/Tools/koremake/out/Exporters/XCodeExporter.js
@@ -54,7 +54,7 @@ class File {
return this.fileid;
}
isBuildFile() {
- return this.filename.endsWith('.c') || this.filename.endsWith('.cpp') || this.filename.endsWith('.m') || this.filename.endsWith('.mm') || this.filename.endsWith('.cc') || this.filename.endsWith('.s') || this.filename.endsWith('S') || this.filename.endsWith('.metal');
+ return this.filename.endsWith('.c') || this.filename.endsWith('.cpp') || this.filename.endsWith('.m') || this.filename.endsWith('.mm') || this.filename.endsWith('.cc') || this.filename.endsWith('.s') || this.filename.endsWith('S') || this.filename.endsWith('.metal') || this.filename.endsWith('.storyboard');
}
getName() {
return this.filename;
@@ -314,6 +314,8 @@ class XCodeExporter extends Exporter_1.Exporter {
for (let file of files) {
let filetype = 'unknown';
let fileencoding = '';
+ if (file.getName().endsWith('.storyboard'))
+ filetype = 'file.storyboard';
if (file.getName().endsWith('.plist'))
filetype = 'text.plist.xml';
if (file.getName().endsWith('.h'))
diff --git a/Kha/Kore/Tools/koremake/src/Exporters/XCodeExporter.ts b/Kha/Kore/Tools/koremake/src/Exporters/XCodeExporter.ts
index 1235b06e..c1b1abb9 100644
--- a/Kha/Kore/Tools/koremake/src/Exporters/XCodeExporter.ts
+++ b/Kha/Kore/Tools/koremake/src/Exporters/XCodeExporter.ts
@@ -72,7 +72,7 @@ class File {
}
isBuildFile() {
- return this.filename.endsWith('.c') || this.filename.endsWith('.cpp') || this.filename.endsWith('.m') || this.filename.endsWith('.mm') || this.filename.endsWith('.cc') || this.filename.endsWith('.s') || this.filename.endsWith('S') || this.filename.endsWith('.metal');
+ return this.filename.endsWith('.c') || this.filename.endsWith('.cpp') || this.filename.endsWith('.m') || this.filename.endsWith('.mm') || this.filename.endsWith('.cc') || this.filename.endsWith('.s') || this.filename.endsWith('S') || this.filename.endsWith('.metal') || this.filename.endsWith('.storyboard');
}
getName() {
@@ -358,6 +358,7 @@ export class XCodeExporter extends Exporter {
for (let file of files) {
let filetype = 'unknown';
let fileencoding = '';
+ if (file.getName().endsWith('.storyboard')) filetype = 'file.storyboard';
if (file.getName().endsWith('.plist')) filetype = 'text.plist.xml';
if (file.getName().endsWith('.h')) filetype = 'sourcecode.c.h';
if (file.getName().endsWith('.m')) filetype = 'sourcecode.c.objc';
Pull-request containing items 1 and 2: https://github.com/Kode/Kore/pull/360
Pull-request containing item 3: https://github.com/Kode/koremake/pull/65
This started happening right after fixing: https://github.com/Kode/Kha/issues/969
With the fix:
WIthout the fix: