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.


Messages - chirhotec

Pages: [1]
1
NGUI 3 Support / Re: Resize keeping aspect ratio with handles
« on: December 18, 2013, 12:01:00 AM »
Ah, now I get it. I don't have an answer, but I agree it would be a nice feature.

2
NGUI 3 Support / Atlas issues, Image artifacts on truecolor sprites for iOS
« on: December 17, 2013, 11:54:54 PM »
I'm working with Unity 4.3 and NGUI v3.0.3f3, on a GUI-centric social game for iOS, and am suddenly running into a lot of issues with Atlases and Sprites. I'm putting these issues in one thread because I'm not sure if they're related.

Atlas Generation:

First, I'm getting an issue where Atlas Maker isn't generating the Atlases properly. I select the sprites (about 45 of them), give it a name and hit "Create". It seems to run, and generates the GameObject, Material and the atlas image file (1024x512). However, when viewing the object in the Atlas Maker its not showing any of the sprites in the list. If I press the available "View Sprites" button, it opens an empty "Select a Sprite" window.

Now, if I reselect the desired sprites, they'll show up again in the Atlas Maker with the green "Add" text lit up. Hitting "Replace" starts to process; however, the "Updating" dialog hangs (at 100% with the text "Updating the atlas, please wait..."), and I have to manually kill Unity (though the OSX 'Force Quit Applications' doesn't show Unity as unresponsive, I can't really do anything or access any of the menus). The console shows an error, which I've included an image of as "Replace_Atlas_Error.png" (sorry for the image, I would have Copy/Pasted, but Unity wouldn't let me copy it at that point)

I am able to create the Atlas if I include less sprites at a time (I think it crapped out around ~20 for the initial atlas creation).

Sprite Artifacts

Moving on, lets say I create some Atlases with just a few images. When they are generated, for some reason Unity is automatically applying "Override for iPhone" on the atlas image settings, with the Format set to "16 bits". That of course looks horrible (http://www.tasharen.com/forum/index.php?topic=1497.0). However, if I change the Format to Truecolor or disable the iPhone override, the resulting sprites all have really horribly image artifacts on them.

I've attached an image (Texture_Sprite_Atlas_Compare.png) showing the crisp looking graphic rendered with a UITexture, what it looks like when the Atlas is first generated (set to 16bits), and what it looks like when I set it back to Truecolor.

A few more interesting things I just noticed that may be of help:
- The Unity Inspector's image preview of the .png shows the same artifacts, even though the .png itself doesn't have any artifacts.
- The Unity Inspector's image preview of the UISprite shows a proper looking image


Texture -> Sprite Automatically being replaced

Doing these tests led me to find another issue. During the test I had the UITexture object that displayed the reference "2" image. When I generated an Atlas that included the 2, the UITexture was automatically replaced with a UISprite (not what I was wanting, but I could see that being a feature). Problem is, the Sprite didn't actually show up, despite the Atlas and Sprite objects being set in the inspector. I've attached another image, in case it helps (Texture_To_Sprite_Autoreplace.png)


Sorry for the lengthy post, but if anyone has any suggestions I'd really appreciate it!

3
NGUI 3 Support / Re: Resize keeping aspect ratio with handles
« on: December 17, 2013, 09:49:35 PM »
Prior to 3.0.7 you use UIStretch to accomplish this. Although they're deprecated, there should be some older videos floating around out there that describe how to set these up, and you can check out their pages in the documentation subforum.

(does anyone have any reasons these shouldn't be used if you need to keep the aspect ratio? I know they shouldn't be used with the new anchoring system)

In 3.0.7 the anchoring system was replaced, which replaced UIAnchor and UIStretch. Unfortunately, the corresponding features that kept aspect ratio in tact were not (yet) implemented. See http://www.tasharen.com/forum/index.php?topic=7092.msg33495#msg33495

4
NGUI 3 Documentation / Re: Tweens
« on: December 12, 2013, 11:57:44 PM »
I just downloaded the newest version of NGUI, Playmaker the NGUI-Playmaker bridge (https://hutonggames.fogbugz.com/?W1111). The bridge is only set to support 3.0.5, but I thought I'd give it a try and see if it works.

The only problem that I see so far, is that the UITweener Reset function is set to private (by access modifier omission) in one of the latest versions, and the NGUI-Playmaker bridge makes calls to it externally. According to the UITweener documentation, this function is listed under Public Member Functions (http://tasharen.com/ngui/docs/class_u_i_tweener.html#a79fb68d0ae50721d7fe351d8725bbb01). Any reasons not to make it public?

5
NGUI 3 Support / Re: Is there a new alternative for "Fill Keeping Ratio?
« on: December 12, 2013, 12:45:31 AM »
+1 for the topic. I need to do a couple things that I think are along the same line:

1) I need to have a background, anchored to the bottom of the screen, where the image is scaled depending on the screen resolution, but the image aspect ratio needs to be preserved. If the width is too large for the image, the top of the image would get cut off screen. If the height is too large for the image, then then it would crop from the sides of the image.

2) I have a header bar that should take up the top 5 of the screen (that's easy enough with the new anchoring system). Then I need the logo inside of the title bar, which should be scaled to fit within the header bar, but not skew the image and mess up the logo.

Anyone have any ideas on how to do this with the new anchoring system?

Pages: [1]