예제 #1
0
        public void LoadContent(RichContentManager content)
        {
            // Load the background.
            _shapePalletBackground =
                    content.Load<Texture2D>("ShapePallet/shapePalletBackground");

            BoundingBox = new Rectangle(
                    Position.X, Position.Y,
                    _shapePalletBackground.Width,
                    _shapePalletBackground.Height);

            // And the cancel button to the bottom of the palette.
            _cancelButton = content.MakeButton(
                    BoundingBox.Center.X - (120/2),
                    BoundingBox.Bottom,
                    "GUI/cancel");

            // LoadContent for all palette states; do not LoadContent more than once.
            var statesLoaded = new List<PaletteState>();
            foreach (var state in _states.Values.Where( state => !statesLoaded.Contains(state)))
            {
                statesLoaded.Add(state);
                state.LoadContent(content);
            }
        }
예제 #2
0
        /// <summary>
        /// 
        /// </summary>
        private void initializeDrawList()
        {
            drawnElements = new List<string>(numElements);

            for (int i = drawStartIndex; i < numElements + drawStartIndex; i++)
            {
                if (i >= listElements.Count || i < 0)
                    break;
                else
                    drawnElements.Add(listElements[i]);
            }
        }
예제 #3
0
        /// <summary>
        /// 
        /// </summary>
        private void initializeRectList()
        {
            listRects = new List<Rectangle>(numElements);

            Rectangle temp;
            for (int i = 0; i < numElements; i++)
            {
                temp = new Rectangle((int)position.X, (int)position.Y + (elementHeight * (i + 1)), width, elementHeight);

                listRects.Add(temp);
            }
        }
예제 #4
0
        public void LoadContent()
        {
            myOSKBackgroundPosition = (new Vector2(((screenWidth / 2) - 260), ((screenHeight) - 250)));
            myOSKBackground = content.Load<Texture2D>("OSK/keyboardBackground");

            keys = new List<Key>();

            int x = Position.X;
            int y = Position.Y;
            // GAH! HARD CODED! GET AWAY!
            int keyWidth = 48;

            int keyHeight = 48;
            int indentation = 0;

            // Make a key for each key in a row.
            foreach (string row in rows)
            {
            indentation += 1;
            int insideCounter =  0;
                foreach (char c in row)
                {
                    keys.Add(MakeKey(x, y, c));
                    x += keyWidth;
                    insideCounter++;
                    if(indentation == 4) {
                        if (insideCounter == 5) { x += 50; }
                    }
                }
                if (indentation == 1)
                {
                    x = Position.X + 15;
                    y += keyHeight;
                }
                if (indentation == 2)
                {
                    x = Position.X + 35;
                    y += keyHeight;
                }
                if (indentation == 3)
                {
                    x = Position.X + 130;
                    y += keyHeight;
                }

            }
        }