public void Run()
    {
        // Altseedを初期化する。
        asd.Engine.Initialize("GeometryObject2D_RectangleShape", 640, 480, new asd.EngineOption());

        // 図形描画オブジェクトのインスタンスを生成する。
        var geometryObj = new asd.GeometryObject2D();

        // 図形描画クラスのインスタンスをエンジンに追加する。
        asd.Engine.AddObject2D(geometryObj);

        // 矩形の図形クラスのインスタンスを生成する。
        var rect = new asd.RectangleShape();

        // 矩形の描画範囲を指定する。
        rect.DrawingArea = new asd.RectF(10, 210, 300, 200);

        // 矩形を描画する図形として設定しする。
        geometryObj.Shape = rect;

        // Altseedのウインドウが閉じられていないか確認する。
        while (asd.Engine.DoEvents())
        {
            // Altseedを更新する。
            asd.Engine.Update();

            Recorder.TakeScreenShot("GeometryObject2D_RectangleShape", 30);
        }

        // Altseedの終了処理をする。
        asd.Engine.Terminate();
    }
Esempio n. 2
0
    public void Run()
    {
        // Altseedを初期化する。
        asd.Engine.Initialize("GeometryObject2D_RectangleShape", 640, 480, new asd.EngineOption());

        // 図形描画オブジェクトのインスタンスを生成する。
        var geometryObj = new asd.GeometryObject2D();

        // 図形描画クラスのインスタンスをエンジンに追加する。
        asd.Engine.AddObject2D(geometryObj);

        // 矩形の図形クラスのインスタンスを生成する。
        var rect = new asd.RectangleShape();

        // 矩形の描画範囲を指定する。
        rect.DrawingArea = new asd.RectF(10, 210, 300, 200);

        // 矩形を描画する図形として設定しする。
        geometryObj.Shape = rect;

        // Altseedのウインドウが閉じられていないか確認する。
        while (asd.Engine.DoEvents())
        {
            // Altseedを更新する。
            asd.Engine.Update();

            Recorder.TakeScreenShot("GeometryObject2D_RectangleShape", 30);
        }

        // Altseedの終了処理をする。
        asd.Engine.Terminate();
    }
Esempio n. 3
0
        public void AddLayer(asd.Layer2D layer)
        {
            _geometryObj       = new asd.GeometryObject2D();
            _geometryObj.Color = _color;
            var rect = new asd.RectangleShape();

            rect.DrawingArea   = new asd.RectF(width * _x + offsetx, height * _y + offsety, width, height);
            _geometryObj.Shape = rect;

            layer.AddObject(_geometryObj);
        }
Esempio n. 4
0
    public SampleInfoLayer(float scrollBarHeight, float totalHeight, float cameraSize)
    {
        var scrollBarShape = new asd.RectangleShape();

        scrollBarShape.DrawingArea = new asd.RectF(0, 0, ScrollBerWidth, scrollBarHeight);
        scrollBar          = new asd.GeometryObject2D();
        scrollBar.Shape    = scrollBarShape;
        scrollBar.Color    = new asd.Color(64, 64, 64, 255);
        scrollBar.Position = new asd.Vector2DF(640 - ScrollBerWidth - SampleBrowser.Margin, 20 + SampleBrowser.Margin);

        this.totalHeight = totalHeight;
        this.cameraSize  = cameraSize;
        AddObject(scrollBar);
    }
Esempio n. 5
0
    protected override void OnAdded()
    {
        Name = "InfoLayer";

        var panelShape = new asd.RectangleShape();

        panelShape.DrawingArea = new asd.RectF(0, 0, 640, PanelHeight);
        var panel = new asd.GeometryObject2D();

        panel.Shape    = panelShape;
        panel.Color    = new asd.Color(16, 16, 16, 255);
        panel.Position = new asd.Vector2DF(0, 480 - PanelHeight);

        var font = asd.Engine.Graphics.CreateDynamicFont("", 12, new asd.Color(255, 255, 255, 255), 1, new asd.Color(0, 0, 0, 255));

        title                 = new asd.TextObject2D();
        title.Font            = font;
        title.Text            = "";
        title.Color           = new asd.Color(255, 255, 0);
        title.Position        = new asd.Vector2DF(2, 2);
        title.DrawingPriority = 1;

        className                 = new asd.TextObject2D();
        className.Font            = font;
        className.Text            = "";
        className.Color           = new asd.Color(128, 255, 225);
        className.Position        = new asd.Vector2DF(2, 2);
        className.DrawingPriority = 1;

        description                 = new asd.TextObject2D();
        description.Font            = font;
        description.Text            = "";
        description.Color           = new asd.Color(255, 255, 255);
        description.Position        = new asd.Vector2DF(6, 22);
        description.DrawingPriority = 1;

        panel.AddChild(title, asd.ChildManagementMode.Nothing, asd.ChildTransformingMode.Position);
        panel.AddChild(description, asd.ChildManagementMode.Nothing, asd.ChildTransformingMode.Position);
        panel.AddChild(className, asd.ChildManagementMode.RegistrationToLayer, asd.ChildTransformingMode.Position);

        AddObject(panel);
        AddObject(title);
        AddObject(description);
    }
		public ScrollBoundViewer(ScrollLayer scrollLayer)
		{
			IsDrawn = false;
			this.scrollLayer = scrollLayer;
			debugCamera = new CameraObject2D()
			{
				Src = new RectI(
					(scrollLayer.BoundaryStartingPosition - new Vector2DF(30, 30)).To2DI(),
					(scrollLayer.BoundaryEndingPosition - scrollLayer.BoundaryStartingPosition + new Vector2DF(60, 60)).To2DI()),
				Dst = new RectI(Engine.WindowSize.X / 2, 0, Engine.WindowSize.X / 2, Engine.WindowSize.Y),
			};
			outerBinding = new GeometryObject2D()
			{
				DrawingPriority = -3,
				Color = new Color(255, 0, 0, 128),
			};
			innerBinding = new GeometryObject2D()
			{
				DrawingPriority = -1,
				Color = new Color(0, 0, 255, 128),
			};
			cameraBinding = new GeometryObject2D()
			{
				DrawingPriority = -2,
				Color = new Color(0, 255, 0, 128),
			};
            seeingArea = new GeometryObject2D()
            {
                DrawingPriority = -2,
                Color = new Color(255, 255, 0, 100),
            };
			AddChild(debugCamera, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Nothing);
			AddChild(outerBinding, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Nothing);
			AddChild(innerBinding, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Nothing);
			AddChild(cameraBinding, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Nothing);
			AddChild(seeingArea, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Nothing);
        }
Esempio n. 7
0
		public SampleInfoLayer(float totalHeight)
		{
			var scrollBarHeight = SampleBrowser.ViewerHeight / totalHeight * SampleBrowser.ViewerHeight;
			ScrollBar = new GeometryObject2D
			{
				Shape = new RectangleShape
				{
					DrawingArea = new RectF(0, 0, ScrollBerWidth, scrollBarHeight - SampleBrowser.Margin * 2)
				},
				Color = new Color(64, 64, 64, 255),
				Position = new Vector2DF(ScrollBarX, SampleBrowser.DescriptionHeight + SampleBrowser.Margin),
				DrawingPriority = 9
			};
			TotalHeight = totalHeight;
			AddObject(ScrollBar);

			Name = "InfoLayer";

			var panel = new GeometryObject2D
			{
				Shape = new RectangleShape
				{
					DrawingArea = new RectF(0, 0, 640, SampleBrowser.DescriptionHeight)
				},
				Color = new Color(16, 16, 16, 255),
				Position = new Vector2DF(0, 480 - SampleBrowser.DescriptionHeight)
			};

			var font = Engine.Graphics.CreateDynamicFont("", 12, new Color(255, 255, 255, 255), 1, new Color(0, 0, 0, 255));
			Title = new TextObject2D
			{
				Font = font,
				Text = "",
				Color = new Color(255, 255, 0),
				Position = new Vector2DF(2, 2),
				DrawingPriority = 1
			};

			ClassName = new TextObject2D
			{
				Font = font,
				Text = "",
				Color = new Color(128, 255, 225),
				Position = new Vector2DF(2, 2),
				DrawingPriority = 1
			};

			Description = new TextObject2D
			{
				Font = font,
				Text = "",
				Color = new Color(255, 255, 255),
				Position = new Vector2DF(6, 22),
				DrawingPriority = 1
			};

			panel.AddChild(Title, ChildManagementMode.Nothing, ChildTransformingMode.Position);
			panel.AddChild(Description, ChildManagementMode.Nothing, ChildTransformingMode.Position);
			panel.AddChild(ClassName, ChildManagementMode.RegistrationToLayer, ChildTransformingMode.Position);

			AddObject(panel);
			AddObject(Title);
			AddObject(Description);
		}