Drawing System - C Sharp

From Leadwerks Developer Wiki

Jump to: navigation, search

Will be documented soon.


Example

using Leadwerks;
 
public static class Game
{
	public static void Main()
	{
		Graphics.Initialize(640, 400);
 
		new World();
		new Camera().Move(new Vector3(0, 0, -5));
 
		Mesh cube = Mesh.CreateCube();
 
		// Drawing system
		Rectangle rect = new Rectangle(250, 200, 40, 20);
		rect.Color = new Vector4(1, 0.5f, 0.5f, 0.5f);
 
		Line line = new Line(0, 0, 20, 20);
 
		Image img = new Image(Texture.Load(@"C:\Rock.dds"), 0, 0, 100, 100);
		Label lbl = new Label("Lazlo", 20, 20);
 
		line.DrawOrder = 4; // The highest on top.
 
		while (!Keyboard.KeyHit(Key.Escape) && !Window.HasRequestedClose())
		{
			cube.Turn(new Vector3(0.5f));
 
			Timing.Update();
			World.Update(Timing.Speed);
			World.Render();
			Drawing.Render(); // Has to be called between world rendering and flipping.
			Graphics.Flip();
		}
 
		Engine.Terminate();
	}
}

Output

Image:C-_Drawing_System.png