我怎样可以在Scene2D Image中改变纹理?
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/Image.html
文档中没有这样的方法。我通过在构造函数中提供一个纹理引用来创建自己的方法。
我怎样可以在Scene2D Image中改变纹理?
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/Image.html
文档中没有这样的方法。我通过在构造函数中提供一个纹理引用来创建自己的方法。
SpriteDrawable
中。Texture texture = ...;
Image image = new Image(texture);
// switch to a new texture
Texture newTexture = ...;
image.setDrawable(new SpriteDrawable(new Sprite(newTexture)));
((SpriteDrawable)image.getDrawable()).getSprite().setTexture(newTexture);
也能起作用吗? - SaturnImage
类创建一个.setTexture
函数呢? - Parampal PoonisetTextureRegion
,一个setSprite
,也许还有一个setPixmap
等等...你明白我的意思。 - noone