There is no tutorial for Candle.NET, but you can use the C++ resources.
Official documentation, C++ version.
- Miguel Mejía Jiménez - main developer
- RD3V - .NET version developer
Before anything, here you have a little example of how it looks.
The code comes with a demo program showing the functionalities provided by the library. In it you can place lights and edges that will cast shadows, and modify the behaviour of the fog.
You can check the full manual of the demo here.
This project is more likely to only be a .Net version of the existing library. Meaning, any functionality which is not in the original Candle won't be added here.
However, if you want to improve the code or add support for more .Net versions, then you are free to go.
With SFML.Net and Candle.NET installed you can run the following code:
using SFML.Graphics;
using SFML.System;
using SFML.Utils;
using SFML.Window;
using Candle;
namespace Demo
{
public class Example
{
static void Main(string[] args)
{
// Create a window
RenderWindow window = new RenderWindow(new VideoMode(400, 400), "app");
window.Closed += (s, e) => window.Close();
// Create a light source
RadialLight light = new RadialLight()
{
Range = 150F
};
// Create an edge pool
List<Line> edges = new List<Line>
{
new Line(new Vector2f(200F, 100F), new Vector2f(200F, 300F))
};
window.MouseMoved += (s, e) =>
{
light.Position = (Vector2f)Mouse.GetPosition(window);
light.CastLight(edges);
};
// Main loop
while (window.IsOpen)
{
window.DispatchEvents();
window.Clear();
window.Draw(light);
window.Display();
}
}
}
}
The result will be a simple light casting a shadow over an invisible wall in the center of the window.
Candle uses the MIT license, a copy of which you can find here, in the repo.
It uses the external library SFML, that is licensed under the zlib/png license.