コード例 #1
0
        /// <summary>
        /// 设置立绘(预设位置:左 中 右)
        /// </summary>
        /// <param name="depth">目标所在的层级</param>
        /// <param name="spriteName">需要更改的背景图片名</param>
        /// <param name="position">left | middle | right 左中右</param>
        public EffectPiece SetSprite(int depth, string spriteName, string position, float alpha = 1)
        {
            Queue <NewImageEffect> effects = new Queue <NewImageEffect>();

            effects.Enqueue(NewEffectBuilder.SetSpriteByDepth(depth, spriteName));
            effects.Enqueue(NewEffectBuilder.SetAlphaByDepth(depth, alpha));
            effects.Enqueue(NewEffectBuilder.SetDefaultPostionByDepth(depth, position));
            return(new EffectPiece(id++, effects));
        }
コード例 #2
0
        /// <summary>
        /// 设置立绘(预设位置:左 中 右)
        /// </summary>
        /// <param name="depth">目标所在的层级</param>
        /// <param name="spriteName">需要更改的背景图片名</param>
        /// <param name="position">left | middle | right 左中右</param>
        public EffectPiece SetCharacterSprite(int depth, string spriteName, string position = "middle")
        {
            Queue <NewImageEffect> effects = new Queue <NewImageEffect>();

            effects.Enqueue(NewEffectBuilder.SetSpriteByDepth(depth, spriteName));
            effects.Enqueue(NewEffectBuilder.SetAlphaByDepth(depth, 1));
            effects.Enqueue(NewEffectBuilder.SetDefaultPostionByDepth(depth, position));
            return(new EffectPiece(id++, effects));
        }
コード例 #3
0
        /// <summary>
        /// 设置立绘(预设位置:左 中 右后淡入)
        /// </summary>
        /// <param name="depth">目标所在的层级</param>
        /// <param name="spriteName">需要更改的背景图片名</param>
        /// <param name="position">left | middle | right 左中右</param>
        /// <param name="fadein">淡入的时间,默认0.3s</param>
        public EffectPiece SetCharacterSprite(int depth, string spriteName, string position, float fadein = 0.3f)
        {
            Queue <NewImageEffect> effects = new Queue <NewImageEffect>();

            effects.Enqueue(NewEffectBuilder.SetSpriteByDepth(depth, spriteName));
            effects.Enqueue(NewEffectBuilder.SetAlphaByDepth(depth, 0));
            effects.Enqueue(NewEffectBuilder.SetDefaultPostionByDepth(depth, position));
            effects.Enqueue(NewEffectBuilder.FadeInByDepth(depth, fadein));
            return(new EffectPiece(id++, effects));
        }