<bdo id='6SbfF'></bdo><ul id='6SbfF'></ul>
    1. <tfoot id='6SbfF'></tfoot>
    2. <legend id='6SbfF'><style id='6SbfF'><dir id='6SbfF'><q id='6SbfF'></q></dir></style></legend>

      <i id='6SbfF'><tr id='6SbfF'><dt id='6SbfF'><q id='6SbfF'><span id='6SbfF'><b id='6SbfF'><form id='6SbfF'><ins id='6SbfF'></ins><ul id='6SbfF'></ul><sub id='6SbfF'></sub></form><legend id='6SbfF'></legend><bdo id='6SbfF'><pre id='6SbfF'><center id='6SbfF'></center></pre></bdo></b><th id='6SbfF'></th></span></q></dt></tr></i><div id='6SbfF'><tfoot id='6SbfF'></tfoot><dl id='6SbfF'><fieldset id='6SbfF'></fieldset></dl></div>
    3. <small id='6SbfF'></small><noframes id='6SbfF'>

      1. 如何在 LibGdx 中缩放标签

        时间:2023-05-20
      2. <small id='6E9Wu'></small><noframes id='6E9Wu'>

        1. <i id='6E9Wu'><tr id='6E9Wu'><dt id='6E9Wu'><q id='6E9Wu'><span id='6E9Wu'><b id='6E9Wu'><form id='6E9Wu'><ins id='6E9Wu'></ins><ul id='6E9Wu'></ul><sub id='6E9Wu'></sub></form><legend id='6E9Wu'></legend><bdo id='6E9Wu'><pre id='6E9Wu'><center id='6E9Wu'></center></pre></bdo></b><th id='6E9Wu'></th></span></q></dt></tr></i><div id='6E9Wu'><tfoot id='6E9Wu'></tfoot><dl id='6E9Wu'><fieldset id='6E9Wu'></fieldset></dl></div>

            <tfoot id='6E9Wu'></tfoot>

            • <bdo id='6E9Wu'></bdo><ul id='6E9Wu'></ul>
                <tbody id='6E9Wu'></tbody>
                <legend id='6E9Wu'><style id='6E9Wu'><dir id='6E9Wu'><q id='6E9Wu'></q></dir></style></legend>

                  本文介绍了如何在 LibGdx 中缩放标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试为我的游戏编写 HUD,但我不知道如何正确缩放标签我正在使用此代码:

                  i am trying to code a HUD for my game but i cannot figure out how to scale a Label properly I am using this code:

                  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 
                  

                  HP 标签在屏幕上很大.我尝试在标签和桌子上使用 setScale 无济于事.任何帮助表示赞赏!谢谢

                  The HP tag is enormous on the screen. I tried using setScale on the label and on the table to no avail. Any help is appreciated! Thanks

                  这是当前屏幕的图片https://gyazo.com/57c190a9d7516bb8b2256bf1a7d17b4c

                  推荐答案

                  只需将标签添加到组,然后将比例应用于组.

                  Simply add the Label to a Group then apply the scale to the group.

                      Label label = new Label("hello", skin);
                      Group group = new Group();
                      group.addActor(label);
                      group.setScale(2f, 2f);
                  

                  我只在动画中缩放带有标签的组,在动画结束时缩放为 1.不应缩放字体,因为它看起来像素化.比如一个简单的放大缩小动画:

                  I only scale Groups with Labels in animations where at the end of the animation the scale is 1. One should not scale fonts, because it looks pixelated. For example, a simple scale up scale down animation:

                  group.addAction(Actions.sequence(Actions.scaleTo(2f, 2f, 1f), Actions.scaleTo(1f, 1f, 1f)));
                  

                  这篇关于如何在 LibGdx 中缩放标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:LibGDX 中 music.class 的 TweenAccessor 下一篇:将 libgdx 添​​加到 Android 原生应用程序

                  相关文章

                  最新文章

                    <bdo id='YEZoE'></bdo><ul id='YEZoE'></ul>

                  <tfoot id='YEZoE'></tfoot>
                  <legend id='YEZoE'><style id='YEZoE'><dir id='YEZoE'><q id='YEZoE'></q></dir></style></legend>
                  <i id='YEZoE'><tr id='YEZoE'><dt id='YEZoE'><q id='YEZoE'><span id='YEZoE'><b id='YEZoE'><form id='YEZoE'><ins id='YEZoE'></ins><ul id='YEZoE'></ul><sub id='YEZoE'></sub></form><legend id='YEZoE'></legend><bdo id='YEZoE'><pre id='YEZoE'><center id='YEZoE'></center></pre></bdo></b><th id='YEZoE'></th></span></q></dt></tr></i><div id='YEZoE'><tfoot id='YEZoE'></tfoot><dl id='YEZoE'><fieldset id='YEZoE'></fieldset></dl></div>

                    <small id='YEZoE'></small><noframes id='YEZoE'>