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;
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
add a comment |
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
To scale your HUD or everything else for different Screen sizes you need to use Viewports.
– Morchul
Mar 28 at 7:46
add a comment |
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
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
java libgdx screen resolution
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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);
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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);
add a comment |
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);
add a comment |
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);
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);
answered Apr 2 at 8:43
XanderXander
819 bronze badges
819 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
To scale your HUD or everything else for different Screen sizes you need to use Viewports.
– Morchul
Mar 28 at 7:46