public static void drawText(string text, uint x, uint y, uint color, ref Cosmos.Hardware.VGAScreen screen) { for (int count = 0; count <= text.Length; count++) { drawLetter(text.Substring(count, 1), x, y, color, ref screen); x += 7; } }
public static void Dr(int X, int Y, int Xs, int Ys, int[] Array) { Cosmos.Hardware.VGAScreen VGA = new Cosmos.Hardware.VGAScreen(); for (int x = 0; x < Xs; x++) { for (int y = 0; y < Ys; y++) { VGA.SetPixel((uint)(x + X), (uint)(y + Y), (uint)(Array[x * y])); } } }
public static void Dr(int X, int Y, int Xs, int Ys, int[] Array) { Cosmos.Hardware.VGAScreen VGA = new Cosmos.Hardware.VGAScreen(); for(int x = 0; x < Xs; x++) { for (int y = 0; y < Ys; y++) { VGA.SetPixel((uint)(x + X), (uint)(y + Y), (uint)(Array[x * y])); } } }
public static void Initialize() { screen = new Cosmos.Hardware.VGAScreen(); screen.SetMode320x200x8(); screen.SetPaletteEntry(0, 0, 0, 0); // black screen.SetPaletteEntry(1, 255, 255, 255); // white screen.SetPaletteEntry(2, 255, 0, 0); // red screen.SetPaletteEntry(3, 0, 255, 0); // green screen.SetPaletteEntry(4, 0, 0, 255); // blue screen.SetPaletteEntry(5, 255, 0, 255); // purple mouse = new Drawing.Mouse((uint)screen.PixelWidth / (uint)2, (uint)screen.PixelHeight / (uint)2); Font.SetupFont(); Update(); }
public static void drawArray(uint[] letter, uint x, uint y, uint color, ref Cosmos.Hardware.VGAScreen screen) { for (int i = 0; i <= letter.Length; i++) //This is the Y { for (int j = 0; j <= letter.GetLength(0); j++) //This is X { if (letter[i].ToString().Substring(j, 1) == "1") { screen.SetPixel320x200x8(x + (uint)j, y + (uint)i, color); } else if (letter[i].ToString().Substring(j, 1) == "2") { } else { break; } } } }
public static void drawLetter(string letter, uint x, uint y, uint color, ref Cosmos.Hardware.VGAScreen screen) { if (letter.Length != 1) { } else { //Do the magic if (letter == " ") { drawArray(space, x, y, color, ref screen); } else if (letter == "/") { drawArray(slash, x, y, color, ref screen); } else if (letter == @"""") { drawArray(quote, x, y, color, ref screen); } else if (letter == @"\") { drawArray(backslash, x, y, color, ref screen); } else if (letter == ":") { drawArray(colon, x, y, color, ref screen); } else if (letter == ";") { drawArray(semicolon, x, y, color, ref screen); } else if (letter == ">") { drawArray(arrowright, x, y, color, ref screen); } else if (letter == "<") { drawArray(arrowleft, x, y, color, ref screen); } else if (letter == ",") { drawArray(comma, x, y, color, ref screen); } else if (letter == ".") { drawArray(dot, x, y, color, ref screen); } else if (letter == "!") { drawArray(excla, x, y, color, ref screen); } else if (letter == "a") { drawArray(a, x, y, color, ref screen); } else if (letter == "b") { drawArray(b, x, y, color, ref screen); } else if (letter == "c") { drawArray(c, x, y, color, ref screen); } else if (letter == "d") { drawArray(d, x, y, color, ref screen); } else if (letter == "e") { drawArray(e, x, y, color, ref screen); } else if (letter == "f") { drawArray(f, x, y, color, ref screen); } else if (letter == "g") { drawArray(g, x, y, color, ref screen); } else if (letter == "h") { drawArray(h, x, y, color, ref screen); } else if (letter == "i") { drawArray(i, x, y, color, ref screen); } else if (letter == "j") { drawArray(j, x, y, color, ref screen); } else if (letter == "k") { drawArray(k, x, y, color, ref screen); } else if (letter == "l") { drawArray(l, x, y, color, ref screen); } else if (letter == "m") { drawArray(m, x, y, color, ref screen); } else if (letter == "n") { drawArray(n, x, y, color, ref screen); } else if (letter == "o") { drawArray(o, x, y, color, ref screen); } else if (letter == "p") { drawArray(p, x, y, color, ref screen); } else if (letter == "q") { drawArray(q, x, y, color, ref screen); } else if (letter == "r") { drawArray(r, x, y, color, ref screen); } else if (letter == "s") { drawArray(s, x, y, color, ref screen); } else if (letter == "t") { drawArray(t, x, y, color, ref screen); } else if (letter == "u") { drawArray(u, x, y, color, ref screen); } else if (letter == "v") { drawArray(v, x, y, color, ref screen); } else if (letter == "w") { drawArray(w, x, y, color, ref screen); } else if (letter == "x") { drawArray(sx, x, y, color, ref screen); } else if (letter == "y") { drawArray(sy, x, y, color, ref screen); } else if (letter == "z") { drawArray(z, x, y, color, ref screen); } else if (letter == "0") { drawArray(n0, x, y, color, ref screen); } else if (letter == "1") { drawArray(n1, x, y, color, ref screen); } else if (letter == "2") { drawArray(n2, x, y, color, ref screen); } else if (letter == "3") { drawArray(n3, x, y, color, ref screen); } else if (letter == "4") { drawArray(n4, x, y, color, ref screen); } else if (letter == "5") { drawArray(n5, x, y, color, ref screen); } else if (letter == "6") { drawArray(n6, x, y, color, ref screen); } else if (letter == "7") { drawArray(n7, x, y, color, ref screen); } else if (letter == "8") { drawArray(n8, x, y, color, ref screen); } else if (letter == "9") { drawArray(n9, x, y, color, ref screen); } } }