Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable scroll the text of the ScrollTextBoxComponent if I do not use timePerChar #3088

Closed
1 task
brokenarmor451 opened this issue Mar 20, 2024 · 1 comment · Fixed by #3105
Closed
1 task
Labels

Comments

@brokenarmor451
Copy link

brokenarmor451 commented Mar 20, 2024

What happened?

If I use a large text in the ScrollTextBoxComponent without giving timePerChar, I can't scroll it fully with drags.

What do you expect?

I expected I can scroll the text through up down drags without using timePerChar.

How can we reproduce this?

Run the example code and try scroll the text.

What steps should take to fix this?

No response

Do have an example of where the bug occurs?

class PracticeGame extends FlameGame {

  @override
  Future<void> onLoad() async {
    await super.onLoad();

    add(
      ScrollTextBoxComponent(
        text: largeText,
        size: Vector2(100,100),
        position: Vector2(size.x / 2, size.y / 2 + 100),
        anchor: Anchor.topCenter,
        boxConfig: TextBoxConfig(
            margins: const EdgeInsets.fromLTRB(10, 10, 10, 10),
          ),
      )
    );
  }
}

void main() {
  runApp(GameWidget(game: PracticeGame()));
}

final largeText = """AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
""";

Relevant log output

No response

Execute in a terminal and put output into the code block below

Output of: flutter doctor -v
[✓] Flutter (Channel stable, 3.19.2, on Debian GNU/Linux 12 (bookworm)
6.1.0-17-amd64, locale en_US.UTF-8)
• Flutter version 3.19.2 on channel stable at
/home/username/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7482962148 (3 weeks ago), 2024-02-27 16:51:22 -0500
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /home/username/android_sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /home/username/android_sdk
• Java binary at: /usr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+7-Debian-1deb12u1)
• All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at
google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1

[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup
for detailed instructions).

[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Debian GNU/Linux 12 (bookworm)
6.1.0-17-amd64

[✓] Network resources
• All expected network resources are available.

Affected platforms

Android, Linux

Other information

I don't know if it is a bug or feature of the ScrollTextBoxComponent.
flame version 1.16.0

Are you interested in working on a PR for this?

  • I want to work on this
@spydon
Copy link
Member

spydon commented Mar 26, 2024

@KurtLa would you perhaps have time to take a look at this one? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants