コード例 #1
0
        public MessageInputHandler(WorldInstance worldInstance, MessageRendererState messageRendererState, TimeSpan totalTime, Action<IXnaGameTime> messageClosingDelegate)
        {
            worldInstance.ThrowIfNull("worldInstance");
            messageRendererState.ThrowIfNull("messageRendererState");
            messageClosingDelegate.ThrowIfNull("messageClosingDelegate");

            _worldInstance = worldInstance;
            _messageRendererState = messageRendererState;
            _messageClosingDelegate = messageClosingDelegate;
            _answerKeyboardStateHelper = new KeyboardStateHelper(
                KeyDown,
                null,
                null,
                TextAdventure.Xna.Constants.MessageRenderer.Input.AcceptKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.NextAnswerKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.PreviousAnswerKey);
            _scrollKeyboardStateHelper = new KeyboardStateHelper(
                _scrollKeyboardRepeatHelper,
                TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollUpKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollDownKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.HomeKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.EndKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.PageUpKey,
                TextAdventure.Xna.Constants.MessageRenderer.Input.PageDownKey);
            _scrollKeyboardRepeatHelper.InitialInterval = TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollKeyboardInterval;
            _scrollKeyboardRepeatHelper.RepeatingInterval = TextAdventure.Xna.Constants.MessageRenderer.Input.ScrollKeyboardInterval;
        }
コード例 #2
0
        public MessageFadeOutAndScaleUpdater(MessageRendererState messageRendererState, TimeSpan totalTime, Action completeDelegate)
        {
            messageRendererState.ThrowIfNull("messageRendererState");
            completeDelegate.ThrowIfNull("completeDelegate");
            if (totalTime < TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException("totalTime");
            }

            _messageRendererState = messageRendererState;
            _completeDelegate = completeDelegate;
            _timedLerpHelper = new TimedLerpHelper(totalTime, TextAdventure.Xna.Constants.MessageRenderer.FadeOutDuration, 1f, 0f);
        }