java - Assets behaviour in multiplatform libGDX application -


what best practice store resources in libgdx library. i'm know can use assetmanager , e.g. can link resources android folder ios, dont know how behaviour on multiplatform devices. resources scale according screen size/operating system, or need manually set diffrent size or resulution in each platform resource folder.i want avoid ovelaying or stretch behaviour.

there many ways go , there no "best" solution. if build android use android assets folder. default , used other builds (due default libgdx project configurations).

the resources scale if tell them too. can choose use viewport (a fit/fill viewport not stretch can add black/background bars not have default aspect ratio). can choose implement screen dependency using aspect ratio , scale.

for instance:

a 1080x1920 mobile phone vs 1440x1920 tablet if use fit viewport have unused space on tablet. if use fillviewport might lose stuff on phone. if take phone default aspect ratio , calculate width offset tablet (1440-1080/2) can use value choose put actors/sprites on same location on prone (by using offset) or relative screen edge (by using screen size). use place ui relative screen , game same on phone. can choose use different layout depending on aspect ratio.

do note in way have calculate global scale , use everywhere in application. can tedious implement gives more control!

so if have simple game , don't care tablets or different screen sizes suggest start fit viewport.

p.s. not sure mean "multiplatform devices", said, default libgdx setup heavy lifting here, suggest use it!


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -