Giter Club home page Giter Club logo

Comments (14)

czyzby avatar czyzby commented on May 22, 2024

I like the idea of "translating" clunky interfaces to Kotlin to add the missing nullability data. InputListener could go directly to the ktx-app module; not sure about InputProcessor though - doesn't it work on primitives, which are already assumed to be non-null?

ShaderProgram and TextureRegion extensions are nice, but I'm honestly not sure where to put them right now. (A similar use method could be added to Batch as well.) ktx-app, maybe? If we can think of enough extensions and utilities to justify this, we could start a new KTX module - ktx-graphics. For 3-4 methods it seems like an overkill. ; )

Sprite extensions create a new object on each call, which kind of goes against LibGDX policy (if there is one).

Rectangle, Vector2 and Random extensions would be great in ktx-math.

I did a similar thing with the alignment enum in gdx-lml, so I could parse alignment values in sort-of-HTML files - basically handling the string-to-int conversion. Without extensions methods that could consume the enum instances in Scene2D API, I don't see the use case for this in KTX - either way you're stuck with calling methods with ints.

Methods from KotlinExtensions.kt seem either too generic or too specific to your game needs.

Thank you for considering contributions. Please, keep merge requests to each module separate.

from ktx.

czyzby avatar czyzby commented on May 22, 2024

As far as Artemis utilities go, you can propose your solutions in #23 issue.

from ktx.

sreich avatar sreich commented on May 22, 2024

not sure about InputProcessor though - doesn't it work on primitives, which are already assumed to be non-null?

it's not just about nullability as my terrible comments neglect to mention...in my game for instance, i only actually want to implement a couple of those methods of the interface.

because libgdx targets java 6, doesn't have the default interface keyword..so you're forced to implement all functions even if they do nothing. so still a big benefit as far as cleaning it up goes.

from ktx.

czyzby avatar czyzby commented on May 22, 2024

in my game for instance, i only actually want to implement a couple of those methods of the interface.

An "adapter" of sorts then (Java libs seem to misuse the term, imho) - empty implementation to cut down the boilerplate. Yeah, I like that - since it's still an interface, I can see that it could be more useful than abstract classes with empty implementations that LibGDX provides.

from ktx.

sreich avatar sreich commented on May 22, 2024

yep. if libgdx targeted java 7 (actually i think..maybe 8 they arrived in), they could define their interfaces methods as eg 'public default void' and the method would be optional, and we wouldn't need this, but here we are 😄

from ktx.

czyzby avatar czyzby commented on May 22, 2024

Java 8. Yeah, Java is well known for its boilerplate ceremony.

Anyway, may I ask if you plan on using KTX in Ore Infinitum eventually? ; )

from ktx.

sreich avatar sreich commented on May 22, 2024

haha yes, been working on past few days (in a diff branch), been playing with the skin stuff and moving that over(and writing a new skin style), in between playing with coroutines for multithreaded world gen

from ktx.

czyzby avatar czyzby commented on May 22, 2024

Great. I already used KTX in game jams and the overall experience was, well, pleasant - no KTX bugs encountered, fortunately. But without some feedback from more developers and usage of KTX in a bigger project, I don't want to publish a non-beta release just yet. Don't hesitate to create an issue with some simple comments on the project if some part of it just doesn't "feel right".

from ktx.

sreich avatar sreich commented on May 22, 2024

yep, sounds good.

we should probably also have a 'uses ktx' list of projects in the readme or something so people can have real examples of it in action to take ideas from

from ktx.

czyzby avatar czyzby commented on May 22, 2024

I'm not comfortable linking to my dirty game jam code and empty "uses KTX" list wouldn't be so impressive, I'm afraid. Judging from the downloads from Maven Central, there are some KTX users out there, but none shared their story yet. But yeah, I'd like to create such list eventually.

from ktx.

czyzby avatar czyzby commented on May 22, 2024

If you don't mind, I can port some of your utilities to KTX (especially the math-related ones), so you can focus on ktx-tools.

from ktx.

sreich avatar sreich commented on May 22, 2024

Sure, if you want, you can steal whatever you find useful.

from ktx.

czyzby avatar czyzby commented on May 22, 2024

@sreich I think we moved all common utilities to KTX. I found the rest of the stuff too specific to your project or unlikely to be widely used. If you think something else should be added as well, please create a pull request. Thanks.

from ktx.

sreich avatar sreich commented on May 22, 2024

Yep, sounds good. My Artemis stuff I'll sit on for a while, see what changes I want for it etc.

from ktx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.