コード例 #1
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public TestImGuiScreenView(Screen screen) : base(screen)
        {
            TestImGuiMenu = new TestImGuiMenu();

            // Make a button
            // ReSharper disable once ObjectCreationAsStatement
            Box = new ImageButton(WobbleAssets.WhiteBox, (sender, args) => Logger.Important("CLICKED", LogType.Runtime, false))
            {
                Parent = Container,
                Alignment = Alignment.MidCenter,
                Size = new ScalableVector2(100, 100),
                Tint = Color.Crimson,
            };

            // ReSharper disable once ObjectCreationAsStatement
            var box2 = new Sprite()
            {
                Parent = Container,
                Alignment = Alignment.TopLeft,
                Size = new ScalableVector2(75, 75),
                Position = new ScalableVector2(0, 400),
                Tint = Color.Red,
                Rotation = 60
            };

            box2.MoveToX(1200, Easing.OutQuint, 4000);
        }
コード例 #2
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            TestImGuiMenu.Update(gameTime);

            if (TestImGuiMenu.Rotation)
            {
                for (var i = 0; i < Boxes.Count; i++)
                {
                    var box = Boxes[i];

                    if (box.Animations.Count == 0)
                    {
                        if (box.Y > 0)
                        {
                            box.MoveToY(-300, Easing.Linear, 3000);
                        }
                        else
                        {
                            box.MoveToY(300, Easing.Linear, 3000);
                        }
                    }
                }
            }

            Container?.Update(gameTime);
        }
コード例 #3
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public TestImGuiScreenView(Screen screen) : base(screen)
        {
            TestImGuiMenu = new TestImGuiMenu();

            // Make a button
            // ReSharper disable once ObjectCreationAsStatement
            Box = new ImageButton(WobbleAssets.WhiteBox, (sender, args) => Logger.Important("CLICKED", LogType.Runtime, false))
            {
                Parent    = Container,
                Alignment = Alignment.MidCenter,
                Size      = new ScalableVector2(100, 100),
                Tint      = Color.Crimson
            };
        }
コード例 #4
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            TestImGuiMenu.Update(gameTime);

            if (TestImGuiMenu.Rotation)
            {
                if (Box.Animations.Count == 0)
                {
                    var rotation = MathHelper.ToDegrees(Box.Rotation);
                    Box.ClearAnimations();
                    Box.Animations.Add(new Animation(AnimationProperty.Rotation, Easing.Linear, rotation, rotation + 360, 1000));
                }
            }

            Container?.Update(gameTime);
        }
コード例 #5
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Draw(GameTime gameTime)
        {
            var color = Color.CornflowerBlue;

            if (TestImGuiMenu.Lightshow)
            {
                color    = new Color(RNG.Next(255), RNG.Next(255), RNG.Next(255));
                Box.Tint = new Color(RNG.Next(255), RNG.Next(255), RNG.Next(255));
            }
            else
            {
                Box.Tint = Color.Red;
            }

            GameBase.Game.GraphicsDevice.Clear(color);
            Container?.Draw(gameTime);

            GameBase.Game.SpriteBatch.End();
            TestImGuiMenu.Draw(gameTime);
        }
コード例 #6
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Draw(GameTime gameTime)
        {
            var color = Color.CornflowerBlue;

            /* if (TestImGuiMenu.Lightshow)
             * {
             *   color = new Color(RNG.Next(255), RNG.Next(255), RNG.Next(255));
             *   Box.Tint = new Color(RNG.Next(255), RNG.Next(255), RNG.Next(255));
             * }
             * else
             * {
             *   Box.Tint = Color.Crimson;
             * }*/

            GameBase.Game.GraphicsDevice.Clear(color);
            Container?.Draw(gameTime);

            GameBase.Game.SpriteBatch.End();
            TestImGuiMenu.Draw(gameTime);
        }
コード例 #7
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 public override void Destroy()
 {
     Container?.Destroy();
     TestImGuiMenu.Destroy();
 }