示例#1
0
        private void performDropCube()
        {
            // Add a new cube to the simulation
            RigidBodyContainer <Drawable> rbc = new RigidBodyContainer <Drawable>
            {
                Child = new Box
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Size   = new Vector2(150, 150),
                    Colour = Color4.Tomato,
                },
                Position = new Vector2(500, 500),
                Size     = new Vector2(200, 200),
                Rotation = 45,
                Colour   = Color4.Tomato,
                Masking  = true,
            };

            sim.Add(rbc);
        }
示例#2
0
        private void load()
        {
            Child = sim = new RigidBodySimulation {
                RelativeSizeAxes = Axes.Both
            };

            RigidBodyContainer <Drawable> rbc = new RigidBodyContainer <Drawable>
            {
                Child = new Box
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Size   = new Vector2(150, 150),
                    Colour = Color4.Tomato,
                },
                Position = new Vector2(500, 500),
                Size     = new Vector2(200, 200),
                Rotation = 45,
                Colour   = Color4.Tomato,
                Masking  = true,
            };

            sim.Add(rbc);
        }
示例#3
0
        private void DropCube()
        {
            Child = sim = new RigidBodySimulation {
                RelativeSizeAxes = Axes.Both
            };

            RigidBodyContainer <Drawable> rbc = new RigidBodyContainer <Drawable>
            {
                Child = new Box
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Size    = new Vector2(150, 150),
                    Texture = texture,
                },
                Position = new Vector2(500, 500),
                Size     = new Vector2(200, 200),
                Rotation = 45,
                Masking  = true,
            };

            sim.Add(rbc);

            FillFlowContainer flow;

            AddRange(new Drawable[]
            {
                new ScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new[]
                    {
                        flow = new FillFlowContainer
                        {
                            Anchor           = Anchor.TopLeft,
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            Direction        = FillDirection.Vertical,
                        }
                    }
                }
            });

            SpriteText test = new SpriteText
            {
                Text             = @"You are now entering completely darkness...",
                Font             = "Exo2.0-Regular",
                AllowMultiline   = true,
                RelativeSizeAxes = Axes.X,
                TextSize         = 25
            };

            flow.Add(test);

            flow.Add(new SpriteText
            {
                Text             = @"That just used the font " + test.Font + "!",
                Font             = "Exo2.0-RegularItalic",
                AllowMultiline   = true,
                RelativeSizeAxes = Axes.X,
                TextSize         = 25
            });
        }