Iβm using Flutter with Flame both with the latest versions. Trying to set a background image for the game.
The issue is that background image does not fill the screen. It shows in the top left but only fills approx. half the height and width. However, if I create a Tile Layer and add a tile image in each corner they do show in the corners where they should be. I cant seem to get the background image to display properly and fill the screen but the map does.
In Tiled, I created a Tiled Map with a width of 120 and height of 68 using 16x16 Tile size. I then added an Image layer with a image (1920x1080). The image fills the entire map as I would expect.
In flutter I load the map using levelGrid = await TiledComponent.load('level2.tmx', Vector2.all(16));
I set the camera using CameraComponent.withFixedResolution(width: 1920, height:1080 )
Set anchor using camera.viewfinder.anchor = Anchor.topLeft;
[β] Flutter (Channel stable, 3.16.8, on Microsoft Windows [Version 10.0.19045.3930], locale en-US)
β’ Flutter version 3.16.8 on channel stable at C:\src\flutter
β’ Upstream repository https://github.com/flutter/flutter.git
β’ Framework revision 67457e669f (5 days ago), 2024-01-16 16:22:29 -0800
β’ Engine revision 6e2ea58a5c
β’ Dart version 3.2.5
β’ DevTools version 2.28.5
[β] Windows Version (Installed version of Windows is version 10 or higher)
[β] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
β’ Android SDK at c:\users\pcira\appdata\local\android\sdk
β’ Platform android-34, build-tools 34.0.0
β’ Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
β’ Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
β’ All Android licenses accepted.
[β] Chrome - develop for the web
β’ Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[β] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.0 Preview 2.0)
β’ Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Preview
β’ Visual Studio Community 2022 version 17.9.34407.89
β’ The current Visual Studio installation is a pre-release version. It may not be supported by Flutter yet.
β’ Windows 10 SDK version 10.0.22621.0
[β] Android Studio (version 2022.3)
β’ Android Studio at C:\Program Files\Android\Android Studio
β’ Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
β’ Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
β’ Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
[β] VS Code (version 1.85.2)
β’ VS Code at C:\Users\pcira\AppData\Local\Programs\Microsoft VS Code
β’ Flutter extension version 3.80.0
[β] Connected device (5 available)
β’ Pixel 7 Pro (mobile) β’ 2B021FDH300DXJ β’ android-arm64 β’ Android 14 (API 34)
β’ Pixel 2 XL (mobile) β’ 710KPLC0118120 β’ android-arm64 β’ Android 11 (API 30)
β’ Windows (desktop) β’ windows β’ windows-x64 β’ Microsoft Windows [Version 10.0.19045.3930]
β’ Chrome (web) β’ chrome β’ web-javascript β’ Google Chrome 120.0.6099.218
β’ Edge (web) β’ edge β’ web-javascript β’ Microsoft Edge 120.0.2210.144
[β] Network resources
β’ All expected network resources are available.
β’ No issues found!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too