218 lines
6.5 KiB
Plaintext
218 lines
6.5 KiB
Plaintext
typedef void string;
|
|
string format(const string&in fmt, const ?&in ...);
|
|
|
|
// Array template (provided by scriptarray add-on)
|
|
external shared class array<T> {
|
|
uint length() const;
|
|
void resize(uint);
|
|
void insertAt(uint, const T&in);
|
|
void insertLast(const T&in);
|
|
void removeAt(uint);
|
|
void removeLast();
|
|
T& opIndex(uint);
|
|
const T& opIndex(uint) const;
|
|
}
|
|
|
|
// Logging functions
|
|
void Print(const string&in);
|
|
void Log(int level, const string&in);
|
|
int LOG_TRACE;
|
|
int LOG_DEBUG;
|
|
int LOG_INFO;
|
|
int LOG_WARNING;
|
|
int LOG_ERROR;
|
|
int LOG_FATAL;
|
|
|
|
// Toast notification functions
|
|
namespace Toast {
|
|
void Info(const string&in msg);
|
|
void Warning(const string&in);
|
|
void Error(const string&in);
|
|
void Success(const string&in);
|
|
}
|
|
|
|
// ECS functions
|
|
namespace ECS {
|
|
// Entity management
|
|
uint CreateEntity();
|
|
void DestroyEntity(uint entity);
|
|
bool IsValid(uint entity);
|
|
|
|
// Transform component
|
|
void AddTransform(uint entity, float x, float y, float z);
|
|
void SetPosition(uint entity, float x, float y, float z);
|
|
void GetPosition(uint entity, float &out x, float &out y, float &out z);
|
|
void SetScale(uint entity, float x, float y, float z);
|
|
void SetRotation(uint entity, float rotation);
|
|
float GetRotation(uint entity);
|
|
bool HasTransform(uint entity);
|
|
void RemoveTransform(uint entity);
|
|
|
|
// Velocity component
|
|
void AddVelocity(uint entity, float vx, float vy, float vz, float angular = 0.0f);
|
|
void SetVelocity(uint entity, float vx, float vy, float vz);
|
|
void SetAngularVelocity(uint entity, float angular);
|
|
bool HasVelocity(uint entity);
|
|
void RemoveVelocity(uint entity);
|
|
|
|
// Sprite component
|
|
void AddSprite(uint entity, int modelId, uint color, float outlineSize = 0.0f);
|
|
void SetSpriteColor(uint entity, uint color);
|
|
void SetSpriteModel(uint entity, int modelId);
|
|
void SetSpriteOutline(uint entity, float outlineSize);
|
|
void SetSpriteShader(uint entity, uint shaderId);
|
|
bool HasSprite(uint entity);
|
|
void RemoveSprite(uint entity);
|
|
|
|
// Tag component
|
|
void AddTag(uint entity, const string &in name);
|
|
string GetTag(uint entity);
|
|
void SetTag(uint entity, const string &in name);
|
|
bool HasTag(uint entity);
|
|
void RemoveTag(uint entity);
|
|
|
|
// Hierarchy component
|
|
void SetParent(uint child, uint parent);
|
|
void ClearParent(uint child);
|
|
uint GetParent(uint child);
|
|
bool HasParent(uint child);
|
|
|
|
// Camera3D component
|
|
void AddCamera3D(uint entity, float px, float py, float pz, float tx, float ty, float tz, float fovy);
|
|
void SetCameraPosition(uint entity, float x, float y, float z);
|
|
void SetCameraTarget(uint entity, float x, float y, float z);
|
|
void SetCameraFovy(uint entity, float fovy);
|
|
bool HasCamera3D(uint entity);
|
|
void RemoveCamera3D(uint entity);
|
|
|
|
// Light component
|
|
void AddLight(uint entity, float dx, float dy, float dz, float intensity = 1.0f);
|
|
void SetLightDirection(uint entity, float x, float y, float z);
|
|
void SetLightIntensity(uint entity, float intensity);
|
|
void SetLightColor(uint entity, uint color);
|
|
bool HasLight(uint entity);
|
|
void RemoveLight(uint entity);
|
|
|
|
// Material component
|
|
void AddMaterial(uint entity, uint materialId);
|
|
void SetMaterialId(uint entity, uint materialId);
|
|
uint GetMaterialId(uint entity);
|
|
bool HasMaterial(uint entity);
|
|
void RemoveMaterial(uint entity);
|
|
|
|
// RenderPass component
|
|
void AddRenderPass(uint entity, int order, bool depthTest, bool depthWrite, uint shaderId);
|
|
void SetRenderPassOrder(uint entity, int order);
|
|
void SetRenderPassShader(uint entity, uint shaderId);
|
|
bool HasRenderPass(uint entity);
|
|
void RemoveRenderPass(uint entity);
|
|
}
|
|
|
|
// Shader resource management
|
|
namespace Shader {
|
|
uint Load(const string &in vsPath, const string &in fsPath);
|
|
void Unload(uint id);
|
|
}
|
|
|
|
// Model resource management
|
|
namespace Model {
|
|
uint Load(const string &in path);
|
|
uint LoadCube(float width, float height, float length);
|
|
uint LoadSphere(float radius, int rings, int slices);
|
|
uint LoadPlane(float width, float length, int resX, int resZ);
|
|
void Unload(uint id);
|
|
}
|
|
|
|
// Material resource management
|
|
namespace Material {
|
|
uint Create(uint shaderId, uint8 r, uint8 g, uint8 b, uint8 a);
|
|
void Remove(uint id);
|
|
void SetShader(uint id, uint shaderId);
|
|
void SetAlbedo(uint id, uint8 r, uint8 g, uint8 b, uint8 a);
|
|
}
|
|
|
|
namespace Scene {
|
|
uint Load(const string &in path, bool clearExisting = true);
|
|
void Clear();
|
|
}
|
|
|
|
namespace Texture {
|
|
class Image {
|
|
int width;
|
|
int height;
|
|
int mipmaps;
|
|
int format;
|
|
};
|
|
Image@ LoadImage(const string&in path);
|
|
void Unload(const Image@&in image);
|
|
class Texture2D {
|
|
int id;
|
|
int width;
|
|
int height;
|
|
int mipmaps;
|
|
int format;
|
|
};
|
|
Texture2D@ LoadTexture(const string&in path);
|
|
Texture2D@ LoadFromImage(const Image@&in image);
|
|
void Draw(const Texture2D@&in texture, int x, int y, int color);
|
|
void Unload(const Texture2D@&in texture);
|
|
}
|
|
|
|
namespace Math {
|
|
float Sin(float angle);
|
|
float Cos(float angle);
|
|
float Tan(float angle);
|
|
float ASin(float value);
|
|
float ACos(float value);
|
|
float ATan(float value);
|
|
float ATan2(float y, float x);
|
|
float Sqrt(float value);
|
|
float Pow(float base, float exponent);
|
|
float Log(float value);
|
|
float Log10(float value);
|
|
float Exp(float exponent);
|
|
float Floor(float value);
|
|
float Ceil(float value);
|
|
float Modf(float x, float y);
|
|
float Abs(float value);
|
|
}
|
|
|
|
// Raylib input and timing functions
|
|
float GetTime();
|
|
bool IsKeyPressed(int key);
|
|
|
|
// Input Action System
|
|
bool IsActionPressed(const string &in actionName);
|
|
bool IsActionDown(const string &in actionName);
|
|
bool IsActionReleased(const string &in actionName);
|
|
float GetActionStrength(const string &in actionName);
|
|
void RegisterAction(const string &in actionName);
|
|
void BindKeyboard(const string &in actionName, int keyCode);
|
|
void BindMouseButton(const string &in actionName, int mouseButton);
|
|
void ClearBindings(const string &in actionName);
|
|
|
|
namespace Key {
|
|
const int SPACE = 32;
|
|
const int ESCAPE = 256;
|
|
const int ENTER = 257;
|
|
const int TAB = 258;
|
|
const int BACKSPACE = 259;
|
|
const int RIGHT = 262;
|
|
const int LEFT = 263;
|
|
const int DOWN = 264;
|
|
const int UP = 265;
|
|
const int W = 87;
|
|
const int A = 65;
|
|
const int S = 83;
|
|
const int D = 68;
|
|
const int E = 69;
|
|
const int LEFT_CONTROL = 341;
|
|
}
|
|
|
|
namespace MouseButton {
|
|
const int LEFT = 0;
|
|
const int RIGHT = 1;
|
|
const int MIDDLE = 2;
|
|
}
|
|
|