Exemplo n.º 1
0
 public void Draw(TCODConsole console, Point offset)
 {
     if (Position.X > offset.X && Position.X <= offset.X + 45 && Position.Y > offset.Y && Position.Y <= offset.Y + 45)
     {
         console.putCharEx(Position.X - offset.X, Position.Y - offset.Y, Symbol, ForegroundColor, BackgroundColor == null ? TCODColor.black : BackgroundColor);
     }
 }
Exemplo n.º 2
0
        public void draw(bool transparency, bool direct)
        {
            if (direct)
            {
                for (int j = 0; j < height; j++)
                {
                    for (int i = 0; i < width; i++)
                    {
                        Tile temp = glyphs[i, j];

                        if (transparency)
                        {
                            TCODConsole.root.putCharEx(i, j, temp.glyph, temp.foreGround.GetTCODColor(TCODConsole.root.getCharForeground(i - x, j - y)), temp.backGround.GetTCODColor(TCODConsole.root.getCharBackground(i - x, j - y)));
                        }
                        else
                        {
                            TCODConsole.root.putCharEx(i, j, temp.glyph, temp.foreGround.GetTCODColor(), temp.backGround.GetTCODColor());
                        }
                    }
                }
            }
            else
            {
                for (int j = 0; j < height; j++)
                {
                    for (int i = 0; i < width; i++)
                    {
                        Tile temp = glyphs[i, j];

                        if (transparency)
                        {
                            terminal.putCharEx(i, j, temp.glyph, temp.foreGround.GetTCODColor(TCODConsole.root.getCharForeground(i - x, j - y)), temp.backGround.GetTCODColor(TCODConsole.root.getCharBackground(i - x, j - y)));
                        }
                        else
                        {
                            terminal.putCharEx(i, j, temp.glyph, temp.foreGround.GetTCODColor(), temp.backGround.GetTCODColor());
                        }
                    }
                }

                TCODConsole.blit(terminal, 0, 0, terminal.getWidth(), terminal.getHeight(), TCODConsole.root, x, y);
            }
        }
Exemplo n.º 3
0
        public void Draw(TCODConsole console, IGameEngine engine, List<ISkill> selectedSkillList, List<ISkill> newlySelectedSkillList, Point cursorPosition)
        {
            SkillSquare cursorSkillSquare = null;
            ISkill cursorOverSkill = null;
            if (m_squareLookup.ContainsKey(cursorPosition))
            {
                cursorSkillSquare = m_squareLookup[cursorPosition];
                cursorOverSkill = cursorSkillSquare.GetSkill(engine);
            }
            int selectedSkillCost = newlySelectedSkillList.Sum(x => x.Cost);

            int upperLeftX = cursorPosition.X - ((SkillTreePainter.SkillTreeWidth - 1) / 2);
            int upperLeftY = cursorPosition.Y - ((SkillTreePainter.SkillTreeHeight - 1) / 2);

            int lowerRightX = cursorPosition.X - ((SkillTreePainter.SkillTreeWidth - 1) / 2);
            int lowerRightY = cursorPosition.Y - ((SkillTreePainter.SkillTreeHeight - 1) / 2);

            int arrayWidth = CharArray.GetLength(0);
            int arrayHeight = CharArray.GetLength(1);

            for (int i = SkillTreePainter.UpperLeft + 1; i < SkillTreePainter.SkillTreeWidth + SkillTreePainter.UpperLeft - 1; ++i)
            {
                for (int j = SkillTreePainter.UpperLeft + 1; j < SkillTreePainter.SkillTreeHeight + SkillTreePainter.UpperLeft -1; ++j)
                {
                    int gridX;
                    int gridY;
                    ConvertDrawToGridCoord(i, j, cursorPosition, out gridX, out gridY);
                    if (gridX >= 0 && gridY >= 0 && gridX < arrayWidth && gridY < arrayHeight)
                    {
                        //CalculateBackgroundColorForSkill
                        // We're painting something that shows up on our "grid"
                        TCODColor background = CalculateBackgroundColorForSkill(new Point(gridX, gridY), cursorPosition, selectedSkillList, newlySelectedSkillList, engine.Player.SkillPoints, selectedSkillCost, cursorOverSkill);
                        console.putCharEx(i, j, CharArray[gridX, gridY], UIHelper.ForegroundColor, background);
                    }
                    else
                    {
                        // We're not painting something on our grid, black it out
                        console.setCharBackground(i, j, m_black);
                    }
                }
            }

            if (cursorSkillSquare != null)
                DrawSkillPopup(console, selectedSkillList, engine.Player.SkillPoints - selectedSkillCost, cursorSkillSquare, cursorOverSkill, cursorPosition);
        }
Exemplo n.º 4
0
 public void SetCharacter(int x, int y, char character, TCODColor foreground, TCODColor background)
 {
     _console.putCharEx(x, y, character, foreground, background);
 }
Exemplo n.º 5
0
 public void Draw(TCODConsole console, Point offset)
 {
     if (Position.X > offset.X && Position.X <= offset.X + 45 && Position.Y > offset.Y && Position.Y <= offset.Y + 45) {
         console.putCharEx(Position.X - offset.X, Position.Y - offset.Y, Symbol, ForegroundColor, BackgroundColor == null ? TCODColor.black : BackgroundColor);
     }
 }