|
Edited by StevenZhang at 2017-7-26 17:12 \n\nHi,
Nibiru Studio only accepts texture name or assets file name as the parameter of UI components.
So you get Bitmap first, then call the followings code:
createBitmapTexture(bmp, "XXXX", new IXBitmapTextureCreateSuccessListener() {
public void onCreateSuccess(String texName, boolean isSuccess) {
}
});
This method is used to generate a texture from the Bitmap. You can give a name to identify the texture ("XXXX" for example). The callback listener is set to listen the generate result. After generate successfully, you can use the texture name to Image or other UI components.
For example:
toolbar = new XImage("XXXX");
toolbar.setCenterPosition(0.5f, 3.0f, -6.0f);
toolbar.setSize(7.5f, 1.0f);
toolbar.setRenderOrder(7);
addActor(toolbar);
It is better to read our Development Guide before starting develop. You can download the document in our website (Downloads). The bitmap usage you can refer on Page 16 (ver 1.3.0).
Steven |
|