tried to rename some stuff
This commit is contained in:
Binary file not shown.
@@ -9,6 +9,6 @@ offset_right = 79.0
|
|||||||
offset_bottom = 29.0
|
offset_bottom = 29.0
|
||||||
text = "Click me!"
|
text = "Click me!"
|
||||||
|
|
||||||
[node name="GDExample" type="GDExample" parent="."]
|
[node name="DiscordRPC" type="DiscordRPC" parent="."]
|
||||||
position = Vector2(0.0676828, 0.462702)
|
position = Vector2(0.847451, 10.8162)
|
||||||
texture = ExtResource("1_qdvaq")
|
texture = ExtResource("1_qdvaq")
|
||||||
|
@@ -1,21 +1,21 @@
|
|||||||
#include "gdexample.h"
|
#include "main.h"
|
||||||
#include <godot_cpp/core/class_db.hpp>
|
#include <godot_cpp/core/class_db.hpp>
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
void GDExample::_bind_methods() {
|
void DiscordRPC::_bind_methods() {
|
||||||
}
|
}
|
||||||
|
|
||||||
GDExample::GDExample() {
|
DiscordRPC::DiscordRPC() {
|
||||||
// initialize any variables here
|
// initialize any variables here
|
||||||
time_passed = 0.0;
|
time_passed = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
GDExample::~GDExample() {
|
DiscordRPC::~DiscordRPC() {
|
||||||
// add your cleanup here
|
// add your cleanup here
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDExample::_process(float delta) {
|
void DiscordRPC::_process(float delta) {
|
||||||
time_passed += delta;
|
time_passed += delta;
|
||||||
|
|
||||||
Vector2 new_position = Vector2(10.0 + (10.0 * sin(time_passed * 2.0)), 10.0 + (10.0 * cos(time_passed * 1.5)));
|
Vector2 new_position = Vector2(10.0 + (10.0 * sin(time_passed * 2.0)), 10.0 + (10.0 * cos(time_passed * 1.5)));
|
@@ -1,12 +1,12 @@
|
|||||||
#ifndef GDEXAMPLE_H
|
#ifndef DISCORDRPC_H
|
||||||
#define GDEXAMPLE_H
|
#define DISCORDRPC_H
|
||||||
|
|
||||||
#include <godot_cpp/classes/sprite2d.hpp>
|
#include <godot_cpp/classes/sprite2d.hpp>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
class GDExample : public Sprite2D {
|
class DiscordRPC : public Sprite2D {
|
||||||
GDCLASS(GDExample, Sprite2D)
|
GDCLASS(DiscordRPC, Sprite2D)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float time_passed;
|
float time_passed;
|
||||||
@@ -15,8 +15,8 @@ protected:
|
|||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GDExample();
|
DiscordRPC();
|
||||||
~GDExample();
|
~DiscordRPC();
|
||||||
|
|
||||||
void _process(float delta);
|
void _process(float delta);
|
||||||
};
|
};
|
@@ -1,6 +1,6 @@
|
|||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
|
||||||
#include "gdexample.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include <gdextension_interface.h>
|
#include <gdextension_interface.h>
|
||||||
#include <godot_cpp/core/defs.hpp>
|
#include <godot_cpp/core/defs.hpp>
|
||||||
@@ -9,15 +9,15 @@
|
|||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
void initialize_example_module(ModuleInitializationLevel p_level) {
|
void initialize_discordrpc_module(ModuleInitializationLevel p_level) {
|
||||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassDB::register_class<GDExample>();
|
ClassDB::register_class<DiscordRPC>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitialize_example_module(ModuleInitializationLevel p_level) {
|
void uninitialize_discordrpc_module(ModuleInitializationLevel p_level) {
|
||||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,8 @@ extern "C" {
|
|||||||
GDExtensionBool GDE_EXPORT discordrpcgd_library_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
GDExtensionBool GDE_EXPORT discordrpcgd_library_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||||
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
|
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
|
||||||
|
|
||||||
init_obj.register_initializer(initialize_example_module);
|
init_obj.register_initializer(initialize_discordrpc_module);
|
||||||
init_obj.register_terminator(uninitialize_example_module);
|
init_obj.register_terminator(uninitialize_discordrpc_module);
|
||||||
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
|
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
|
||||||
|
|
||||||
return init_obj.init();
|
return init_obj.init();
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef GDEXAMPLE_REGISTER_TYPES_H
|
#ifndef DISCORDRPC_REGISTER_TYPES_H
|
||||||
#define GDEXAMPLE_REGISTER_TYPES_H
|
#define DISCORDRPC_REGISTER_TYPES_H
|
||||||
|
|
||||||
void initialize_example_module();
|
void initialize_discordrpc_module();
|
||||||
void uninitialize_example_module();
|
void uninitialize_discordrpc_module();
|
||||||
|
|
||||||
#endif // GDEXAMPLE_REGISTER_TYPES_H
|
#endif // DISCORDRPC_REGISTER_TYPES_H
|
Reference in New Issue
Block a user