Files
GDevelop/Extensions/TextEntryObject/JsExtension.cpp
T
Harsimran Singh Virk 6667a0005c Remove deprecated/unmaintained Cocos2d-JS renderer files (#2956)
Only show in developer changelog
2021-08-23 12:27:47 +02:00

69 lines
2.1 KiB
C++

/**
GDevelop - TextEntry Object Extension
Copyright (c) 2011-2016 Florian Rival (Florian.Rival@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 DeclareTextEntryObjectExtension(gd::PlatformExtension& extension);
/**
* \brief This class declares information about the JS extension.
*/
class TextEntryObjectJsExtension : public gd::PlatformExtension {
public:
/**
* Constructor of an extension declares everything the extension contains:
* objects, actions, conditions and expressions.
*/
TextEntryObjectJsExtension() {
DeclareTextEntryObjectExtension(*this);
GetObjectMetadata("TextEntryObject::TextEntry")
.SetIncludeFile("Extensions/TextEntryObject/textentryruntimeobject.js")
.AddIncludeFile(
"Extensions/TextEntryObject/"
"textentryruntimeobject-pixi-renderer.js");
GetAllActionsForObject(
"TextEntryObject::TextEntry")["TextEntryObject::String"]
.SetFunctionName("setString")
.SetGetter("getString");
GetAllConditionsForObject(
"TextEntryObject::TextEntry")["TextEntryObject::String"]
.SetFunctionName("getString");
GetAllActionsForObject(
"TextEntryObject::TextEntry")["TextEntryObject::Activate"]
.SetFunctionName("activate");
GetAllConditionsForObject(
"TextEntryObject::TextEntry")["TextEntryObject::Activated"]
.SetFunctionName("isActivated");
GetAllStrExpressionsForObject("TextEntryObject::TextEntry")["String"]
.SetFunctionName("getString");
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if defined(EMSCRIPTEN)
extern "C" gd::PlatformExtension* CreateGDJSTextEntryObjectExtension() {
return new TextEntryObjectJsExtension;
}
#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 TextEntryObjectJsExtension;
}
#endif
#endif