我有一個新的遊戲工作,我已創建2攝像頭一個攝像頭,現實世界與另一個(GUI)相機的靜態分辨率(800×480)較受歡迎的視口處理TEXT按鈕libgdx
private void init() {
camera = new OrthographicCamera(16,9);
camera.position.set(0, 0, 0);
camera.update();
cameraGUI = new OrthographicCamera(800,480);
cameraGUI.position.set(0, 0, 0);
cameraGUI.update();
而且我想在遊戲中使用TEXT按鈕,所以我創建一個使用新的fitViewPort
fitViewPort=new FitViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
gameController.stage=new Stage(fitViewPort);
然後我創建一個使用我的位圖字體我textButtons和我嘗試它在桌面上一個新的階段,它的偉大 desktop
,但是當我嘗試另一種裝置,該位置是不一樣的 Tablet
然後我想使用cameraGui寬度和高度我認爲端口,字體是非常糟糕的拉伸
任何幫助,請:(
有很多情況下,GUI的單獨的攝像頭和視口是適當的。 – Tenfour04
感謝這個答案,但這並不能解決我的問題,字體仍然很難看 – Ammar
我編輯了答案。現在它包含一種使字體縮放看起來更好的方法。 – pr0gramist