Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Finnegan

Pages: [1]
Support / Moving sprite collections to a different project
« on: November 03, 2014, 11:22:36 pm »
I'd like to migrate my menu system to another game, preserving all the sprites on the scene and their respective sprite collections.

Is it possible?

Thank you!

Support / Unload atlases by temporary removing references from sprites
« on: August 22, 2014, 01:54:29 pm »
We have memory pressure problems on some iOS devices. Many collections have been optimized already, but the inability to unload atlases without destroying sprites keeps us from effective memory management.

I got an idea about this kind of hack:
* use "Loadable Asset" in collection settings
* add vars "originalSpriteName" and "originalCollectionName" to tk2dBaseSprite
* cache current name and collection to them
* switch the sprite to some tiny placeholder sprite from tiny collection
* references to the original atlas are gone now
* Resources.UnloadUnusedAssets();
* reload original collection and sprites on demand with tk2dSystem.LoadResourceByName<tk2dSpriteCollectionData>(collName) and SetSprite

Will it work? Thanks.

Support / "Fatal Error! Could not allocate memory" during building
« on: July 16, 2014, 05:53:50 pm »
Project size is about 2.7GB (but only 200mb compiled to iOS .ipa file). All worked fine until recent addition of one more 4096x4096 texture for Retina.

Any workarounds? I don't know how to manage it besides removing HD assets from build or waiting for 64bit Unity.

Support / Disable input globally
« on: May 23, 2014, 04:45:15 pm »
I would like to have a flag for disabling all input for tk2dUIItems.

Should I just return from Press, UpdateTouch and Release when this flag is on? Or it can be done more effectively/safe?

Support / Clarifying different devices and resolutions support
« on: June 09, 2013, 11:50:58 am »
Sorry for another-one-resolution-thread, but I'm still confused after reading previous ones.

I'm migrating from cocos2d-iPhone where I used 3 sets of sprite atlases:
  • 1x: old iPhones 480x320
  • 2x: iPhones w/ retina 960x640, iPhone 5 1136x640, old iPads 1024x768
  • 4x: iPads w/ retina 2048x1536

Cocos2d has "points": one point equals 1 pixel on an old non-retina screen and 2 points on a new retina screen. So, iPhone/iPod touch screen size is always 480x320 points (568x320 for iPhone 5) and iPad screen size is 1024x768 point, regardless of DPI. All assets for iOS games were made 4x for iPad retina (with common divisor 8 to have accurate scaling) to and then scaled down with TexturePacker to 1x and 2x sprite atlases.

But for cross-platform development I have to deal with all these resolutions plus some less popular (and sometimes unpredictable for Android).

I'm using tk2dCamera that scales content according to the resolution and Multiplatform Toolkit that positions and scales content by looking at the aspect ratio or platform. I'm not stretching sprites in games, but show larger pieces of the game world (when it's scrollable) or make some sort of letterbox (additional parts of background, more spacious GUI, etc.).

And I can't understand how to do the following things right.

Atlases for different DPIs
2d Toolkit has platform specific sprite collections and as far as I understand it is the same idea as I described above for cocos2d. But another method with mipmaps and changing quality settings is described in this thread.
I'd like to use the latter method for smaller game file size. But will resizing textures on the fly significally increase loading time of every scene? Is Unity capable of quality downscaling of 2d art? (not pixel art)

Scaling down on the fly
Since I can't include sprites for every possible resolution, most of the time they will be scaled down (e.g: 4x sprites made for 2048x1536 will be scaled to 1600x1200 or 1920x1080). If I'm getting it right, all I need is a right setting for each resolution in tk2dCamera.

Relative positioning
It's simple for GUI with Multiplatform Toolkit, but I can't understand how to move dynamic objects in different DPIs and ratios.
Is tk2dCamera always counting 1 pixel for 1 Unity point and do I need to calculate positions and movement relating to DPI (multiply them by 1x-2x-4x)? Is scaled down content (by tk2dCamera, like from 2048x1536 to 1600x1200) not affecting pixel-to-points, but only physical size on the screen?

upd: the answer from this thread is "no, 1x, 2x, 4x sprites will all be physically exactly the same size, so distances will still be the same".
As far as I understand, I should work with points in 1x size and then despite 2x or 4x or other custom multiplier, my sprites always will use 1x point system. So I need to set up GUI and game world visibility for the lowest resolutions for all aspect ratios and then tk2dCamera will help me to scale it up using bigger sprites.

Pages: [1]