public GlyphDescription(Texture2D image, GlyphTextRenderer.GlyphMetadata md) { this.Image = image; this.Metadata = md; }
public GlyphTextRenderer(Game game) { this.game = game; ContentManager global = ServiceHelper.Get<IContentManagerProvider>().Global; string str1 = "Other Textures/glyphs/"; GlyphTextRenderer.GlyphMetadata md1 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 1, SpacesAfter = 1, IsTall = false }; GlyphTextRenderer.GlyphMetadata md2 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 1, SpacesAfter = 1, IsTall = true }; GlyphTextRenderer.GlyphMetadata md3 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 2, SpacesAfter = 2, IsTall = true }; GlyphTextRenderer.GlyphMetadata md4 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 2, SpacesAfter = 2, IsTall = false }; GlyphTextRenderer.GlyphMetadata md5 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 2, SpacesAfter = 1, IsTall = false }; GlyphTextRenderer.GlyphMetadata md6 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 3, SpacesAfter = 2, IsTall = false }; GlyphTextRenderer.GlyphMetadata md7 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 3, SpacesAfter = 3, IsTall = false }; GlyphTextRenderer.GlyphMetadata md8 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 4, SpacesAfter = 4, IsTall = false }; GlyphTextRenderer.GlyphMetadata md9 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 5, SpacesAfter = 5, IsTall = false }; GlyphTextRenderer.GlyphMetadata md10 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 6, SpacesAfter = 6, IsTall = false }; GlyphTextRenderer.GlyphMetadata md11 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 7, SpacesAfter = 7, IsTall = false }; GlyphTextRenderer.GlyphMetadata md12 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 8, SpacesAfter = 8, IsTall = false }; GlyphTextRenderer.GlyphMetadata md13 = new GlyphTextRenderer.GlyphMetadata() { SpacesBefore = 9, SpacesAfter = 9, IsTall = false }; this.ButtonImages.Add("BACK", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "BackButton"), md5)); this.ButtonImages.Add("START", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "StartButton"), md5)); this.ButtonImages.Add("A", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "AButton"), md1)); this.ButtonImages.Add("B", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "BButton"), md1)); this.ButtonImages.Add("X", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "XButton"), md1)); this.ButtonImages.Add("Y", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "YButton"), md1)); this.ButtonImages.Add("RB", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "RightBumper"), md6)); this.ButtonImages.Add("LB", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "LeftBumper"), md6)); this.ButtonImages.Add("RT", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "RightTrigger"), md2)); this.ButtonImages.Add("LT", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "LeftTrigger"), md2)); this.ButtonImages.Add("LS", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "LeftStick"), md3)); this.ButtonImages.Add("RS", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "RightStick"), md3)); this.ButtonImages.Add("UP", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "DPadUp"), md3)); this.ButtonImages.Add("DOWN", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "DPadDown"), md3)); this.ButtonImages.Add("LEFT", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "DPadLeft"), md3)); this.ButtonImages.Add("RIGHT", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "DPadRight"), md3)); this.ButtonImages.Add("LA", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "LeftArrow"), md1)); this.ButtonImages.Add("RA", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str1 + "RightArrow"), md1)); string str2 = "Other Textures/keyboard_glyphs/"; this.ButtonImages.Add("P_D0", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_0"), md1)); this.ButtonImages.Add("P_D1", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_1"), md1)); this.ButtonImages.Add("P_D2", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_2"), md1)); this.ButtonImages.Add("P_D3", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_3"), md1)); this.ButtonImages.Add("P_D4", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_4"), md1)); this.ButtonImages.Add("P_D5", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_5"), md1)); this.ButtonImages.Add("P_D6", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_6"), md1)); this.ButtonImages.Add("P_D7", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_7"), md1)); this.ButtonImages.Add("P_D8", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_8"), md1)); this.ButtonImages.Add("P_D9", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_9"), md1)); this.ButtonImages.Add("P_Q", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_Q"), md1)); this.ButtonImages.Add("P_W", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_W"), md1)); this.ButtonImages.Add("P_E", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_E"), md1)); this.ButtonImages.Add("P_R", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_R"), md1)); this.ButtonImages.Add("P_T", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_T"), md1)); this.ButtonImages.Add("P_Y", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_Y"), md1)); this.ButtonImages.Add("P_U", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_U"), md1)); this.ButtonImages.Add("P_I", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_I"), md1)); this.ButtonImages.Add("P_O", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_O"), md1)); this.ButtonImages.Add("P_P", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_P"), md1)); this.ButtonImages.Add("P_A", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_A"), md1)); this.ButtonImages.Add("P_S", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_S"), md1)); this.ButtonImages.Add("P_D", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_D"), md1)); this.ButtonImages.Add("P_F", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F"), md1)); this.ButtonImages.Add("P_G", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_G"), md1)); this.ButtonImages.Add("P_H", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_H"), md1)); this.ButtonImages.Add("P_J", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_J"), md1)); this.ButtonImages.Add("P_K", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_K"), md1)); this.ButtonImages.Add("P_L", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_L"), md1)); this.ButtonImages.Add("P_Z", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_Z"), md1)); this.ButtonImages.Add("P_X", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_X"), md1)); this.ButtonImages.Add("P_C", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_C"), md1)); this.ButtonImages.Add("P_V", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_V"), md1)); this.ButtonImages.Add("P_B", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_B"), md1)); this.ButtonImages.Add("P_N", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_N"), md1)); this.ButtonImages.Add("P_M", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_M"), md1)); this.ButtonImages.Add("P_NumLock", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_LOCK"), md11)); this.ButtonImages.Add("P_NumPad0", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_0"), md8)); this.ButtonImages.Add("P_NumPad1", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_1"), md8)); this.ButtonImages.Add("P_NumPad2", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_2"), md8)); this.ButtonImages.Add("P_NumPad3", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_3"), md8)); this.ButtonImages.Add("P_NumPad4", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_4"), md8)); this.ButtonImages.Add("P_NumPad5", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_5"), md8)); this.ButtonImages.Add("P_NumPad6", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_6"), md8)); this.ButtonImages.Add("P_NumPad7", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_7"), md8)); this.ButtonImages.Add("P_NumPad8", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_8"), md8)); this.ButtonImages.Add("P_NumPad9", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_NUM_9"), md8)); this.ButtonImages.Add("P_Up", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ARROW_UP"), md1)); this.ButtonImages.Add("P_Down", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ARROW_DOWN"), md1)); this.ButtonImages.Add("P_Left", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ARROW_LEFT"), md1)); this.ButtonImages.Add("P_Right", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ARROW_RIGHT"), md1)); this.ButtonImages.Add("P_Home", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_HOME"), md8)); this.ButtonImages.Add("P_End", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_END"), md7)); this.ButtonImages.Add("P_PageUp", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_PAGE_UP"), md7)); this.ButtonImages.Add("P_PageDown", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_PAGE_DOWN"), md9)); this.ButtonImages.Add("P_Insert", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_INSERT"), md9)); this.ButtonImages.Add("P_Scroll", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_SCROLL"), md9)); this.ButtonImages.Add("P_RightAlt", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_R_ALT"), md8)); this.ButtonImages.Add("P_RightControl", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_R_CONTROL"), md12)); this.ButtonImages.Add("P_RightWindows", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_R_WINDOWS"), md12)); this.ButtonImages.Add("P_RightShift", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_R_SHIFT"), md10)); this.ButtonImages.Add("P_LeftAlt", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_L_ALT"), md8)); this.ButtonImages.Add("P_LeftControl", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_L_CONTROL"), md12)); this.ButtonImages.Add("P_LeftWindows", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_L_WINDOWS"), md12)); this.ButtonImages.Add("P_LeftShift", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_L_SHIFT"), md10)); this.ButtonImages.Add("P_Escape", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ESCAPE"), md10)); this.ButtonImages.Add("P_F1", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F1"), md4)); this.ButtonImages.Add("P_F2", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F2"), md4)); this.ButtonImages.Add("P_F3", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F3"), md4)); this.ButtonImages.Add("P_F4", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F4"), md4)); this.ButtonImages.Add("P_F5", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F5"), md4)); this.ButtonImages.Add("P_F6", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F6"), md4)); this.ButtonImages.Add("P_F7", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F7"), md4)); this.ButtonImages.Add("P_F8", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F8"), md4)); this.ButtonImages.Add("P_F9", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F9"), md4)); this.ButtonImages.Add("P_F10", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F10"), md7)); this.ButtonImages.Add("P_F11", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F11"), md7)); this.ButtonImages.Add("P_F12", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_F12"), md7)); this.ButtonImages.Add("P_OemPeriod", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_PERIOD"), md1)); this.ButtonImages.Add("P_OemComma", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_COMMA"), md1)); this.ButtonImages.Add("P_OemSemicolon", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_SEMICOLON"), md1)); this.ButtonImages.Add("P_OemQuotes", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_QUOTES"), md1)); this.ButtonImages.Add("P_OemTilde", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_TILDE"), md1)); this.ButtonImages.Add("P_OemOpenBrackets", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_R_BRACKET"), md1)); this.ButtonImages.Add("P_OemCloseBrackets", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_L_BRACKET"), md1)); this.ButtonImages.Add("P_OemPipe", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_PIPE"), md1)); this.ButtonImages.Add("P_OemQuestion", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_QUESTION"), md1)); this.ButtonImages.Add("P_Divide", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_DIVIDE"), md1)); this.ButtonImages.Add("P_Add", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_PLUS"), md1)); this.ButtonImages.Add("P_OemMinus", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_MINUS"), md1)); this.ButtonImages.Add("P_Multiply", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_MULTIPLY"), md1)); this.ButtonImages.Add("P_OemPlus", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_EQUAL"), md1)); this.ButtonImages.Add("P_Space", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_SPACE"), md9)); this.ButtonImages.Add("P_Tab", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_TAB"), md7)); this.ButtonImages.Add("P_Back", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_BACKSPACE"), md13)); this.ButtonImages.Add("P_Delete", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_DELETE"), md10)); this.ButtonImages.Add("P_CapsLock", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_CAPS"), md13)); this.ButtonImages.Add("P_Enter", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ENTER"), md9)); this.ButtonImages.Add("P_WASD", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_WASD"), md9)); this.ButtonImages.Add("P_IJKL", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_IJKL"), md9)); this.ButtonImages.Add("P_Arrows", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ARROWS"), md9)); this.ButtonImages.Add("P_ZQSD", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ZQSD"), md9)); this.ButtonImages.Add("P_ESDF", new GlyphTextRenderer.GlyphDescription(global.Load<Texture2D>(str2 + "P_ESDF"), md9)); }