コード例 #1
0
            public ResolutionTestNode(State stateref, string name)
                : base(stateref, name)
            {
                Body        = new Body(this, "Body");
                Body.Bounds = new Vector2(70, 70);

                _physics = new Physics(this, "_physics");
                _physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);
                _physics.Mass        = 10f;
                _physics.Restitution = 1f;
                _physics.Drag        = .95f;

                Shape = new AABB(this, "AABB");
                Shape.LinkDependency(AABB.DEPENDENCY_BODY, Body);

                Collision = new Collision(this, "Collision");
                Collision.LinkDependency(Collision.DEPENDENCY_SHAPE, Shape);
                Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, _physics);
                Collision.Initialize();

                _imageRender = new ImageRender(this, "Image", Assets.Pixel);
                _imageRender.LinkDependency(ImageRender.DEPENDENCY_BODY, Body);
                _imageRender.Scale = new Vector2(70, 70);
                _imageRender.Layer = .5f;

                _textBody = new Body(this, "_textBody");

                _textRender = new TextRender(this, "_textRender");
                _textRender.LinkDependency(TextRender.DEPENDENCY_BODY, _textBody);
                _textRender.Color = Color.White;
                _textRender.Font  = Assets.Font;
                _textRender.Text  = Name;
                _textRender.Layer = 1f;
            }
コード例 #2
0
            public ResolutionTestNode(State stateref, string name)
                : base(stateref, name)
            {
                Body = new Body(this, "Body");
                Body.Bounds = new Vector2(70, 70);

                _physics = new Physics(this, "_physics");
                _physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);
                _physics.Mass = 10f;
                _physics.Restitution = 1f;
                _physics.Drag = .95f;

                Shape = new AABB(this, "AABB");
                Shape.LinkDependency(AABB.DEPENDENCY_BODY, Body);

                Collision = new Collision(this, "Collision");
                Collision.LinkDependency(Collision.DEPENDENCY_SHAPE, Shape);
                Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, _physics);
                Collision.Initialize();

                _imageRender = new ImageRender(this, "Image", Assets.Pixel);
                _imageRender.LinkDependency(ImageRender.DEPENDENCY_BODY, Body);
                _imageRender.Scale = new Vector2(70, 70);
                _imageRender.Layer = .5f;

                _textBody = new Body(this, "_textBody");

                _textRender = new TextRender(this, "_textRender");
                _textRender.LinkDependency(TextRender.DEPENDENCY_BODY, _textBody);
                _textRender.Color = Color.White;
                _textRender.Font = Assets.Font;
                _textRender.Text = Name;
                _textRender.Layer = 1f;
            }