Ejemplo n.º 1
0
        public bool Draw(IMessageRenderer msgRenderer, byte[] data, int animationGroupIndex, int frameIndex, float positionX, float positionY)
        {
            _textContext = null;
            var isAnimationEnd = Draw(animationGroupIndex, frameIndex, positionX, positionY);

            if (_textContext != null && msgRenderer != null && data != null)
            {
                const float UiTextScale = 0.75f;
                var         seqGroup    = Sequence.AnimationGroups[animationGroupIndex];
                float       textScale   = seqGroup.TextScale == 0 ? UiTextScale : (seqGroup.TextScale / 24f);

                var fakeTextDrawContext = new DrawContext
                {
                    Scale      = textScale,
                    IgnoreDraw = true,
                };
                msgRenderer.Draw(fakeTextDrawContext, data);
                var width = (float)fakeTextDrawContext.Width;

                var xPos = _textContext.PositionX - width / 2 + seqGroup.TextPositionX;
                msgRenderer.Draw(new DrawContext
                {
                    xStart          = xPos,
                    x               = xPos,
                    y               = _textContext.PositionY + seqGroup.TextPositionY,
                    Color           = _textContext.Color,
                    Scale           = textScale,
                    WidthMultiplier = 1.0f,
                }, data);
            }

            return(isAnimationEnd);
        }
 public MessageTypingEffectAnimator(
     IMessageRenderer messageRenderer,
     IMessageFormatter messageFormatter,
     GameObject pagingIndicator,
     MonoBehaviour runner)
 {
     this.messageRenderer  = messageRenderer;
     this.messageFormatter = messageFormatter;
     this.pagingIndicator  = pagingIndicator;
     this.runner           = runner;
 }
Ejemplo n.º 3
0
 public void SetMessage(IMessageRenderer messageRenderer, byte[] message)
 {
     _messageRenderer = messageRenderer;
     _message         = message;
 }
Ejemplo n.º 4
0
 public FlashesTagHelper(ITempDataDictionaryFactory factory, IHttpContextAccessor httpContextAccessor, IMessageRenderer messageRenderer)
 {
     this.tempDataDictionaryFactory = factory;
     this.httpContextAccessor       = httpContextAccessor;
     this.messageRenderer           = messageRenderer;
 }