Is there a proper way to scale actors on the Stage?(Libgdx)What's the simplest way to print a Java array?Proper use cases for Android UserManager.isUserAGoat()?Scaling displays with libgdxsupport screen sizes libgdx - androidLibgdx Hud with two stagesLibgdx How to set viewport position?Drawing Big Smooth Text with libGDXLibgdx — scene2d actors scalingproblems with multiple cameras and viewports in libgdxLibGDX Texture quality for different devices

Architectural feasibility of a tiered circular stone keep

Prove your innocence

Average period of peer review process

Cross-referencing enumerate item

Using `With[...]` with a list specification as a variable

What is wrong about this application of Kirchhoffs Current Law?

Efficiently pathfinding many flocking enemies around obstacles

Does a face-down creature with morph retain its damage when it is turned face up?

In the MCU, why does Mjölnir retain its enchantments after Ragnarok?

Why is my Earth simulation slower than the reality?

What to say to a student who has failed?

How would one country purchase another?

Fried gnocchi with spinach, bacon, cream sauce in a single pan

What is the best option for High availability on a data warehouse?

Singleton Design Pattern implementation in a not traditional way

Slitherlink Fillomino hybrid

Numbers Decrease while Letters Increase

Justifying the use of directed energy weapons

Avoiding racist tropes in fantasy

Which note goes on which side of the stem?

Why did MS-DOS applications built using Turbo Pascal fail to start with a division by zero error on faster systems?

What is the hex versus octal timeline?

Science fiction short story where aliens contact a drunk about Earth's impending destruction

See details of old sessions



Is there a proper way to scale actors on the Stage?(Libgdx)


What's the simplest way to print a Java array?Proper use cases for Android UserManager.isUserAGoat()?Scaling displays with libgdxsupport screen sizes libgdx - androidLibgdx Hud with two stagesLibgdx How to set viewport position?Drawing Big Smooth Text with libGDXLibgdx — scene2d actors scalingproblems with multiple cameras and viewports in libgdxLibGDX Texture quality for different devices






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm making an android app which has Libgdx Stage handling the HUD. But how can I scale things I add to Stage?



I've tried some manipulations with Camera, Viewport, and none of the work properly. Let's say I want my ImageButton placed in the right top corner of the screen. I managed to do that manipulating with table positioning, it seems to be fine. But the problem appear when I run my app on my phone. The ImageButton positioned right but it's kinda small :-)



Thing is I want ImageButton look like on (540,800) resolution screen.
ImageButton is (65,65).
When it comes to bigger screensizes ImageButton starts to look small because it does not scale(or the viewport and camera stuff dont work well, I dont think the actual scaling is truly necessary)










share|improve this question
























  • To scale your HUD or everything else for different Screen sizes you need to use Viewports.

    – Morchul
    Mar 28 at 7:46

















1















I'm making an android app which has Libgdx Stage handling the HUD. But how can I scale things I add to Stage?



I've tried some manipulations with Camera, Viewport, and none of the work properly. Let's say I want my ImageButton placed in the right top corner of the screen. I managed to do that manipulating with table positioning, it seems to be fine. But the problem appear when I run my app on my phone. The ImageButton positioned right but it's kinda small :-)



Thing is I want ImageButton look like on (540,800) resolution screen.
ImageButton is (65,65).
When it comes to bigger screensizes ImageButton starts to look small because it does not scale(or the viewport and camera stuff dont work well, I dont think the actual scaling is truly necessary)










share|improve this question
























  • To scale your HUD or everything else for different Screen sizes you need to use Viewports.

    – Morchul
    Mar 28 at 7:46













1












1








1








I'm making an android app which has Libgdx Stage handling the HUD. But how can I scale things I add to Stage?



I've tried some manipulations with Camera, Viewport, and none of the work properly. Let's say I want my ImageButton placed in the right top corner of the screen. I managed to do that manipulating with table positioning, it seems to be fine. But the problem appear when I run my app on my phone. The ImageButton positioned right but it's kinda small :-)



Thing is I want ImageButton look like on (540,800) resolution screen.
ImageButton is (65,65).
When it comes to bigger screensizes ImageButton starts to look small because it does not scale(or the viewport and camera stuff dont work well, I dont think the actual scaling is truly necessary)










share|improve this question














I'm making an android app which has Libgdx Stage handling the HUD. But how can I scale things I add to Stage?



I've tried some manipulations with Camera, Viewport, and none of the work properly. Let's say I want my ImageButton placed in the right top corner of the screen. I managed to do that manipulating with table positioning, it seems to be fine. But the problem appear when I run my app on my phone. The ImageButton positioned right but it's kinda small :-)



Thing is I want ImageButton look like on (540,800) resolution screen.
ImageButton is (65,65).
When it comes to bigger screensizes ImageButton starts to look small because it does not scale(or the viewport and camera stuff dont work well, I dont think the actual scaling is truly necessary)







java libgdx screen resolution






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 16:27









Руслан ХасановРуслан Хасанов

61 bronze badge




61 bronze badge















  • To scale your HUD or everything else for different Screen sizes you need to use Viewports.

    – Morchul
    Mar 28 at 7:46

















  • To scale your HUD or everything else for different Screen sizes you need to use Viewports.

    – Morchul
    Mar 28 at 7:46
















To scale your HUD or everything else for different Screen sizes you need to use Viewports.

– Morchul
Mar 28 at 7:46





To scale your HUD or everything else for different Screen sizes you need to use Viewports.

– Morchul
Mar 28 at 7:46












1 Answer
1






active

oldest

votes


















0















I suggest you to check the documentation about Viewports, which is pretty clear, although a bit dated : https://github.com/libgdx/libgdx/wiki/Viewports



If you don't need to mess with the camera, don't bother to declare one. Simply use a stage, with includes automatically an orthographic camera. If you declare an Actor within the bounds of the viewport, it should scale properly depending on the type of viewport you selected. For instance :



FillViewport vp = new FillViewport(800, 1280); // fills the screen, adapting itself to actual screen ratio
Stage stage = new Stage(vp);





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382138%2fis-there-a-proper-way-to-scale-actors-on-the-stagelibgdx%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0















    I suggest you to check the documentation about Viewports, which is pretty clear, although a bit dated : https://github.com/libgdx/libgdx/wiki/Viewports



    If you don't need to mess with the camera, don't bother to declare one. Simply use a stage, with includes automatically an orthographic camera. If you declare an Actor within the bounds of the viewport, it should scale properly depending on the type of viewport you selected. For instance :



    FillViewport vp = new FillViewport(800, 1280); // fills the screen, adapting itself to actual screen ratio
    Stage stage = new Stage(vp);





    share|improve this answer





























      0















      I suggest you to check the documentation about Viewports, which is pretty clear, although a bit dated : https://github.com/libgdx/libgdx/wiki/Viewports



      If you don't need to mess with the camera, don't bother to declare one. Simply use a stage, with includes automatically an orthographic camera. If you declare an Actor within the bounds of the viewport, it should scale properly depending on the type of viewport you selected. For instance :



      FillViewport vp = new FillViewport(800, 1280); // fills the screen, adapting itself to actual screen ratio
      Stage stage = new Stage(vp);





      share|improve this answer



























        0














        0










        0









        I suggest you to check the documentation about Viewports, which is pretty clear, although a bit dated : https://github.com/libgdx/libgdx/wiki/Viewports



        If you don't need to mess with the camera, don't bother to declare one. Simply use a stage, with includes automatically an orthographic camera. If you declare an Actor within the bounds of the viewport, it should scale properly depending on the type of viewport you selected. For instance :



        FillViewport vp = new FillViewport(800, 1280); // fills the screen, adapting itself to actual screen ratio
        Stage stage = new Stage(vp);





        share|improve this answer













        I suggest you to check the documentation about Viewports, which is pretty clear, although a bit dated : https://github.com/libgdx/libgdx/wiki/Viewports



        If you don't need to mess with the camera, don't bother to declare one. Simply use a stage, with includes automatically an orthographic camera. If you declare an Actor within the bounds of the viewport, it should scale properly depending on the type of viewport you selected. For instance :



        FillViewport vp = new FillViewport(800, 1280); // fills the screen, adapting itself to actual screen ratio
        Stage stage = new Stage(vp);






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 2 at 8:43









        XanderXander

        819 bronze badges




        819 bronze badges



















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382138%2fis-there-a-proper-way-to-scale-actors-on-the-stagelibgdx%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript