Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Handling image/screen scalling
Started by llordglassenward87 Oct 12 2018 07:08 AM

3 replies to this topic
scalling config.lua resolution
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

llordglassenward87

[GLOBAL: userInfoPane.html]
llordglassenward87
  • Observer

  • 17 posts
  • Corona SDK

Hi,
so I am having some trouble with config.lua - scalling. I've tried various different configuration options, but it still doesn't work as I would like it to be working.
 
Okay but first things first: so let's say I put an image (e.g. simplest white rectangle) somewhere around the screen corner at specific coordinates (whilist viewing it as particular mobile on corona simulator). 
 
All I need about my scalling's work is that, that this image, when we set on different screen resolution, will stay in exactly same position that equals its original position, having same proportions, but enlarged etc. appriopriately according to currently set screen resolution.
 
In short: Image on every device would sport on the same 'acocommodation' as it's on the device I'm working with.
 
Hope you understood me, thanks for all hep!
 


[TOPIC: post.html]
#2

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,628 posts
  • Corona SDK

This explains it quite well.

 

http://www.sdknews.com/cross-platform/corona/understanding-content-scaling-in-corona



[TOPIC: post.html]
#3

llordglassenward87

[GLOBAL: userInfoPane.html]
llordglassenward87
  • Observer

  • 17 posts
  • Corona SDK

Oh, thanks for reply, improved my content scaling a little, but I'm still having one issue: I have these tile like images that create some pattern on screen. All of these tiles are set one next to one, within tiniest possible visible space inbetween them (used decimals to describe x and y pos). Basically I'm creating piano keyboard, therefore, for this project it is very, very important if on all sized devices things would stay exactly in the same place. And on some smaller screen resolutions they do keep fitting in their exact positions. But on larger screen resolutions these spaces inbetween get weirdly irregular, some of them are 2, 3 times bigger or smaller, basically keyboard layout goes mess. Again, how do I overcome that - any advices on simple yet good and stable working config.lua? How should the file look for this project? 
 
Thanks


[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,363 posts
  • Corona SDK

One solution is to ensure your config.lua enforces a pixel perfect scaling algorithm.  This way you won't have any sub-pixel scaling going on.

 

https://github.com/Lerg/smartpixel-config-lua


  • dodi_games likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: scalling, config.lua, resolution