Esempio n. 1
0
        public override void Draw(Combat.PaletteFx palettefx)
        {
            Point tilestart;
            Point tileend;

            GetTileLength(Sprite.Size, out tilestart, out tileend);

            Video.DrawState drawstate = SpriteManager.DrawState;
            drawstate.Reset();
            drawstate.Blending         = Transparency;
            drawstate.ScissorRectangle = DrawRect;
            drawstate.Set(Sprite);

            for (Int32 y = tilestart.Y; y != tileend.Y; ++y)
            {
                for (Int32 x = tilestart.X; x != tileend.X; ++x)
                {
                    Vector2 adjustment = (Vector2)(Sprite.Size + TilingSpacing) * new Vector2(x, y);
                    Vector2 location   = CurrentLocation + adjustment;

                    drawstate.AddData(location, null);
                }
            }

            if (palettefx != null)
            {
                palettefx.SetShader(drawstate.ShaderParameters);
            }

            drawstate.Use();
        }
Esempio n. 2
0
        public override void Draw(Combat.PaletteFx palettefx)
        {
            Drawing.Sprite sprite = SpriteManager.GetSprite(AnimationManager.CurrentElement.SpriteId);
            if (sprite == null)
            {
                return;
            }

            Point tilestart;
            Point tileend;

            GetTileLength(sprite.Size, out tilestart, out tileend);

            Video.DrawState drawstate = SpriteManager.DrawState;
            drawstate.Reset();
            drawstate.Blending = Transparency;
            drawstate.Set(sprite);
            drawstate.AddData(CurrentLocation, null);

            if (palettefx != null)
            {
                palettefx.SetShader(drawstate.ShaderParameters);
            }

            drawstate.Use();
        }
Esempio n. 3
0
        void DrawGrid()
        {
            Elements.StaticImage cellbg = m_elements.GetElement("cell.bg") as Elements.StaticImage;
            if (cellbg != null)
            {
                Drawing.Sprite sprite = cellbg.SpriteManager.GetSprite(cellbg.DataMap.SpriteId);
                if (sprite != null)
                {
                    Video.DrawState drawstate = cellbg.SpriteManager.DrawState;
                    drawstate.Reset();
                    drawstate.Set(sprite);

                    for (Int32 y = 0; y != m_gridsize.Y; ++y)
                    {
                        for (Int32 x = 0; x != m_gridsize.X; ++x)
                        {
                            Point location = m_gridposition;
                            location.X += (m_cellsize.X + m_cellspacing) * x;
                            location.Y += (m_cellsize.Y + m_cellspacing) * y;

                            PlayerSelect selection = GetSelection(new Point(x, y), false);
                            if (selection == null && m_showemptyboxes == false)
                            {
                                continue;
                            }

                            drawstate.AddData((Vector2)location, null);
                        }
                    }

                    drawstate.Use();
                }
            }

            for (Int32 y = 0; y != m_gridsize.Y; ++y)
            {
                for (Int32 x = 0; x != m_gridsize.X; ++x)
                {
                    Point xy = new Point(x, y);

                    Vector2 location = (Vector2)m_gridposition;
                    location.X += (m_cellsize.X + m_cellspacing) * x;
                    location.Y += (m_cellsize.Y + m_cellspacing) * y;

                    PlayerSelect selection = GetSelection(xy, false);
                    if (selection != null && selection.SelectionType == PlayerSelectType.Profile)
                    {
                        selection.Profile.SpriteManager.Draw(SpriteId.SmallPortrait, location, Vector2.Zero, Vector2.One, SpriteEffects.None);
                    }

                    if (selection != null && selection.SelectionType == PlayerSelectType.Random)
                    {
                        Elements.StaticImage randomimage = m_elements.GetElement("cell.random") as Elements.StaticImage;
                        if (randomimage != null)
                        {
                            randomimage.Draw(location);
                        }
                    }

                    if (m_p1info.CurrentCell == xy && m_p2info.CurrentCell == xy)
                    {
                        if (m_blinkval > 0)
                        {
                            m_p1info.DrawCursorActive(location);
                        }
                        else
                        {
                            m_p2info.DrawCursorActive(location);
                        }
                    }
                    else if (m_p1info.CurrentCell == xy)
                    {
                        m_p1info.DrawCursorActive(location);
                    }
                    else if (m_p2info.CurrentCell == xy)
                    {
                        m_p2info.DrawCursorActive(location);
                    }
                }
            }
        }