コード例 #1
0
    private void CompoundRotateScaleSet()
    {
        var strip = new nStrip(new Vector2[] {
          new Vector2(1, 1),
          new Vector2(1, 0),
          new Vector2(1, -1),
          new Vector2(-2, -1),
          new Vector2(-2, 1),
        }, new float[] {
          0.05f, 0.1f, 0.2f, 0.2f, 0.05f
        });

        var p = new nProp(strip);
        p.Visible = true;
        p.Color = new Color(1.0f, 0.0f, 0.4f, 1.0f);
        p.Scale = new Vector2(1.0f, 1.0f);
        p.Rotation = 0.0f;
        p.Position = new Vector2(-4.0f, -3f);

        p = new nProp(strip);
        p.Visible = true;
        p.Color = new Color(0.0f, 0.0f, 0.0f, 1.0f);
        p.Scale = new Vector2(0.4f, 0.4f);
        p.Rotation = 0.0f;
        p.Position = new Vector2(0.0f, -3f);

        p = new nProp(strip);
        p.Visible = true;
        p.Color = new Color(0.0f, 1.0f, 1.0f, 1.0f);
        p.Scale = new Vector2(1.0f, 1.0f);
        p.Rotation = 99.0f;
        p.Position = new Vector2(4.0f, -3f);
    }
コード例 #2
0
 public void test_can_create_simple_instance()
 {
     var instance = new nStrip(new Vector2[] {
     new Vector2(0, 0),
     new Vector2(1, 1)
       }, 1.0f);
       instance.ShouldNotBe(null);
 }
コード例 #3
0
 public void test_can_manifest()
 {
     var instance = new nStrip(new Vector2[] {
     new Vector2(0, 0),
     new Vector2(1, 1)
       }, 1.0f);
       var g = instance.Manifest();
       g.ShouldNotBe(null);
 }
コード例 #4
0
 private void DrawArrow(float x1, float y1, float x2, float y2)
 {
     var strip = new nStrip(new Vector2[2] {
       new Vector2(x1, y1),
       new Vector2(x2, y2)
     }, new float[2] { 0.01f, 0.01f });
     var p = new nProp(strip);
     p.Visible = true;
     p.Color = new Color(0.8f, 0.8f, 0.9f);
     _helps.Add(p);
 }
コード例 #5
0
 private void SimpleStrip(Vector2 pos, Vector2 start, Vector2 end, float size, Texture t)
 {
     var strip = new nStrip(new Vector2[] { start, end }, new float[] { size, size });
     strip.Texture = t;
     var p = new nProp(strip);
     p.Visible = true;
     p.Color = new Color(1.0f, 1.0f, 0.0f, 1.0f);
     p.Scale = new Vector2(1.0f, 1.0f);
     p.Rotation = 0.0f;
     p.Position = pos;
 }
コード例 #6
0
 public void test_can_create_more_complex_instance()
 {
     var instance = new nStrip(new Vector2[] {
     new Vector2(0, 0),
     new Vector2(1, 1),
     new Vector2(1, 2),
     new Vector2(-1, 1),
     new Vector2(1, 1),
     new Vector2(1, -2),
       }, 0.2f);
       instance.ShouldNotBe(null);
 }
コード例 #7
0
    private void SimpleLineTest(Vector2 start, Texture t = null)
    {
        var strip = new nStrip(new Vector2[] {
          new Vector2(0, 0),
          new Vector2(1, 0),
          new Vector2(2, 0),
          new Vector2(3, 0),
          new Vector2(4, 0),
          new Vector2(5, 0),
          new Vector2(6, 0),
          new Vector2(7, 0),
          new Vector2(8, 0)
        }, new float[] {
          0.1f, 0.1f, 0.1f, 0.2f, 0.0f, 0.5f, 0.02f, 0.02f, 0.01f
        });
        strip.Texture = t;

        var p = new nProp(strip);
        p.Visible = true;
        p.Color = new Color(0.0f, 0.0f, 1.0f, 1.0f);
        p.Scale = new Vector2(1.0f, 1.0f);
        p.Position = start;
    }