Пример #1
0
        public Paleta(Texture2D textura, PlayerPaleta player, Point size)
            : this(textura, player)
        {
            Vector2 centro = Coordenadas.CentroDeVentana;

            if (player == PlayerPaleta.PlayerOne)
            {
                posicionInicial = new Vector2(50 - (size.X / 2f), centro.Y - (size.Y / 2f));
            }
            else
            {
                float offset = 50 + (size.X / 2f);
                posicionInicial = new Vector2(Coordenadas.LimitesDeVentana.X - offset, centro.Y - (size.Y / 2f));
            }
            posicionActual = posicionInicial;
            this.size      = new Rectangle((int)posicionInicial.X, (int)posicionInicial.Y, size.X, size.Y);
        }
Пример #2
0
        public Paleta(Texture2D textura, PlayerPaleta player)
            : base(textura)
        {
            Vector2 centro = Coordenadas.CentroDeVentana;

            if (player == PlayerPaleta.PlayerOne)
            {
                posicionInicial = new Vector2(50 - (textura.Width / 2f), centro.Y - (textura.Height / 2f));
            }
            else
            {
                float offset = 50 + (textura.Width / 2f);
                posicionInicial = new Vector2(Coordenadas.LimitesDeVentana.X - offset,
                                              centro.Y - (textura.Height / 2f));
            }
            posicionActual = posicionInicial;
            size           = new Rectangle((int)posicionInicial.X, (int)posicionInicial.Y, textura.Width, textura.Height);
            this.player    = player;
        }