MCPcopy Create free account
hub / github.com/Var3D/var3dframe / getTextureRegion

Method getTextureRegion

core/src/core/java/var3d/net/center/VGame.java:1884–1903  ·  view source on GitHub ↗

获取TextureRegion

(String name)

Source from the content-addressed store, hash-verified

1882 * 获取TextureRegion
1883 */
1884 public TextureRegion getTextureRegion(String name) {
1885 if (isProtect && !isReProtect) {
1886 return getTextureRegion2(name);
1887 }
1888 if (atlas != null) {
1889 TextureRegion region = atlas.findRegion(name);
1890 if (region != null)
1891 return region;
1892 }
1893 Texture tex = null;
1894 if (assets.isLoaded(name, Texture.class) == true) {
1895 tex = assets.get(name, Texture.class);
1896 } else {
1897 assets.load(name, Texture.class);
1898 assets.finishLoading();
1899 tex = assets.get(name, Texture.class);
1900 tex.setFilter(filter, filter);
1901 }
1902 return new TextureRegion(tex);
1903 }
1904
1905 public TextureRegion getTextureRegion2(String name) {
1906 TextureRegion regin;

Callers 6

getParticleEffectMethod · 0.95
getImageMethod · 0.95
getTextureRegionsMethod · 0.95
getDrawableMethod · 0.95
getNinePatchMethod · 0.95
getCheckBoxStyleMethod · 0.95

Calls 3

getTextureRegion2Method · 0.95
loadMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected