Example #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // pull in textures.
            dotTexture = CreateTextureDot(GraphicsDevice);
            Asset.LoadFrom_Content(Content);
            Asset.font_MgGenFont.DefaultCharacter = '?';

            frameRate = new MgFrameRate();
            frameRate.LoadSetUp(this, graphics, spriteBatch, true, false, 60, true);

            // initialize text input and key command input.
            // this class process multiple key combinations up to 3.
            KeysAndTextInput.Initialize();

            // example, this is done once.
            KeysAndTextInput.AddMethodsToRaiseOnKeyBoardActivity(OnTextInput, OnKeyCommandsInput, this);
            // disable or enable like so prevents garbage collections from occuring.
            KeysAndTextInput.EnableKeyCommandsInput(this);
            KeysAndTextInput.EnableTextInput(this);

            // to visually test and see the above class in practical use.
            // don't have to save the refernce this is a static instance.
            new VisualKeyboardDisplay();
            // record characters.
            VisualKeyboardDisplay.RecordTypedCharacters          = true;
            VisualKeyboardDisplay.DisplayRecordedTypedCharacters = true;
            VisualKeyboardDisplay.DisplayKeypressText            = true;
        }