Exemplo n.º 1
0
        private void load(OsuColour colours)
        {
            WaveContainer container;

            Add(container = new WaveContainer
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Size             = new Vector2(400),
                FirstWaveColour  = colours.Red,
                SecondWaveColour = colours.Green,
                ThirdWaveColour  = colours.Blue,
                FourthWaveColour = colours.Pink,
                Children         = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Colour4.Black.Opacity(0.5f),
                    },
                    new OsuSpriteText
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Font   = OsuFont.GetFont(size: 20),
                        Text   = @"Wave Container",
                    },
                },
            });

            AddStep(@"show", container.Show);
            AddStep(@"hide", container.Hide);
        }
 protected WaveOverlayContainer()
 {
     AddInternal(Waves = new WaveContainer
     {
         RelativeSizeAxes = Axes.Both,
     });
 }
Exemplo n.º 3
0
        public ListingSubScreen()
        {
            Anchor           = Anchor.Centre;
            Origin           = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;

            var backgroundColour = Color4Extensions.FromHex(@"3e3a44");

            InternalChild = waveContainer = new ListingWaveContainer
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    romImportHandler = new RomImportHandler(),
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = backgroundColour,
                    },
                    listing = new RomListing
                    {
                        RelativeSizeAxes = Axes.Both,
                        RomSelected      = Prepare,
                        Padding          = new MarginPadding {
                            Top = ListingHeader.HEIGHT
                        },
                    },
                    new ListingHeader()
                }
            };
        }
Exemplo n.º 4
0
        private BuoyancyTest()
        {
            //Make a box
            //Bottom
            Body         ground = BodyFactory.CreateBody(World);
            Vertices     edge   = PolygonTools.CreateEdge(new Vector2(0.0f, 0.0f), new Vector2(40.0f, 0.0f));
            PolygonShape shape  = new PolygonShape(edge);

            ground.CreateFixture(shape);

            //Left side
            shape.Set(PolygonTools.CreateEdge(new Vector2(0.0f, 0.0f), new Vector2(00.0f, 15.0f)));
            ground.CreateFixture(shape);

            //Right side
            shape.Set(PolygonTools.CreateEdge(new Vector2(40.0f, 0.0f), new Vector2(40.0f, 15.0f)));
            ground.CreateFixture(shape);

            //Buoyancy controller
            _aabbContainer = new AABBFluidContainer(new Vector2(0, 0), 40, 10);
            _waveContainer = new WaveContainer(new Vector2(0, 0), 40, 10);
            _waveContainer.WaveGeneratorStep = 0;

            FluidDragController buoyancyController = new FluidDragController(_waveContainer, 4f, 0.98f, 0.2f,
                                                                             World.Gravity);

            buoyancyController.Entry += EntryEventHandler;

            Vector2 offset = new Vector2(5, 0);

            //Bunch of balls
            for (int i = 0; i < 4; i++)
            {
                Fixture fixture = FixtureFactory.CreateCircle(World, 1, 1, new Vector2(15, 1) + offset * i);
                fixture.Body.BodyType = BodyType.Dynamic;
                buoyancyController.AddGeom(fixture);
            }

            World.Add(buoyancyController);
        }