Skip to content

MauriceButler/godot-layer-name-enums

Repository files navigation

Godot Layer Name Enums

Automatically generate user-friendly lookups of project layer names. Each layer will have its layer number and its bit available from the Enum

Usage

GDScript

func _ready() -> void:
	var render_layer_number = LayerNames.RENDER_2D.LAYER_8_NUM # 8
	var render_layer_bit = LayerNames.RENDER_2D.LAYER_8_BIT # 128

C#

public override void _Ready()
{
	var render_layer_number = (int)LayerNames.RENDER_2D.LAYER_8_NUM; // 8
	var render_layer_bit = (int)LayerNames.RENDER_2D.LAYER_8_BIT; // 128
}

Configuration

The plugin supports generating enums in multiple languages. You can configure the output format in:

Project -> Project Settings -> addons/project_layer_names/output

Options:

  • GDScript (default): Generate only GDScript enums
  • C#: Generate only C# enums
  • Both: Generate both GDScript and C# enums
image

Installation

Copy the addons/layerNames directory into your res://addons/ directory, or install via the Asset Library

Go to Project -> Project Settings -> Plugins and enable Layer Names.

install

License

Licensed under the MIT license

About

Automatically generates user friendly lookups of project layer names.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 5