Skip to content

GalaxyEngine/GalaxyScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GalaxyScript

Overview

GalaxyScript is a powerful scripting library designed for C++ development, particularly for game development. It provides an intuitive and efficient way to script functionality in your C++ projects. Whether you are creating games or simulations, GalaxyScript aims to streamline the scripting process, making it accessible and flexible.

C++20 Build with XMake

Build it yourself

  1. Clone the GalaxyScript repository.

    git clone https://github.com/your_username/GalaxyScript.git
  2. Build the library using xmake base on your config e.g for windows with msvc :

    xmake f -p [macosx|linux|iphoneos ..] -a [x86_64|i386|arm64 ..] -m [debug|release]
    xmake

Example of script

#include <set>
#include <iostream>
#include <vector>
#include "Macro.h"
#include "ScriptComponent.h"
#include "ExampleClass.generated.h"

CLASS()
class ExampleClass : public ScriptComponent
{
	GENERATED_BODY()
public:
	ExampleClass();

	PROPERTY();
	int valueI = 0;

	PROPERTY(HideInInspector, DisplayName = "Aled");
	double valueD = 0.0;

	PROPERTY();
	ExampleClass* valueC;

	PROPERTY();
	class ABCD* value2;

	PROPERTY();
	std::vector<int> value3;
public:
	FUNCTION();
	void Method()
	{
		std::cout << "Method from ExampleClass" << std::endl;
	}
};
END_CLASS()


CLASS()
class AnotherClass : public ExampleClass
{
	GENERATED_BODY()
public:
	AnotherClass();

	PROPERTY();
	int value = 0;
public:

	FUNCTION();
	void Method()
	{
		std::cout << "Method from AnotherClass" << std::endl;
	}

};
END_CLASS()

END_FILE()

Documentation

Detailed documentation, including examples and API references, can be found on the GalaxyScript Wiki.

License

This project is licensed under the MIT License.

Credits

Romain Bourgogne