mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-21 17:45:25 -04:00
a8559bfbbc
* Update all CMakeLists of extensions to use clang-format * Run clang-format on all Extensions * Update GDCore CMakeLists.txt to add clang-format * Run clang-format on GDCore files * Update GDJS and GDCpp CMakeLists.txt to add clang-format * Run clang-format on GDCpp and GDJS files
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
/**
|
|
|
|
GDevelop - Anchor Behavior Extension
|
|
Copyright (c) 2016 Victor Levasseur (victorlevasseur52@gmail.com)
|
|
This project is released under the MIT License.
|
|
*/
|
|
#if defined(GD_IDE_ONLY)
|
|
#include "GDCore/Extensions/PlatformExtension.h"
|
|
#include "GDCore/Tools/Localization.h"
|
|
|
|
#include <iostream>
|
|
|
|
void DeclareAnchorBehaviorExtension(gd::PlatformExtension& extension);
|
|
|
|
/**
|
|
* \brief This class declares information about the JS extension.
|
|
*/
|
|
class AnchorBehaviorJsExtension : public gd::PlatformExtension {
|
|
public:
|
|
/**
|
|
* \brief Constructor of an extension declares everything the extension
|
|
* contains: objects, actions, conditions and expressions.
|
|
*/
|
|
AnchorBehaviorJsExtension() {
|
|
DeclareAnchorBehaviorExtension(*this);
|
|
|
|
GetBehaviorMetadata("AnchorBehavior::AnchorBehavior")
|
|
.SetIncludeFile("Extensions/AnchorBehavior/anchorruntimebehavior.js");
|
|
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
|
|
};
|
|
};
|
|
|
|
#if defined(EMSCRIPTEN)
|
|
extern "C" gd::PlatformExtension* CreateGDJSAnchorBehaviorExtension() {
|
|
return new AnchorBehaviorJsExtension;
|
|
}
|
|
#else
|
|
/**
|
|
* Used by GDevelop to create the extension class
|
|
* -- Do not need to be modified. --
|
|
*/
|
|
extern "C" gd::PlatformExtension* GD_EXTENSION_API CreateGDJSExtension() {
|
|
return new AnchorBehaviorJsExtension;
|
|
}
|
|
#endif
|
|
#endif
|