Exemplo n.º 1
0
        public static void MoveWindow(Button move)
        {
            if (move.isBeingClicked)
            {
                Texture mover = DrawManager.GetTexture("WindowMover");
                Vector2 MousePos = Game.CursorPos2D;
                Vector2 backgroundTruePos = mover.Position;
                Vector2 difference = MousePos - backgroundTruePos;

                Program.dragObject = mover;

                foreach (Texture texture in DrawManager.activeTextures)
                    texture.Position = texture.Position + difference - new Vector2(0, mover.Image.Height / 2);
            }
        }
Exemplo n.º 2
0
        public static Button CreateButton(string textureName, string displayName, Vector2 position, ImagePosition orientation)
        {
            Texture texture = CreateTexture(textureName, displayName, position, orientation, false);
            Button button = new Button(texture);

            activeTextures.Add(button);

            return button;
        }