libgdx精灵突然无法渲染,具有自定义世界单位

时间:2016-11-30 08:28:05

标签: libgdx

我想使用自定义单位渲染卡片精灵。 $contact_data = json_encode(array( 'name' => 'Jimmy Jimmy', 'email' => 'jimmy@example.com', 'custom_fields' => [ // put all your custom fields here 'last_name' => 'Jimmy', 'life_cycle_status' => 'value' ] )); 宽度,like is done here
但是精灵没有渲染。这之前有用,但我想知道为什么现在不行。它只是呈现一个空白屏幕。

1 world unit = 1 card

Here is the texture atlas cardspack.atlas 这是一个link to the image of cardspack

2 个答案:

答案 0 :(得分:0)

显示您的卡片(0,0坐标),但它太小了:

float CARDWITH = 1f;//chosen as our world unit
float CARDHEIGHT = 108f / 76f;

如果你注释掉这一行:

//sprite.setSize(CARDWITH, CARDHEIGHT);//make 1 unit of our world equal to 1 card width.

然后你会看到它

答案 1 :(得分:0)

哦,傻傻的我,我没有在渲染中使用相机()所以单位没有生效

void render(){
batch.setprojectionmatrix(cam.combined);
..
}
相关问题