-
-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorials
Daynlight edited this page Dec 8, 2025
·
1 revision
๐ง Note: More tutorials (UI, 3D, advanced scripting) are planned! See Roadmap.md for future updates.
This page provides step-by-step tutorials for using Graphite, from basic setup to advanced scripting.
Follow the instructions in Instalation.md to set up Graphite on your system.
Run Graphite with:
Graphite -i ./This initializes default files and prepares your workspace.
Create or edit Graphite.cpp in your project directory:
#define BUILDING_SCRIPT_DLL
#include <Graphite/ScriptInterface.h>
#include <Graphite/Math.h>
class Script : ScriptInterface {
void Init() {
// Initialization code
}
void Update() {
// Per-frame logic
}
void Draw() {
// Drawing code
}
void Destroy() {
// Cleanup
}
};
extern "C" ScriptInterface* SCRIPT_API GetScript() {
Script* script = new Script();
return (ScriptInterface*)script;
}
extern "C" void SCRIPT_API DeleteScript(ScriptInterface* script) {
Script* temp_script = (Script*)script;
delete temp_script;
}Use the math library to create and draw points:
Graphite::Math::Point p({0.5f, 0.5f}, {1.0f, 0.0f, 0.0f});
p.drawPoint();Run with the -s flag to enable sandbox mode for safer script editing:
Graphite -s ./See PackageManager.md for instructions on creating and sharing packages.
- Custom math types
- Real-time script editing
- Integrating with CWindow
- Performance optimization
Refer to the API Reference and Examples for more advanced usage.
Graphite Wiki ยฉ 2025 Daynlight & Contributors
Licensed under the Apache License 2.0
- ๐ Home
- ๐ ๏ธ Installation
- ๐งโ๐ป Usage
- ๐ Tutorials
- ๐งโ๐ฌ Examples
- ๐ WritingScripts
- ๐ฆ PackageManager
- ๐งฎ Math
- ๐๏ธ APIReference
- ๐ผ๏ธ RenderingEngine
- ๐๏ธ Architecture
- ๐ Roadmap
- ๐ Versions
- ๐ ChangeLog
- ๐ค Community
- ๐ Credits
- ๐ Troubleshooting
- โ FAQ