GithubHelp home page GithubHelp logo

littlektframework / littlekt Goto Github PK

View Code? Open in Web Editor NEW
280.0 280.0 9.0 56.39 MB

A multiplatform 2D game framework written in Kotlin. Build your own game engine on top.

Home Page: https://littlekt.com

License: Apache License 2.0

Kotlin 100.00%
2d 2d-game-framework android desktop framework game game-engine game-framework gamedev html5 ios kotlin kotlin-multiplatform linux macos mobile multiplatform opengl webgl windows

littlekt's People

Contributors

lehaine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

littlekt's Issues

Add Audio Stream support

Enable support for streaming longer pieces of audios such as music in mp3 format vs loading all at once.

Rework how OpenGL versions are handled in context

Currently, it feels very odd checking the version of OpenGL by determining if its 3.0 or higher. Perhaps we could do something similar to setting the versions based on a list of booleans for each major version or a helper class / function / extension that can check it.

Add combined keyboard, mouse, and gamepad typed input system

A system that allows any type to be used to determine the currently input based on a list of inputs given from multiple control sources.

Pseudo:

interface GameInput {
    JUMP,
    RUN,
    ATTACK
}

...
input.registerType<GameInput>()
input.addBindings(GameInput.JUMP, Keys.SPACE, Gamepad.A)
...

UI: Fix issue with determining size and placement of a child `Control` inside a `Container`

The UI scene graph calculates and fits children controls from the bottom up.

paddedContainer {
    minWidth = 200f

    centerContainer {
        label {
             text = "test"
        }
    }
}

The Label minimum size will be calculated first, then the CenterContainer and then lastly the PaddedContainer.
If the Label minimum width is 40f that means the CenterContainer minimum width will be 40f. The CenterContainer is then fitted into the PaddedContainer at 200f but doesn't update the Label to recenter itself. The Label will only be centered on that 40f width instead of the 200f width.

This happens for all Control and Container components. We need to update it so these updates propagate back down to the children to be fitted again.

Add a `Drawable` interface that allows to be rendered in a UI control

Currently, we have controls that require textures, texture slices, and ninepatches. It would be nice to have a single interface type that can be implemented for specific items that needed rendered so that UI controls can utilize them for rendering.

Example: The Button class requires a texture slice currently, but would be great to use a NinePatch as well to render the background.

interface Drawable {
    // determine fields
}

class TextureDrawable(val texture: Texture): Drawable {
    // impl drawable functions
}

class NinePatchDrawable(val ninepatch: NinePatch): Drawable {
    // impl drawable functions
}

// with ninepatch
val texture = readTexture()
val ninepatch = NinePatch(texture, 2, 2, 2, 2)

button {
    backgroundDrawable = NinePatchDrawable(ninepatch)
}

button {
    backgroundDrawable = TextureDrawable(texture)
}

Implement UI system

Base work off of rune UI work done previously for Libgdx. Should be able to port pretty easily.

Integrate ANGLE into LittleKt

Since LittleKt is based on OpenGL and there are no plans to create a Metal renderer, we can look into integrating ANGLE somehow into the project to work with Metal.

Gradle: Create a gradle plugin that can pack textures automatically into an atlas based on configurations

Should be able to automatically pack images of a specified directory into a JSON based atlas file and placed into resources on compile or triggered via task.

https://en.wikipedia.org/wiki/Bin_packing_problem

Suggested features:

  • Uses a MaxRects packing algorithm
  • Rotate images 90 degrees for efficient packing
  • De-duplication of images that are the same
  • Add padding between each image
  • Adds borders to each image to prevent bleeding
  • Output as the default JSON types
  • Able to specify input and output directories
  • Specify the maximum width and height of each page / texture that is outputted

UI: Add Theme propagation

If a theme changes on Control, then that theme needs to propagate down throughout the child Control nodes to update their sizes, due to Drawable components in the theme most likely having different sizes.

UI: Add mouse filtering to `Control`

Allow a Control node to consume / filter mouse clicks.

If a Panel or PanelContainer is clicked or hovered over, then a button beneath that node should be be able to be pressed.

Consume mouse:

  • Button
  • Panel
  • PanelContainer

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.