multi resolution assets

90 views
Skip to first unread message

ThunderXBlitZ

unread,
Nov 12, 2015, 4:44:44 AM11/12/15
to HaxeFlixel
Hi, a common question, but how do u display graphics for devices of different resolution?

My game runs at 960*540 which is my old android device dimensions, and scales up (*2.667) to my new android device (dimensions 2560,1440). 
I believe its a pretty common ratio for smartphones. Not so sure about tablets.

Im going with:
1) scale my screen while maintaining aspect ratio (haxeflixel ratio mode) while centering my screen, showing black bars on the sides (top bottom/ left right)

but i guess small graphics scaled up will be pretty bad so im considering loading sets of graphics assets (sd, hd, hdr etc)  

but since the graphics are rendered by haxeflixel at the predetermined zoom ratio, how do I load in my hdr graphics but without the zoom?
Googled alot but couldnt find a definite answer.

Many thanks!

SruloArt

unread,
Nov 12, 2015, 6:59:19 AM11/12/15
to HaxeFlixel
* Black bars are not required. All you have to do is to allow your game to show more info on its x-axis (maybe there's a default mode that does that, anyhow you can easily find one searching Github, maybe even here).  

* You load your graphics based on the device's resolution.

* For example, you can have 3 different texture atlases, one for each resolution range. Here you can deal with the zooming part.

* OpenFL's Capabilities holds a screenDPI property.

ThunderXBlitZ

unread,
Nov 12, 2015, 8:54:32 AM11/12/15
to HaxeFlixel
Sorry i dont understand.

Say i have a 100x100 graphic, 
Normally, using the 100x 100 graphic, on a higher resolution device (e.g. 4 times higher), HaxeFlixel will render the graphic at 4* zoom, resulting in a blurry 400x400 graphic.

I wish to load a 400x400 hd version, but without it being upscaled, in this example, to 1600*1600
Reply all
Reply to author
Forward
0 new messages