获取TextureRegion
(String name)
| 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; |
no test coverage detected