Tile InterfaceDelta Engine Documentation
Used within a tilemap. View code on GitHub

Namespace: DeltaEngine.Scenes.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public interface Tile

The Tile type exposes the following members.

Properties

  NameDescription
Public propertyColor
Public propertyMaterial
Top
Remarks

Tests: DeltaEngine.Scenes.Tests.Controls.TilemapTests
Examples

6 unit tests call DeltaEngine.Scenes.Controls.Tile
[Test, Category("Slow")] //ncrunch: no coverage start 
public void RenderColoredLogoTilemap()
{
    CreateBorder();
    var tilemap = new ColoredLogoTilemap(World, Map) { DrawArea = Center };
    tilemap.Add(new FontText(Font.Default, "", new Rectangle(0.3f, 0.6f, 0.2f, 0.2f))
    {
        HorizontalAlignment = HorizontalAlignment.Left,
        RenderLayer = 2
    });
    tilemap.Start<RenderDragInfo>();
}
[Test]
public void TestWithMouseDrag()
{
    var tilemap = new ColoredLogoTilemap(World, Map);
    tilemap.State.DragStart = new Vector2D(0.5f, 0.5f);
    tilemap.State.DragEnd = new Vector2D(0.7f, 0.9f);
    tilemap.Update();
    Assert.IsTrue(tilemap.State.DragDelta.IsNearlyEqual(new Vector2D(0.2f, 0.4f)));
}
[Test]
public void TestWithMockKeyboard()
{
    new ColoredLogoTilemap(World, Map);
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var keyboard = Resolve<MockKeyboard>();
    keyboard.SetKeyboardState(Key.A, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    keyboard.SetKeyboardState(Key.D, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    keyboard.SetKeyboardState(Key.W, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    keyboard.SetKeyboardState(Key.S, State.Pressed);
    AdvanceTimeAndUpdateEntities();
}
See Also