We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TMXTiledMap map; public void onLoad() { //加载TMX地图,XML中图片加载路径在assets文件夹下 map = new TMXTiledMap("assets/desert.tmx","assets"); } public void draw(GLEx g) { //当onLoad中资源全部加载完毕时 if (isOnLoadComplete()) { //绘制TMX地图到屏幕,由TMX坐标的1,5位置开始显示(换算为像素坐标就是1_tileWidth,5_tileHeight) map.draw(g,1,5); } }
按照这个方法,画出来的地图没有纹理,全是白色方块。这个问题只出现在opengles版本引擎上。 根据我的排察验证,gles版本引擎如果在onLoad方法中使用了loadTexture方法,那么载入的图片就会变成一片白色,具体原因不知。 如上面的代码,如果把map的初始化放到 draw方法里,就能正常显示。 @cping 大神到底会不会看这里的信息啊!!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
TMXTiledMap map;
public void onLoad() {
//加载TMX地图,XML中图片加载路径在assets文件夹下
map = new TMXTiledMap("assets/desert.tmx","assets");
}
public void draw(GLEx g) {
//当onLoad中资源全部加载完毕时
if (isOnLoadComplete()) {
//绘制TMX地图到屏幕,由TMX坐标的1,5位置开始显示(换算为像素坐标就是1_tileWidth,5_tileHeight)
map.draw(g,1,5);
}
}
按照这个方法,画出来的地图没有纹理,全是白色方块。这个问题只出现在opengles版本引擎上。
根据我的排察验证,gles版本引擎如果在onLoad方法中使用了loadTexture方法,那么载入的图片就会变成一片白色,具体原因不知。
如上面的代码,如果把map的初始化放到 draw方法里,就能正常显示。
@cping 大神到底会不会看这里的信息啊!!
The text was updated successfully, but these errors were encountered: