/// <summary> /// Initializes a new instance of the FontRenderer class. /// </summary> public FontRenderer(Layer layer, Font font, int charWidth, int charHeight) { this.layer = layer; this.font = font; this.charWidth = charWidth; this.charHeight = charHeight; }
public void Plot(char character, int x, int y, Layer layer, Colour colour) { var characterLines = charmap[character] as Line[]; for (int i = 0; i < characterLines.Length; i++) { layer.DrawLine(characterLines[i].Start.X + x, characterLines[i].Start.Y + y, characterLines[i].End.X + x, characterLines[i].End.Y + y, colour); } }
public int CreateLayer() { var newBuffer = new Layer[buffer.Length + 1]; for (int i = 0; i < buffer.Length; i++) { newBuffer[i] = buffer[i]; } var layer = new Layer(this.screen.Width, this.screen.Height); newBuffer[buffer.Length] = layer; buffer = newBuffer; return buffer.Length - 1; }
protected override void BeforeRun() { var vga = new VGAScreen(); vga.SetGraphicsMode(VGAScreen.ScreenSize.Size320x200, VGAScreen.ColorDepth.BitDepth8); screen = new Screen(vga); canvas = new Canvas(screen); canvas.Clear(); mouse.Initialize(); var ml = canvas.CreateLayer(); mouseLayer = canvas.GetLayer(ml); //mouseLayer.DrawLine(0, 0, 200, 200, Colour.LimeGreen); //canvas.Redraw(); }