我試圖爲我的遊戲代碼一個HUD,但我無法弄清楚如何縮放標籤正確,我用這個代碼:如何調整一個標籤在LibGdx
Label hpLabel = new Label("HP: ",new Label.LabelStyle(new BitmapFont(),Color.BROWN));
table.add(hpLabel);
viewport = new FitViewport(Gdx.graphics.getWidth()/ FacultyWars.PPM, Gdx.graphics.getHeight()/ FacultyWars.PPM, cam);
stage = new Stage(viewport, batch);
stage.addActor(table);
//other ellements added after this
惠普標籤是巨大的屏幕上。我嘗試在標籤和桌子上使用setScale無濟於事。任何幫助表示讚賞! 由於
這裏是當前屏幕https://gyazo.com/57c190a9d7516bb8b2256bf1a7d17b4c
的可能的複製[添加Actions.scaleTo()來在LibGDX一個標籤(http://stackoverflow.com/questions/42404452/add-actions- scaleto-a-label-in-libgdx) – Tenfour04
答案似乎並不適用於我,即使問題類似。 –
你能澄清「似乎沒有工作」?否則難以幫助。 – Tenfour04