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

Pages: [1] 2 3
1
Other Packages / Re: Multi-Purpose Game Starter Kit
« on: July 24, 2015, 12:17:46 PM »
Got it - thank you!

2
Other Packages / Re: Multi-Purpose Game Starter Kit
« on: July 21, 2015, 04:00:27 PM »
I'll have a look into it, thanks.

I haven't checked the store so maybe you've updated it, if not any update?

This seems to be fairly common amongst many of my older assets (shaders not Unity 5.x compatible).

Thanks

3
Other Packages / Re: Multi-Purpose Game Starter Kit
« on: July 01, 2015, 03:38:12 PM »
Terrain shader breaks in Unity 5.1.1 (pink texture) with this error:
  1. Shader error in 'Tasharen/Terrain': Too many texture interpolators would be used for ForwardBase pass (11 out of max 10) at line 101 (on )

4
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 11, 2014, 07:03:56 AM »
"Take the button label text and send it to another UILabel in a different panel."? I'm not quite sure what you mean by that. Just assign one label using another's text? remoteLabel.text = yourLabel.text;
Yeah, sometimes I don't even know what I mean  ;D

I did understand the simple logic required (label1.text = label2.text) I was just having problems linking the UILabel into my prefab <- def a Unity thing, NOT NGUI!

I gave it a rest over the weekend, came in this morning and updated both TNet and NGUI(1). Then I dropped in a TargetManager script (which I'll need anyways) with a public SetTargetText method and updated the prefabs' button (using data bindings??) and it now works like a charm!

Thank you for your help with this  8)

(1) Following the simple 3-step process of course ;)

5
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 08, 2014, 04:44:51 PM »
YEAH!

Success - good lord it was like I couldn't speel N-gooey; for pete's sake!

So my dynamic list works just fine and my last issue is what seems like a super simple thing:
Quote
Take the button label text and send it to another UILabel in a different panel.

I've tried all sorts of ways and nothing "sticks" in my prefab.

Just looking for the easiest way to do this. I thought using OnClick() would work but again my target UILabel gets lost in my prefab <- don't know why :(

Some screen shots of the lists working!

6
NGUI 3 Support / [SOLVED] [Font Maker] Mac OS X 10.9.5
« on: August 08, 2014, 11:17:20 AM »
Got it - thanks!

7
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 08, 2014, 10:51:25 AM »
Okay, now I'm just going craaaaaazy!  :o

Here is my updated method (I just reversed the order; I reset the clipping offset and THEN reset the height)
  1.         void UpdateHeatSourceList () {
  2.                 // To make this completely dynamic, it should probably loop through any existing
  3.                 // children and remove them. We'll save that for later
  4.                 cellCount = 0;
  5.                 foreach (HeatSource _hs in HeatSource.mList) {
  6.                         if (_hs.CompareTag("Player")) continue; // we don't want the player included in the list
  7.  
  8.                         // Use .AddChild instead of manually adding, parenting, etc
  9.                         GameObject go = NGUITools.AddChild(_grid.gameObject,heatSourcePrefab);
  10.                         go.name = _hs.name;
  11.  
  12.                         cellCount++;
  13.                         mTargets.Add(go);
  14.                 }
  15.  
  16.                 // Recalculate the grid since we just added a bunch of objects
  17.                 _grid.Reposition();
  18.  
  19.                 // Calculate the new height of our scrollview and clamp it to a maximum
  20.                 float newHeight = Mathf.Clamp((cellCount * prefabHeight),0f,maxPanelHeight);
  21.                 Debug.Log("New Height: " + newHeight.ToString("F0") + " for " + cellCount.ToString() + " targets");
  22.  
  23.                 // Now first we reset the clipOffset
  24.                 // See calculation below
  25.                 float yOffset = (newHeight - prefabHeight) * 0.5f;
  26.                 scrollPanelView.clipOffset = new Vector2(0,-yOffset);
  27.  
  28.                 // Now we reset the baseClipRegion to the new height
  29.                 scrollPanelView.baseClipRegion = new Vector4(0,0,panelWidth,newHeight);
  30.  
  31.         }
  32.  

I added 2 more heat sources to my scene and sure enough the scroll list worked (and resized) just fine.

TLDR: Reset clipOffset BEFORE resetting baseClipRegion
 8)

One more (I was gonna say last but that's not true!) question:
Q: I'm going to have several of these dynamic scene-based scrollviews (lets say 4) with only one being "viewable" at a time. Is it better to MOVE them offscreen when they are not active or can I just ENABLE/DISABLE them?
Q: Can I have 4 UIGrid objects inside my scrollview with only ONE active at a time?

It will end up like a small toolbar  [aa] [bb] [cc] [dd] and depending on which button you click, the associated list of objects will be displayed.

8
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 08, 2014, 09:46:30 AM »
1. Sprite should be outside your scroll view, not inside it. Only scrolled content should be inside the scroll view.
Okay - fixed

Quote from: ArenMook
2. Not sure why you have a scroll view and a panel right above it. A scroll view already contains a panel. Also why parent everything to the camera?
I needed to get the entire scrollview behind my graphic (on a panel) in the corner <- in thinking about this now, it doesn't need to be. I can remove the panel.

Re: camera <- that's the way the SGSK is setup <- is it wrong??

Quote from: ArenMook
3. You need to reset the clipOffset as well when changing the base clip region, otherwise it will still be used.
Yeah, if you see that commented line, when I uncomment it and try to reset the clipping offset it would shoot off the screen (above)
I'm resetting everything in the scene and now the size AND position of the scrollview seems to function as expected (and hopefully will be dynamic). The contents (my list of targets) are not being reset so I just have to figure out which item (UIGrid or UIScrollView) needs to be reset/refreshed and hopefully I'll be good.

Screenshot included

and thanks for taking the time

PS THIS is why we* chose NGUI over the now defunct DFGUI
* collective "we" ;)

9
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 08, 2014, 09:12:11 AM »
Thanks ^^^^

Okay I'm sooooo close but also soooo frustrated at my lack of knowledge - ARG! Alright, I feel better.

Here's my new layout:
Quote
Camera2D
--Panel
----Scrollview
------UIGrid
------Sprite (for background, anchored to Scrollview)

I have reset the default scrollview to a size of ONE object and positioned it in the upper right corner under another sprite. My plan is to then readjust the scrollview settings after I create my UIGrid and know it's overall height. Here's my code:
  1.         void UpdateHeatSourceList () {
  2.                 cellCount = 0;
  3.                 foreach (HeatSource _hs in HeatSource.mList) {
  4.                         if (_hs.CompareTag("Player")) continue;
  5.  
  6.                         // Use .AddChild instead of lines above!
  7.                         GameObject go = NGUITools.AddChild(_grid.gameObject,heatSourcePrefab);
  8.                         go.name = _hs.name;
  9.  
  10.                         cellCount++;
  11.  
  12.                         mTargets.Add(go);
  13.                 }
  14.                 float newHeight = Mathf.Clamp((cellCount * prefabHeight),0f,maxPanelHeight);
  15.                 Debug.Log("New Height: " + newHeight.ToString("F0") + " for " + cellCount.ToString() + " targets");
  16.  
  17.                 scrollPanelView.baseClipRegion = new Vector4(0,0,panelWidth,newHeight);
  18.                 //scrollPanelView.clipOffset = new Vector2(0,(newHeight-17f));
  19.  
  20.                 _grid.Reposition();
  21.         }
  22.  
The scrollview DOES get reset to the correct size (204 in my test scene) and I can see that if I just move the clipping CENTER.y down the newHeight-(prefabHeight/2) amount it would be in the correct position.

More screenshots which will hopefully help

10
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 08, 2014, 09:00:02 AM »
"Disable dragging if fits" option on the scroll view.
Do you mean: "Cancel Drag If Fits"? <- and if you do; Should I ENABLE this option?
Thanks

Reply: Thanks!!!

11
NGUI 3 Support / Re: [Font Maker] Mac OS X 10.9.5
« on: August 08, 2014, 08:10:35 AM »
Known issue on OSX. It all depends on what kind of permissions Unity has. Just take the FreeType.dylib file and copy it over to /usr/local/lib yourself. Create the folder if it doesn't exist.
This might be the problem:
There is no /usr/local/lib <- in /usr/local there is /bin and /man

There IS however a /usr/lib folder.

Which folder do I use?

12
NGUI 3 Support / [RESOLVED] [Font Maker] Mac OS X 10.9.5
« on: August 08, 2014, 06:47:15 AM »
I see this in the console related to Font Maker
  1. Unable to copy FreeType.dylib to /usr/local/lib:
  2. Access to the path "/usr/local/lib" is denied.

13
NGUI 3 Support / Re: Dynamic UIPanel (scrollview)
« on: August 07, 2014, 05:39:12 AM »
Thanks - in thinking about my layout I will be placing a blocking (in front of scrollview) UIPanel above the scrollview (in the upper right corner) so if I reset my scrollview to use the bottom edge (it's vertical) I might be able to achieve the same effect by using the "Y" offset.

Thanks!
 :)

Update: I actually got this to work by removing the (legacy) UIAnchors and placing my objects in UIPanels. I can fake the dynamic scrollview using the offset (I count the number of targets and multiply by the target prefabs height) but the objects can still scroll up. Is there an easy way to programmatically stop a scroll view from scrolling (in my case when there aren't enough objects to warrant a scrollview)?

Example screenshot

14
NGUI 3 Support / Re: Prefab toolbar issues
« on: August 07, 2014, 05:34:09 AM »
ah, okay - thanks for your response and help!
 8)

15
NGUI 3 Support / Dynamic UIPanel (scrollview)
« on: August 06, 2014, 03:50:47 PM »
Given this: (in UIPanel.cs)
  1.         /// <summary>
  2.         /// Clipping position (XY) and size (ZW).
  3.         /// Note that you should not be modifying this property at run-time to reposition the clipping. Adjust clipOffset instead.
  4.         /// </summary>
  5.  
  6.         public Vector4 baseClipRegion
  7.  

How can I, at runtime, adjust my scrollview to match a list of objects (targets)? I have the list working and my script is creating objects inside my UIGrid AND I can update it (via Reposition() ). Many times my list of objects will be only one or two and can even be an empty list. So how do I resize my UIPanel (that is also my UIScrollView) at runtime/dynamically?

Note: I searched the forums and found a post from 2012 stating to use mPanel.clipRect <- which is no longer available.

My test scene is working without error EXCEPT my scroll view (UIPanel) doesn't resize (get smaller if not need; kind of like the scrollbar which does not show unless it's needed).

Thanks

Pages: [1] 2 3