Hey Folks,
Loving 2dToolkit so far - the platforms lean and the tools are really powerful.
Wanted a bit of guidance on how to setup our scenes appropriately to scale.
- We're trying to build a 2D landscape only game targeting all Major iOS (Post Iphone 3) and Android Phones and Tablets.
- We're looking to crop the scene using the jetpack joyride style of scene composition. Essentially hud is anchored to appropriate parts of the screen and the gameboard is cropped, with some gameplay elements anchored or centered.
http://ma.ne.ro/2012/09/05/dealing-with-multiple-resolutions-in-mobile-games/- Right now our scenes are being constructed (both art and code) in native resolution 1280x768. This allows us to hit Ipad 1, 2, Iphone 4-5 and galaxy phones. For retina, we're doing a 2x scale up of our assets by detecting and dropping the screen resolution on app initialization. Attached is a bit of a guide on what we're doing. Retina is a 2x forced scale up of the orange square. We do this by dropping the resolution (which means 2D Toolkit views it like an Ipad 1/2 effectively).
- We're using a Tk2dCamera with native resolution 1280x768 and a single wildcard override with Autoscale None, Fitmode Center and a few sprite collections (some with Mips enabled)
- Gameplay elements laid out by code are placed using a mixture of absolute pixel coordinates and absolute pixel coordinates offset by screen size.
- HUD is laid out using the Tk2DUIAnchoring system and is appropriately anchoring the hud based on screen size
The issue we're trying to solve now is the 2x scale up on retina isn't high quality enough. The graphics are pretty blurry, and we're not too happy with it. We'd like to support textures in this resolution natively, and it seems like tk2d can support this with the sprite collection and camera overrides - but I can't quite figure out the right combination of settings.
Ideally what I'd be looking for is
- Gameplay scenes continue to be constructed using 1280x768.
- App init tells tk2dSystem which "platform" to use (1x or 2x)
- Higher resolution sprites are swapped with 1:1 scale when they're available, and use a 2x scale when an appropriate sprite isn't available.
However - what I'm seeing is
- Unity coordinates are 1:1 with screen coordinates (i.e. pixel perfect) in the retina display. This is not shocking I think given that we're attempting to use the Jetpack style of scene composition to enable multiple ARs. Do I need to setup a camera override to enable coordinate scaling? If so - how can I scale the appropriate 3:2 part of the scene? In the attached example, I'd want to scale JUST the 3:2 range.
- Tk2DSystem won't take an existing 1x scale asset and scale it when the platform is set to 2x and no 2x asset is available. Though I suspect this might just be an artifact of how I've got my camera configured.