public static BitmapText attachAName ( Node node , String name ) { checkInit ( ) ; BitmapFont guiFont = assetManager . loadFont ( "Interface/Fonts/Default.fnt" ) ; BitmapText ch = new BitmapText ( guiFont , false ) ; ch . setName ( "BitmapText" ) ; ch . setSize ( guiFont . getCharSet ( ) . getRenderedSize ( ) * 0.02f ) ; ch . setText ( name ) ; // crosshairs ch . setColor ( new ColorRGBA ( 0f , 0f , 0f , 1f ) ) ; ch . getLocalScale ( ) . divideLocal ( node . getLocalScale ( ) ) ; // controlador para que los objetos miren a la cámara. BillboardControl control = new BillboardControl ( ) ; ch . addControl ( control ) ; node . attachChild ( ch ) ; return ch ; }
Creates a geometry with the same name of the given node . It adds a controller called BillboardControl that turns the name of the node in order to look at the camera .