Access camera/photos

Are you using a custom render script? The gui (ie .gui files) should always render in screen space and by design either zoom, stretch or fit to the available screen size (depending on the adjust mode set on the individual gui nodes). Make sure that the .guis you’re using are taking up the space defined in game.project and the system should do the rest.

UNLESS maybe you have disabled the adjust mode of the entire .gui? Make sure the Adjust Reference on the root of your .gui isn’t set to disabled:

22

Never heard of this before. iOS or Android? Can you please double check the size of all your icons and make sure you’re actually pointing to the correct icons in game.project.

Hmm… no i am not using a custom render script, the root of the .gui is set to “per node”. What do you mean with “Make sure that the .guis you’re using are taking up the space defined in game.project”?
“Fit” makes the proportions correct on almost all gui objects, but the background image(gui box) is in the middle with black on all sides.
“Zoom” makes the correct proportions on almost all gui objects but the background image(gui box) width goes to the edges, but height have black on top and bottom.
“Stretch” moves all gui objects to the side and i have black on top and bottom.

I have looked at the app icon images again and i have image sizes from 48 72 96 144 192, i have tied the smallest and the biggest and they show up the same on the device.

Can you try to make an app on Iphone x maybe and se if you have the same problem? or i guess you already have done that.

What I meant was that if the game.project file specifies a display width and height of 640x1136 then just make sure that your gui covers this area. The gui should stretch, zoom or fit to this area depending on the settings of individual gui nodes.

I’m actually not sure if we have an iPhone X at the office. Do we have one @Sara?

We just got one, I’ll investigate!

3 Likes

Yay!

I created a very simple app, is this the behaviour you are expecting?

In short: I added the launch images specifically for iPhone X (options available in release 1.2.118) and had to do some empty “anchor nodes” for the corner nodes. Didn’t see the icon problems you experienced. I’m attaching the project so you can see for yourself.

(Actually not sure if this is the optimal setup, @britzl might have a better solution, but it seems to work. :slight_smile: )

adjustments_iphonex.zip (32.3 KB)

3 Likes

Yes, then i know that i am the problem here, wasn’t that surprising, thank you for trying it out!

I have done all my UI pages with the “UI Router” asset from the Defold page. I downloaded the demo project and run it on my device, and that app have the same “error” as my app… so i guess something is wrong in that one then?

Photo 2017-12-13, 20 48 22

1 Like

Don’t worry we will figure this out! :slight_smile:

The last image looks like you haven’t specified the launch images for iPhone X resolution. If you download the project I attached in my last reply, you can copy the launch images to your project. You also need to specify them in game.project like this;

Regarding the icon, could it be that you have mistakenly selected an image file with wrong resolution? Double check that the resolution of the image should be the same as described by the label in game.project, ie app_icon_152x152 should be 152 by 152 pixels.

@sven Yes you are probably right regarding the app icon, added all the launch _images as well, but no difference.

Here is a small part of the project in a .zip that might help understanding what i am doing wrong. When i load this to my device i have the black at top and bottom.

I had to remove some launch_images to keep the file size down for upload.

defold_test.zip (1.9 MB)

1 Like

With “load this to my device” do you mean that you actually bundle it and load it to device with ios-deploy or Xcode? Or do you load it to device through the Project->Target system in the editor?

When I bundle and load the resulting .app file to my device using ios-deploy the app covers the whole screen (no black bars)…

When you added the launch image files to your own project, did you also select/specify them in your own game.project file before bundling?

What!!! it works for you? Yes i bundle it in Defold 2 editor and moved it to my device with ios-deploy.
Yes i have selected the images in the editor game.project file.

and when i downloaded your test project, adjustment_iphonex, bundled it and send it to my iphone, your application works as well.

2 Likes

Strange!
Would you be OK with me taking a look at your project, if so you can add me sven.andersson@king.com to your project temporarily (just let me know the project name so I find it in the list :slight_smile: ).

@sven sure! the name is Gifts.

1 Like

Immediately spotted something, I didn’t realise you were using your own Info.plist file, but I now see that it was mentioned previously in this thread… :slight_smile: Since last update we added some entries in the builtin Info.plist file for iPhoneX launch images. I suspect this is the culprit why you aren’t getting the native resolution on device.

You can either bundle once without your own Info.plist file to crosscheck with the builtin bundled one in the resulting folder, or just replace the UILaunchImages entry in your own with this:

<key>UILaunchImages</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{320, 480}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{320, 480}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{320, 568}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{320, 568}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{375, 667}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{375, 667}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{414, 736}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{414, 736}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-1024h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{768, 1024}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape-1024h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{768, 1024}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-1366h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{1024,1366}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape-1366h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{1024,1366}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-812h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{375, 812}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape-812h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{375, 812}</string>
    </dict>
</array>
3 Likes

Yes, damn it, that was the problem!! There I got to have my own plist file… :frowning:
Thanks for all the help, you guys are great!!

And yes, this thread is starting to get a bit long, not easy to follow and find stuff in it… maybe i should terminate it and start on a new one… because i guess i’m not finished asking you guys stupid questions.

3 Likes

Please continue asking questions, but create new forum posts instead of continuing this one! :slight_smile:

1 Like

Hi, i am trying to get life in my old app from 4 years ago, but now the app is crashing again when stoping and then starting the camera again, what did you do the last time you fixed this?

When my macOS camera started acting up, I sometimes had to “reset” it via command line.
Not entirely sure what that command was though. Perhaps this might help? (How To: Restart Your Camera in Mac OS X - Remkus de Vries)

Got iOS camera to not crash, but now when i try the Android build it crashes at once when i try to open the camera-extension… i am still using the dev-android2 branch… guess that one is also not up to date maybe with all manifest things and stuff?

this is from the AndroidManifest file i got from you many years ago

That branch is very old, and you should probably update to the latest release of the extension: