android - resize/scale text dynamically in andengine -


i created simple game move objects 1 place , each moves increment count of moves in score table. after objects moved correct want set opacity screen , resizing score initial size(e.g. 15px) whole screen(e.g. 50px). load font this:

    fontfactory.setassetbasepath("font/");     final itexture mainfonttexture = new bitmaptextureatlas(activity.gettexturemanager(), 256, 256, textureoptions.bilinear_premultiplyalpha);     font = fontfactory.createstrokefromasset(activity.getfontmanager(), mainfonttexture, activity.getassets(), "font.ttf", 15, true, color.white, 2, color.black);     font.load(); 

in createscene() method create hud text , initial text:

int mmoves = 0; hud gamehud = new hud(); text mtext = new text(25, 25, font, "moves: " + "123456789", getvertexbufferobjectmanager()); 

and each moves set text actual moves count:

mtext.settext("moves: " +  mmoves++); 

and when level complete don't know how can resize text. mean scale transition in css3.. comments

you can set size of text using setscale function.

if want set size use following : example : mtext.setscale(1.5f);

you can use entity modifiers create animation:

scalemodifier scale = new scalemodifier(1f, 1f, 1.1f); loopentitymodifier loop = new loopentitymodifier(scale); mtext.registerentitymodifier(loop); 

this give animation effect re-sizing text in loop.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -