All Projects → didier-v → Godotnotificationcenter

didier-v / Godotnotificationcenter

Licence: mit
A notification center for Godot Engine

Projects that are alternatives of or similar to Godotnotificationcenter

Godot Next
Godot Node Extensions - Basic Node Extensions for Godot Engine
Stars: ✭ 438 (+918.6%)
Mutual labels:  godot, godot-engine
Gut
Godot Unit Test. Unit testing tool for Godot Game Engine.
Stars: ✭ 670 (+1458.14%)
Mutual labels:  godot, godot-engine
Godot 2d Space Game
A 2D space exploration and mining game made with Godot and our AI framework
Stars: ✭ 462 (+974.42%)
Mutual labels:  godot, godot-engine
Godot Android Admob Plugin
Android AdMob plugin for Godot Game Engine 3.2 or higher
Stars: ✭ 292 (+579.07%)
Mutual labels:  godot, godot-engine
Thrive
The main repository for the development of the evolution game Thrive.
Stars: ✭ 874 (+1932.56%)
Mutual labels:  godot, godot-engine
Godot Power Pitch
International pitch for the Godot Game Engine, made in Godot, available in 15+ languages
Stars: ✭ 348 (+709.3%)
Mutual labels:  godot, godot-engine
Godot Tiled Importer
Plugin for Godot Engine to import Tiled Map Editor tilemaps and tilesets
Stars: ✭ 488 (+1034.88%)
Mutual labels:  godot, godot-engine
godot-performance-comparison
Godot performance comparison between the `3.x` and `master` branch
Stars: ✭ 12 (-72.09%)
Mutual labels:  godot, godot-engine
Godot Open Rpg
Learn to create turn-based combat with this Open Source RPG demo ⚔
Stars: ✭ 855 (+1888.37%)
Mutual labels:  godot, godot-engine
Godot Addon Template
Repository template with a standard structure for Godot add-ons. Usage: Create a new repository based on this template and replace uppercase strings (LIKE_THIS) accordingly.
Stars: ✭ 23 (-46.51%)
Mutual labels:  godot, godot-engine
Godello
Trello inspired kanban board made with the Godot Engine and GDScript, powered by an online real-time collaborative backend (Elixir and Phoenix Channels)
Stars: ✭ 273 (+534.88%)
Mutual labels:  godot, godot-engine
Gdtwitch
A Godot to IRC to Twitch interface.
Stars: ✭ 42 (-2.33%)
Mutual labels:  godot, godot-engine
Godot Go
Go language bindings for the Godot Engine's GDNative API.
Stars: ✭ 254 (+490.7%)
Mutual labels:  godot, godot-engine
Godot Platformer 2d
2d Metroidvania-inspired game for the 2019 GDquest Godot Kickstarter course project.
Stars: ✭ 365 (+748.84%)
Mutual labels:  godot, godot-engine
viewport-spy
Godot editor UI to spy on what a Viewport is rendering. Useful for debugging.
Stars: ✭ 28 (-34.88%)
Mutual labels:  godot, godot-engine
Godot Steering Ai Framework
A complete framework for Godot to create beautiful and complex AI motion. Works both in 2D and in 3D.
Stars: ✭ 482 (+1020.93%)
Mutual labels:  godot, godot-engine
DartGodot
Godot + Dart 🎯
Stars: ✭ 79 (+83.72%)
Mutual labels:  godot, godot-engine
godot-interpolated-camera3d
Provides an InterpolatedCamera3D node that replicates its 3.2.x functionality (and more)
Stars: ✭ 40 (-6.98%)
Mutual labels:  godot, godot-engine
Godotsteam
Steam API for the Godot game engine
Stars: ✭ 746 (+1634.88%)
Mutual labels:  godot, godot-engine
Space rocks
Asteroids-like game made with Godot Engine 3.0.
Stars: ✭ 20 (-53.49%)
Mutual labels:  godot, godot-engine

GodotNotificationCenter

A notification center for Godot Engine

Compatible with Godot 3

Check branch 2.0 for a project compatible with Godot 1.1 and 2.x

Installation

Just add notification_center.gd to the autoload settings of your project

You only need the notification_center.gd script.

Check the demo project for more info.

Usage

Notifications are sent to observers. Any object can be an observer. Notifications can be sent from anywhere in your code.

If you need to add an observer or send a notification, get the root object:

var nc = get_node("/root/nc") # if you named it nc in the autoload settings

OR

var nc = $"/root/nc" # new Godot 3 syntax

To add an object as observer

nc.add_observer(observer,notificationName,action)

  • observer is the object added as an observer
  • notificationName is the ID of the notification. It is a String.
  • action is the name of a function that must be defined by the observer with 3 parameters:

func action(observer,notificationName,notificationData):

  • notificationData can by of any type. You can make a dictionary and include every needed data in it. It is sent with the notification.

To remove an observer

nc.remove_observer(observer, notificationName)

you MUST remove an observer, at least when it leaves the scene. Example:

func _exit_tree():
    nc.remove_observer(self, notificationName)

To send a notification

nc.post_notification(notificationName,notificationData)

Every observer of notificationName will execute its action.

Licence

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].