Skip to content

Sorting layers #32

@pkulev

Description

@pkulev

Idea

Good combines with implementing some sort of projects.

  • Project is configuration file that contains user overrides for engine settings.
  • This file can be further created with an editor.
  • Example is sorting layers:
Settings.project.sorting_layers = [
    "GUI",
    "Player",
    "Enemies",
    "Pick-ups",
    "Background"
]

# Somewhere in game classes
class Background(Renderable):
    sorting_layer = "Background"
    ...

"default" is initial value for every untagged object.

This is unity-like alternative to Renderable.render_priority with meaningfulness instead of strange integers.

Implementation

  • add initial project config file with declarations for game and applying mechanism for it
  • Use sorting layers instead of render_priority
  • Implement sorting by defined priorities

Maybe a little difficult to implement sorting, need some kind of prototyping.

@taptap, let's discuss it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions