Puede usar Andengine para fuentes en árabe y en persa también. Pero de una manera diferente. para hacer eso, necesitas crear un Sprite y agregarle un mapa de bits. antes de que dibujes tu texto en ese mapa de bits.
El siguiente código es un ejemplo que dibuja el texto persa/árabe y lo adjunta a un sprite. para que podamos adjuntar el sprite a nuestra escena. este es un ejemplo para mostrar cómo podemos hacer eso, por lo que puede ajustar el mapa de bits y el tamaño del texto usted mismo. si su dispositivo es compatible con persa/árabe, este código funcionará correctamente. si el texto no aparece en su escena, cambie su posición, está fuera de la pantalla
la función de código de ejemplo imprimirá el "Persian Golf" en persa/árabe.
private void persianGolfPrinter(){
BitmapTextureAtlas mBitmapTextureAtlas = new BitmapTextureAtlas(ResourceManager.getInstance().gameActivity.getTextureManager(), 400, 800, TextureOptions.BILINEAR);
ITextureRegion mDecoratedBalloonTextureRegion;
final IBitmapTextureAtlasSource baseTextureSource = new EmptyBitmapTextureAtlasSource(400, 800);
final IBitmapTextureAtlasSource decoratedTextureAtlasSource = new BaseBitmapTextureAtlasSourceDecorator(baseTextureSource) {
@Override
protected void onDecorateBitmap(Canvas pCanvas) throws Exception {
this.mPaint.setColor(Color.BLACK);
this.mPaint.setStyle(Style.FILL);
this.mPaint.setTextSize(32f);
this.mPaint.setTextAlign(Align.CENTER);
pCanvas.drawText("خلیج فارس", 150, 150, this.mPaint);
}
@Override
public BaseBitmapTextureAtlasSourceDecorator deepCopy() {
throw new DeepCopyNotSupportedException();
}
};
mDecoratedBalloonTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromSource(mBitmapTextureAtlas, decoratedTextureAtlasSource, 0, 0);
mBitmapTextureAtlas.load();
Sprite test = new Sprite(0,0,mDecoratedBalloonTextureRegion,ResourceManager.getInstance().engine.getVertexBufferObjectManager());
this.attachChild(test);
}
no utilizan TextView androide ... que hace que su partido feo ....
Hola, ¿u resuelve el problema de mostrar Árabe en texto modificable en andengine? me enfrento al mismo problema ahora. podría ayudarme –