Example #1
0
        /// <summary>
        /// Draw the current layer.
        /// </summary>
        /// <param name="graphics">Graphics instance</param>
        /// <param name="imageList">List of level images</param>
        public void Draw(IGraphics graphics, ArrayList imageList)
        {
            // Set the layer draw options
            graphics.SetDrawOptions(drawOptions);

            // Draw each panel in the layer (as set by Update)
            for (int i = 0; i < numPanels; i++)
            {
                graphics.DrawBitmap(screenX + panels[i].xOffset, screenYValue,
                                    panels[i].drawRegion,
                                    ((IBitmap)imageList[panels[i].bmpIndex]));
            }

            // Clear the draw options
            graphics.ClearDrawOptions(drawOptions);
        }
Example #2
0
        /// <summary>
        /// Draw the world object on the back buffer.
        /// </summary>
        /// <param name="graphics">Graphics instance</param>
        /// <param name="lev">Current level</param>
        public void Draw(IGraphics graphics, Level lev)
        {
            if (!activeValue)
            {
                return;
            }

            graphics.SetDrawOptions(DrawOptions);

            int drawX = (int)lev.DrawX + (int)worldXValue -
                        (int)lev.WorldX - (animationValue.CellWidth >> 1);
            int drawY = (int)lev.DrawY + (int)worldYValue -
                        (int)lev.WorldY - (animationValue.CellHeight >> 1);

            graphics.DrawAnimation(drawX, drawY, animationValue);

            graphics.ClearDrawOptions(DrawOptions);
        }