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 - blitzer

Pages: [1] 2
NGUI 3 Support / Another 'Shader wants normals' Question
« on: May 26, 2016, 08:21:43 AM »
Going off what I've seen before, here is some info up front:

-I've checked and re-checked and all UI in the scene comes from Atlases that use a "Unlit/Transparent Colored" shader. There is no real lighting in the scene, just a lightmap. The warnings also only show up when I've got a UIPanel Inspector window open in the editor.

-I've turned off almost everything in my UI except for one UISprite box collider than when clicked on shows a single Simple type UISprite, and I still get the warning....I don't know what else to do at this point other than just enable normals for the UIPanel, but I'd like to know why this is actually happening.

Hello everyone, I'm working on making a "looping scroll" background that scrolls and eventually loops back to the first image, which is straight forward enough. However, I'm coming across a problem where, when moving the widgets, the edges of the widgets shake/jitter a bit as they move across the screen.

I made a quick video that hopefully shows this clearly enough:

Obviously, the rotated sprite has aliasing issues, and I'm guessing that even the "aligned" sprites issue is still from aliasing? I guess I've just never noticed it happen on "aligned" textures before, just looking for someone to confirm or deny that conclusion.

Any ideas appreciated, thank you for reading.

NGUI 3 Support / Question on Anchor Setups vs. Screen Ratios Scaling Issue
« on: February 05, 2015, 05:37:03 AM »
Hello everyone, I'm having some trouble understanding why in my case, two different elements with the same type of Anchor setup are being adjusted dramatically differently (see below).

In Detail:
I'm working with a Constrained UI Root set to 960x640 with both "Fit" boxes set to false. I've got 2 elements (To Battle, and Options) that use the same style of anchoring to anchor them to an element that encompasses the viewable screen. What I'm seeing when a change to a different screen setup (in this case from a iphone screen to an ipad screen), the To Battle element behaves as expected, but the Options element becomes very small, and I can't figure out why.

The Images:
Before and After simply show how the screen is setup, then what it looks like after the screen switch has been made (notice To Battle slightly adjusting as expected, but Options becoming very small even though it anchors itself as To Battle does).

Additionally, I'm noticing that it seems NGUI needs "some time" to adjust the elements (updating after "Play" is pressed after changing screen size/ratio. What I'm seeing this that after Play is stopped, some elements seem to move back towards where they started, and I have to press Play 3 or 4 times to get the elements to stay in their proper new position. If there is anything I can do to avoid this, please let me know.

As always, any ideas are appreciated, thank you for reading.

NGUI 3 Support / Trouble with TweenAlpha Duration Parameter
« on: January 26, 2015, 11:42:10 PM »
Hello everyone, I'm having an issue with using TweenAlpha.Begin(), where the Duration parameter does not seem to apply correctly.

What I'm doing in code:
  1. TweenAlpha.Begin(playerUIControlParent.gameObject, fadePlayerUIControls, 0f);

Description of Issue:
Pretty simple, I have a UI Widget that starts with a alpha of 1, and should fade to 0 over time. The problem is that this "transition" happens almost instantly (a few frames) even when the Duration is multiple seconds. I've tried changing the type of "Play Style" from "Once" to "Ping Pong" / "Loop" and everything seems fine as far as the duration is concerned, but as soon as I try it with "Once" again, it happens more/less instantly again.

Any ideas on what I'm doing wrong is appreciated, thank you for reading.

It seems the issue was related to pausing the editor before the TweenAlpha script was finished running (in this case I was Breaking() one line after TweenAlpha.Begin() was called). As helped to be confirmed by r.pedra, Tween calculates time while the Editor is paused if Ignore timescale is checked. Once the Break() was removed, TweenAlpha's time duration worked correctly.

NGUI 3 Support / Question on "Flexible" vs "Constrained" UI Root Types
« on: December 23, 2014, 07:29:19 AM »
Hello everyone, I'm sorry I even need to ask this, but I'm just not getting it:

I've always thought that I understood "Flexible" vs "Constrained" UI Root Types. Flexible makes Widgets stay the same size in pixels regardless of resolution (so a 100x100 widget would be relatively large on a screen of say 480x320 and quite small on say 2048 x 1536, while Constrained makes the Widget into a % of the screen based on parameters, so the Widget will occupy the same screen space at both example resolutions.

However, I was trying out Flexible today and noticed that no matter what I did, a 100x100 Widget seemed identical on low resolution screens as high resolution screens inside the editor. I thought that perhaps my physical monitor resolution was perhaps obscuring my results, so I tried the lowest resolution I had and the widget actually got smaller....what? I also tried changing the window size in the Editor, same results.  So I guess I don't understand Flexible at all, seeing as the widget remained the same size regardless of screen resolution differential.

Any clarification is appreciated.

Hello everyone, I've got a "General Process Question" (which I don't expect a "complete answer" for) but perhaps just some guidance on my approach:

In the past, when dealing with mobile devices of different physical size (like a iPhone vs an iPad), I've made different UI setups that each had different sizes of UI elements to account for the physical size of the devices (so for example you wouldn't want a button size for an iPhone to maintain its scale on an iPad since the button would be huge since the iPad is just physically much larger).

This setup will work in the end, but when you need to make a change, you then get stuck making it over and over again for each UI setup. So I have been trying out a programmatic approach where I adjust the anchor size and widget size of the elements based on the device being used to adjust the size of each button (so when it ends up on the device, it is appropriately sized).

It also seems to work, but I'm worried about making a script / scripts that cover all my UI elements (some elements may need scaling, or not, or elements may need different scaling, etc...). So I'm wondering if anyone has either tried this type of approach before, or has something better.

Any thoughts are appreciated, thank you for reading.

Hello everyone, I was wondering if anyone has done or has heard of a way to "scale" / account for UI element size on devices of different physical sizes (not resolutions).

Example: Imagine that an iPhone and iPad had the same screen resolution, even though the amount of screen space the UI elements take up is identical, the buttons on the iPad are much larger in the real world, to the point of being difficult to use (this also goes for the space between elements).

What I've done in the past:
- I just went back and re-did all the UI setups making the elements "X" percentage smaller, so that when they got on the larger physical devices (iPads), the buttons weren't too big.

So, is there a faster / smarter way of doing this re-sizing without re-building all the UI elements over again? Any ideas are appreciated.

Hello everyone, I'm looking for some general guidance on creating a specific sort of UI element behavior with NGUI:

In Detail:
Essentially, I've got a target reticle that normally stays in a set position on the player's screen. When the camera moves, the reticle moves along with it (well really, it stays in place because its using NGUI and its being overlayed). But, I'm trying to make a system where the player can "unlock" the target reticle from the camera view, essentially allowing the player to rotate the camera freely and have the target reticle "remain where it was" until the player "locks" the camera back to the reticle.

I was wondering if anyone has done something like this before, or what approach you would take (2d ui? 3d ui? heirarchy setups, etc). I'm not looking for full code, just a good way to approach the issue. I've though about ways of just "moving it offscreen" but those seem clunky, I've also though about making the reticle invisible when the player wants to free-move the camera which is simple, but not quite what I'm going for.

Any ideas are appreciated. Thank you for reading.

NGUI 3 Support / Question on Scrambled Text
« on: May 23, 2014, 03:52:33 AM »
Hello everyone, I'm having a strange problem with some label text seemingly being randomly scrambled (see pic). I would like to note that I have seen a few threads that deal with this type of issue, though the tend to be fairly old and usually end with either NGUI having fixed it with a new version, or Unity fixing it in a new version.

The problem:
For some reason, text may not appear at all, may appear scrambled, or may flash on and off (and be scrambled). I have never seen it happen in editor or on a iOS device (though I haven't done THAT much testing on actual devices). The problem does however seem to happen every time on PC and MAC builds.

In the picture, all 4 labels use the same font, share the same settings, and the font is a .ttf, and I am using version 3.5.7. If anyone knows how to fix it or a workaround I would be grateful to know about it.

NGUI 3 Support / Question on IOS Draggable Panel Optimization
« on: May 18, 2014, 05:30:18 AM »
Hello everyone, I tested out my ngui setup for a draggable panel today, and got some some pretty sub-par results. I'm sure the problem is me (not knowing what to look for), and was wondering if I could get some feedback on what is causing the performance problems. Below, is a readout of stats from the game (while it was in Unity and XCode) as well as a screenshot so you can get an idea of what I'm going for:

- This is on a iPhone 4
- all atlases and atlas materials are unlit/transparent colored and no larger than 2048x2048
- when switching to this screen on the iPhone, I can actually see these images being loaded in according to their depth (so background, then image, then image frames, etc).

Xcode general stats:   cpu   memory   fps         
                          23%   28.4mb   22         
xcode opengl es stats:   utilization (tiler)   utilization (renderer)      frametime (cpu)   frame time (GPU)   
                               3%                100%                        7.5ms                45ms   
unity internal profiler stats:   cpu player   cpu ogles-drv   cpu-present   cpu-waits-gpu   frametime   update
                                      6.31              0.9                  37.6                  37.6                 45       3.2
unity editor stats:   draw calls   used textures   Vram                   VBO total      
                               10              4-46mb              1.9 to 46.6mb   23-106KB      

Any ideas are appreciated.

NGUI 3 Support / Question on Unwanted Fade Out at Edge of Texture
« on: April 30, 2014, 03:41:39 PM »
I've noticed that on a solid white 64x64 image, the image begins to fade out before it reaches the edge of its own border. Of course changing the filtering can solve this issue, but changing the filtering of a individual texture seems to do nothing, and changing the atlas filtering mode can have undesired consequences to other textures.

So I had these questions:
-For cases like this, is it  a good practice just to make separate atlases with different filtering modes?
-Are individual texture's filtering mode (and other settings) overridden by the atlas settings (I would think so but just to be sure)?

Any clarification is appreciated.

NGUI 3 Support / Odd Problem with Anchors
« on: April 26, 2014, 10:25:47 PM »
Hello everyone, I've been seeing a very odd issue related to anchors and element positioning which I've never seen before. Basically, I've been having a problem trying to keep elements with anchors aligned in a certain position.
Notice in the picture "centered", that the 2 hierarchies (containeringamemenu and containeringameui) are positioned in the center of the screen with anchor points assigned to them. See how in "NOTcentered", for some reason, the elements are now off center (yet all other elements on the screen have moved correctly). For some reason, these 2 hierarchies just will not behave the way I want them to. The part that confuses me, is that I have many other elements positioned using the exact same setup and work just fine, except for the elements in the pictures. So why do the offsets seem to only be absolute instead of relative like they are normally?

If anyone knows what I've done to make these elements not behave as expected, I would love to know.

NGUI 3 Support / Bizzare Display Problem in PC Stand Alone
« on: April 06, 2014, 01:16:11 AM »
Hello everyone, I've got a UI setup that (in the Editor anyway) scales and re-sizes perfectly with different screen sizes / aspect ratios at runtime. However, when running the game in PC Standalone mode, the display (specifically a screen that uses a UI ScrollView) changes dramatically, and I'm not sure why. See the attached images for exactly what I'm talking about.

If anyone has an idea of what is going on, I would really appreciate it.

NGUI 3 Support / Question on UI Center ON Child
« on: March 27, 2014, 04:53:50 PM »
I'm running into a problem with using UICenterOnChild, the script is causing the view to center on objects that are not in the center of the viewing area.

More details:
I've got 4 sprites in a grid (which is itself a child of a UIPanel with a UIScrollView attached) sorted and arranged from left to right, and sprites 1-3 take up the entire view-able space (with 1 on the left, 2 in the center, and 3 on the right). The sizing and arrangement of each element and the grid is handled by script in Awake(), and on its own works just fine. However, when trying to use UICenterOnChild, the script tries to focus the view seemingly half way between sprites 3 and 4, and then clicking on any sprite makes the view jump back to 2 (which is where it normally is without the script) after which everything works fine.

I've tried changing the UICenterOnChild script, enabling and disabling from different places in scripts, and a few other things but nothing changes this behavior. Does anyone know or have an idea as to what is going on?

As a work around, I just turned the Spring Panel power down to 0 in Awake() and reset its value in Start (). Not really a solution but it prevents the problem from happening.

NGUI 3 Support / Trouble with UIPanel Transform Position
« on: March 26, 2014, 11:12:33 PM »
Hello everyone, I'm encountering a problem where a UIPanel is showing a very strange transform location, and I cannot change it.

In my case, I'm using Alpha Clipping, and its showing:
offset: 8596, 0.33...
center: -7895, -0.33....
size: 898 x 375
Transform position: -674, 0,0

It is also parented to a larger container (all anchor points are +/- 0). As mentioned above, I cannot change this location (although I think it used to be at -300-ish (which was still wrong) and by using the inspector and dragging it, it jumped to -700 and is now stuck there. I have also tried changing the position through script (nothing happens), although after the scene is running, I can successfully change it to anything I want.

I'm stumped as to what to do, this panel is throwing off every object inside it and causing a mess. Any ideas are appreciated.

Pages: [1] 2