Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be πŸ“–

Componentable

An asset by gump
The page banner background of a mountain and forest
Componentable thumbnail image
Componentable thumbnail image
Componentable thumbnail image
Componentable hero image

Quick Information

0 ratings
Componentable icon image
gump
Componentable

A Godot Plugin to create generic components to your project's logic to make better maintenance

Supported Engine Version
4.3
Version String
2.0.1
License Version
MIT
Support Level
community
Modified Date
8 months ago
Git URL
Issue URL

Componentable

A Godot Plugin to create generic components to your project's logic to make better maintenance

Works only on Godot 4.x versions


✨ New Version 2.0 ✨

  • Added new UI tab for componentable, easy to create, modify components and see current values
  • Automatic creation of componentable and components
  • New icons for components
  • Many bugs fixed

Future plans

  • Create a UI Editor for all values from components, so you don't need to select component nodes to change values


Table of Contents


πŸ“Ÿ What is Componentable?

The main goal of the Componentable is to create components to some classes to share responsibility between nodes.

Why use Components?

README Structure Comparation with componentable and without

With this you can split the logic in many scripts with low code, and you can customize some behaviours for many nodes with same scene

README Componentable properties

Example of selection of components on Componentable


Componentable Flow

README The componentable flow is the componentable will always be required, so when you create a component will always have a variable with the componentable as value, but componentable can call the component but the component could not exist.


πŸ”§ Installation

  • You can search "Componentable" on Godot Assets Library
  • You can download this repo, copy and paste the addons/componentable into your project's folder

πŸ“ Getting Started

Creating a Component

To start just select a node and in the "Componentable" tab click on Create Componentable

Then select a path and a name to your component, will create a Componen

Node don't need to have a script, componentable can be used with build-in types

So for in our component example Glowing will make the player glow with:

class_name Glowing extends PlayerComponent

#You can access the variable player to get the parent of this component, that is a class named Player

func _ready():
    if active: # active is a variable inside PlayerComponent to make some enabling behaviours
        create_tween().tween_property(player, "modulate:a", 0, 1)

then you select the Componentable node you can select the component


README

This list of components will show all components that is from this node type and node parent types

when selected a component will show up as a node in components node of your Componentable


README Alt text

Here you can see that we have two variables player that will be automatic assign as the Componentable Node, and the active variable, that will disable the behavior in your logic.

You can make more exported variables to create more customization to your component


Getting a Component from a Node

When you want to get a component from a Componentable, you can use:

var glowing: Glowing = Component.find(self, "Glowing")

If you want to get a component from a other node, you can use:

var glowing: Glowing = Component.find(player, "Glowing")

Just remember the component can be null


Adding or removing component in runtime

To add a component to a componentable in runtime you can use:

Component.subscribe(node, "ComponentName")

and to remove a component you can use:

Component.unsubscribe(node, "ComponentName")

Some others functions

Component.has(node, "component") # return true if this componentable have this component

Component.get_all(node) # return all components in this componentable

πŸ€” FAQ

  • I Found a BUG! Click here and open an issue
  • Can I help with the project? Sure! just send your PR :D
  • Can I contact you? Yep, send email to [email protected]

A Godot Plugin to create generic components to your project's logic to make better maintenance

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Componentable icon image
gump
Componentable

A Godot Plugin to create generic components to your project's logic to make better maintenance

Supported Engine Version
4.3
Version String
2.0.1
License Version
MIT
Support Level
community
Modified Date
8 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers