Ejemplo n.º 1
0
        public static uint Draw(IFrameBuffer frameBuffer, uint tileSize)
        {
            uint positionX = (frameBuffer.Width / 2) - ((_width * tileSize) / 2);
            uint positionY = (frameBuffer.Height / 2) - ((_height * tileSize) / 2);

            //Can't store these as a static fields, they seem to break something
            uint[] logo   = new uint[] { 0x39E391, 0x44145B, 0x7CE455, 0x450451, 0x450451, 0x451451, 0x44E391 };
            uint[] colors = new uint[] { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00FFFF00 }; //Colors for each pixel

            for (int ty = 0; ty < _height; ty++)
            {
                uint data = logo[ty];

                for (int tx = 0; tx < _width; tx++)
                {
                    int mask = 1 << tx;

                    if ((data & mask) == mask)
                    {
                        frameBuffer.FillRectangle(colors[tx / 6], (uint)(positionX + (tileSize * tx)), (uint)(positionY + (tileSize * ty)), tileSize, tileSize); //Each pixel is aprox 5 tiles in width
                    }
                }
            }

            return(positionY);
        }
Ejemplo n.º 2
0
        /// <summary>Clears the screen with specified color.</summary>
        /// <param name="color">The color.</param>
        public void Clear(Color color)
        {
            uint ClearColor = 0x00000000;

            frameBuffer.FillRectangle(ClearColor, 0, 0, (uint)width / 2, (uint)height / 2);

            UpdateScreen();
        }
Ejemplo n.º 3
0
 private void Scroll()
 {
     // TODO: Scroll
     _row = 0;
     dev.FillRectangle(0, 0, dev.Width, dev.Height, 0);
 }
Ejemplo n.º 4
0
        //ToDo: fix ellipse drawing

        public static void FillRectangle(this IFrameBuffer buffer, Color color, Rectangle rec)
        {
            buffer.FillRectangle(color.ToHex(), rec.Location.X, rec.Location.Y, rec.Size.Width, rec.Size.Height);
        }