@@ -759,8 +759,15 @@ tyrano.plugin.kag.tag.text = {
759
759
760
760
if ( jtext . find ( "p" ) . find ( ".current_span" ) . length != 0 ) {
761
761
762
+ //アニメーションは強制停止させる。
763
+ jtext . find ( "p" ) . find ( ".current_span" ) . find ( "span" ) . css ( {
764
+ "opacity" :1 ,
765
+ "visibility" :"visible" ,
766
+ "animation" :""
767
+ } ) ;
768
+
762
769
current_str = jtext . find ( "p" ) . find ( ".current_span" ) . html ( ) ;
763
-
770
+
764
771
}
765
772
766
773
that . kag . checkMessage ( jtext ) ;
@@ -857,23 +864,37 @@ tyrano.plugin.kag.tag.text = {
857
864
858
865
append_str += "<span style='display:inline-block;opacity:0'>" + c + "</span>" ;
859
866
}
867
+
860
868
current_str += "<span>" + append_str + "</span>" ;
861
869
862
870
//アニメーション設定。無効な場合がある
863
- if ( typeof that . kag . stat . font . anim == "undefined" || that . kag . stat . font . anim == "none" ) {
864
- that . kag . stat . font . anim = "" ;
871
+ if ( typeof that . kag . stat . font . effect == "undefined" || that . kag . stat . font . effect == "none" ) {
872
+ that . kag . stat . font . effect = "" ;
865
873
}
866
874
867
875
// hidden状態で全部追加する
868
876
that . kag . appendMessage ( jtext , current_str ) ;
877
+
869
878
var append_span = j_span . children ( 'span:last-child' ) ;
870
879
var makeVisible = function ( index ) {
871
880
872
881
//append_span.children("span:eq(" + index + ")").addClass("fadeIn");
873
882
//append_span.children("span:eq(" + index + ")").css('animation','rollIn 0.2s ease 0s 1 normal forwards');
874
883
875
- if ( that . kag . stat . font . anim != "" ) {
876
- append_span . children ( "span:eq(" + index + ")" ) . css ( 'animation' , "t" + that . kag . stat . font . anim + ' ' + that . kag . stat . font . anim_speed + ' ease 0s 1 normal forwards' ) ;
884
+ if ( that . kag . stat . font . effect != "" ) {
885
+
886
+ append_span . children ( "span:eq(" + index + ")" ) . on ( "animationend" , function ( e ) {
887
+
888
+ $ ( e . target ) . css ( {
889
+ "opacity" :1 ,
890
+ "visibility" :"visible" ,
891
+ "animation" :""
892
+ } ) ;
893
+
894
+ } ) ;
895
+
896
+ append_span . children ( "span:eq(" + index + ")" ) . css ( 'animation' , "t" + that . kag . stat . font . effect + ' ' + that . kag . stat . font . effect_speed + ' ease 0s 1 normal forwards' ) ;
897
+
877
898
} else {
878
899
append_span . children ( "span:eq(" + index + ")" ) . css ( { 'visibility' :'visible' , 'opacity' :'1' } ) ;
879
900
}
@@ -3080,8 +3101,10 @@ tyrano.plugin.kag.tag.quake = {
3080
3101
face=フォントの種類を指定。非KAG互換でウェブフォントも利用可能。プロジェクトフォルダのothersフォルダに配置してください。そして、tyrano.cssの@font-faceを指定することで利用できます。,
3081
3102
edge=文字の縁取りを有効にできます。縁取りする文字色を 0xRRGGBB 形式で指定します。縁取りを解除する場合は「none」と指定してください,
3082
3103
shadow=文字に影をつけます。影の色を 0xRRGGBB 形式で指定します。影を解除する場合は「none」と指定してください,
3083
- anim=フォントの表示演出にアニメーションを設定できます。noneを指定すると無効。デフォルトはnone。設定できる値は次のとおりです。/
3084
- fadeIn/fadeInDown/fadeInLeft/fadeInRight/fadeInUp/rotateIn/zoomIn/slideIn/bounceIn/vanishIn/puffIn/rollIn/none,
3104
+ effect=フォントの表示演出にアニメーションを設定できます。noneを指定すると無効。デフォルトはnone。設定できる値は次のとおりです。/
3105
+ fadeIn/fadeInDown/fadeInLeft/fadeInRight/fadeInUp/rotateIn/zoomIn/slideIn/bounceIn/vanishIn/puffIn/rollIn/none,
3106
+ effect_speed=effectパラメータがnone以外の場合に、表示されるまでの時間を指定します。デフォルトは0.2s です。 sは秒を表します。
3107
+
3085
3108
3086
3109
:demo
3087
3110
1,kaisetsu/02_decotext
@@ -3123,18 +3146,18 @@ tyrano.plugin.kag.tag.font = {
3123
3146
this . kag . stat . font [ "italic" ] = $ . convertItalic ( pm . italic ) ;
3124
3147
}
3125
3148
3126
- if ( pm . anim ) {
3149
+ if ( pm . effect ) {
3127
3150
3128
- if ( pm . anim == "none" ) {
3129
- this . kag . stat . font [ "anim " ] = "" ;
3151
+ if ( pm . effect == "none" ) {
3152
+ this . kag . stat . font [ "effect " ] = "" ;
3130
3153
} else {
3131
- this . kag . stat . font [ "anim " ] = pm . anim ;
3154
+ this . kag . stat . font [ "effect " ] = pm . effect ;
3132
3155
}
3133
3156
3134
3157
}
3135
3158
3136
- if ( pm . anim_speed ) {
3137
- this . kag . stat . font [ "anim_speed " ] = pm . anim_speed ;
3159
+ if ( pm . effect_speed ) {
3160
+ this . kag . stat . font [ "effect_speed " ] = pm . effect_speed ;
3138
3161
}
3139
3162
3140
3163
@@ -3179,6 +3202,9 @@ italic=trueを指定するとイタリック体で表示されます。デフォ
3179
3202
face=フォントの種類を指定。非KAG互換でウェブフォントも利用可能。プロジェクトフォルダのothersフォルダに配置してください。そして、tyrano.cssの@font-faceを指定することで利用できます。,
3180
3203
edge=文字の縁取りを有効にできます。縁取りする文字色を 0xRRGGBB 形式で指定します。縁取りを解除する場合は「none」と指定してください,
3181
3204
shadow=文字に影をつけます。影の色を 0xRRGGBB 形式で指定します。影を解除する場合は「none」と指定してください
3205
+ effect=フォントの表示演出にアニメーションを設定できます。noneを指定すると無効。デフォルトはnone。設定できる値は次のとおりです。/
3206
+ fadeIn/fadeInDown/fadeInLeft/fadeInRight/fadeInUp/rotateIn/zoomIn/slideIn/bounceIn/vanishIn/puffIn/rollIn/none,
3207
+ effect_speed=effectパラメータがnone以外の場合に、表示されるまでの時間を指定します。デフォルトは0.2s です。 sは秒を表します。
3182
3208
3183
3209
:demo
3184
3210
1,kaisetsu/22_font
@@ -3217,18 +3243,18 @@ tyrano.plugin.kag.tag.deffont = {
3217
3243
this . kag . stat . default_font . italic = $ . convertItalic ( pm . italic ) ;
3218
3244
}
3219
3245
3220
- if ( pm . anim ) {
3246
+ if ( pm . effect ) {
3221
3247
3222
- if ( pm . anim == "none" ) {
3223
- this . kag . stat . default_font [ "anim " ] = "" ;
3248
+ if ( pm . effect == "none" ) {
3249
+ this . kag . stat . default_font [ "effect " ] = "" ;
3224
3250
} else {
3225
- this . kag . stat . default_font [ "anim " ] = pm . anim ;
3251
+ this . kag . stat . default_font [ "effect " ] = pm . effect ;
3226
3252
}
3227
3253
3228
3254
}
3229
3255
3230
- if ( pm . anim_speed ) {
3231
- this . kag . stat . default_font [ "anim_speed " ] = pm . anim_speed ;
3256
+ if ( pm . effect_speed ) {
3257
+ this . kag . stat . default_font [ "effect_speed " ] = pm . effect_speed ;
3232
3258
}
3233
3259
3234
3260
0 commit comments