简体   繁体   English

在AndEngine GlES2.0中使文本闪烁

[英]Make text Blink in AndEngine GlES2.0

WHAT I WANT: I want my text to appear character by character and when entire text is visible, I want entire text to blink. 我想要的是:我希望我的文本按字符显示,并且当整个文本可见时,我希望整个文本闪烁。

WHAT I HAVE DONE: 我做了什么:

Text displayText = new TickerText(WIDTH / 2 - ((displayTxt.length() / 2) 
    * FONT_SIZE_LARGE) / 2 - FONT_SIZE_LARGE, HEIGHT / 2, mPlokFontLarge, 
    displayTxt, new TickerTextOptions(HorizontalAlign.CENTER, 4),
    vertexBufferObjectManager);
scene.attachChild(displayText);

This code adds the text which is in string displayTxt and then make it appear character by character. 这段代码添加了字符串displayTxt的文本,然后使其逐字符显示。 Now to make it blinking i made a LoopEntityModifier 现在让它闪烁,我做了一个LoopEntityModifier

final LoopEntityModifier blinkModifier = new LoopEntityModifier(
    new SequenceEntityModifier(new FadeOutModifier(0.25f), new FadeInModifier(0.25f)));

But i can't add this to displayText . 但是我不能将此添加到displayText

Also i checked out this link which tells how to do so , but the problem is, it is for GLES1.0 我也检查了这个链接,它告诉你怎么做 ,但问题是,它是为GLES1.0

Any help is appreciated. 任何帮助表示赞赏。 Also, I am very new to AndEngine, so please forgive it I am going wrong and guide me. 另外,我对AndEngine还是陌生的,所以请原谅我错了并指导我。 Also if you can point me to relevant tutorials, it will be appreciated 另外,如果您能指出相关教程,也将不胜感激。

您应该可以使用类似以下内容的文本添加任何修饰符

displayText.registerEntityModifier(yourModifierHere)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM