Beispiel #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(CowGameScreen.GameTextures["craftPanel"], _drawPos, Color.White);

            foreach (var container in Containers)
            {
                container?.Draw(spriteBatch, CowGameScreen.GameFonts["gameFont"]);
            }
            CraftContainer.Draw(spriteBatch, CowGameScreen.GameFonts["gameFont"]);
        }
Beispiel #2
0
        public CraftPanel(CowGameScreen cowGameScreen) : base(cowGameScreen)
        {
            Containers       = new Container[2, 2];
            _drawPos         = new Vector2(920, 758);
            Containers[0, 0] = new StaticConainer(new Rectangle((int)_drawPos.X + 19, (int)_drawPos.Y + 20, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);
            Containers[0, 1] = new StaticConainer(new Rectangle((int)_drawPos.X + 75, (int)_drawPos.Y + 20, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);
            Containers[1, 0] = new StaticConainer(new Rectangle((int)_drawPos.X + 19, (int)_drawPos.Y + 71, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);
            Containers[1, 1] = new StaticConainer(new Rectangle((int)_drawPos.X + 75, (int)_drawPos.Y + 71, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);

            CraftContainer = new CraftContainer(new Rectangle((int)_drawPos.X + 167, (int)_drawPos.Y + 45, 42, 42), cowGameScreen.GameTextures["cleanTexture"], this);
        }