-
Notifications
You must be signed in to change notification settings - Fork 47
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
Introduce ISquidPanel that both the awt and gdx panels implement #81
Conversation
…anel implement. It is merely the extraction of the methods of SquidPanel, except that the type of colors is generic (ISquidPanel<T>). This'll help users that want to maximize their codebase that is shared between awt and android. Add ICombinedPanel that shows how to lift ISquidPanel to more expressive interfaces and added IColoredString to have an abstraction of string where differents parts have different colors, that is supported by ISquidPanel. Left an interrogation in the gdx implementation of SquidPanel regarding ISquidPanel::refresh().
I didn't realize how impressive this was by just scanning the summary; IColoredString is a great idea and so is the shared interface in general. I think
Would mean the code becomes platform-specific rather quickly. Still, if rendering is isolated to one chunk of code, the interface should be handy. It's my opinion that there isn't much reason to use Swing other than slightly smaller game filesizes for distribution and slightly less code needed to get started, since the GDX version has all the features Swing does and more but isn't snail-paced when the user presses too many keys or you try to add animations. This is unrelated to the PR, but you mentioned GDX being used on Android. I'm concerned about the GDX class SquidInput and what it means for Android (it won't work, currently). SquidInput is meant to handle complex user input, like modifier keys or caps lock and modifier keys simultaneously, and caps lock is tricky to query in a cross-platform way. LWJGL, which LibGDX uses for display on desktop, uses AWT to do it, and LibGDX doesn't provide any way to find the state of caps lock on android (not sure if it makes sense there either). I can get rid of the check for caps lock and treat it as if shift-pressed means capital-letters every time, regardless of caps lock, and then it should work on android. I might post an issue about this for feedback. Merging. I may make some changes, but you did some rather excellent cleanup and added some nice abstractions here. |
Introduce ISquidPanel<T> that both the awt and gdx panels implement, introduce IColoredString to have a cross-platform way of handling colorful text, ICombinedPanel introduced as a partial SquidLayers interface
Thank you for merging this. I do not use gdx yet in my roguelike since I'm getting started and did not take the time to install gdx properly (but I need to do it, since a game for a small screen is pretty different from a desktop game..). Hence, if
|
For me the choice of Swing was made not because of the roguelike grid I know one of the things that halted progress on libjcsi back in the day
|
I'm very much for dropping support for Swing in favor of LibGDX as the preferred/"blessed" display stack. The last few people that commented on any issue seems to not use Swing, but LibGDX (not sure what @devilbuddy is using/is planning to use on android) |
I've written my own custom renderer based on the tilemap renderer from libgdx |
Personally, I feel like the -util module has the most... utility, for the most games, even just on its own with a custom renderer. I don't think the text-based display code is critical for many uses of SquidLib, but for roguelikes I can certainly see the appeal. I think with the right instruction on where and how to start, a newcomer to SquidLib could set up a libGDX project as easily as a Swing one, and with scene2d.ui in libGDX, there's even less reason to cover both. I'm reluctant to make a major change like this without knowing more about who uses SquidLib, but since the consensus seems to be toward dropping Swing support (and because Swing is drastically slower to render and to respond to input than GDX), I'm in favor as well. I think dropping SquidLib for Swing should probably be during the 3.0 release frame; everyone's 2.x code is breaking with the Point-to-Coord changes anyway, so they might as well upgrade to a faster/better/more-responsive renderer at the same time. The API is certainly fairly close for everything but animations and images (and the aforementioned |
ISquidPanel<T>
is merely the extraction of the methods of SquidPanel, except that the type of colors is generic (T
). This'll help users that want to maximize their codebase that is shared between awt and android.