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

Pages: [1]
1
NGUI 3 Support / Re: UIInput: Use the current label value as Starting Value
« on: November 25, 2014, 11:19:46 AM »
Got it.

I was attempting to change the "DefaultText" rather than just setting the value directly.

Thank you.


2
NGUI 3 Support / Re: UIInput: Use the current label value as Starting Value
« on: November 24, 2014, 01:02:47 PM »
Ok, no responses.

Does that mean that people find it odd to want to do this or that they consider the question incredibly easy to solve?

3
NGUI 3 Support / UIInput: Use the current label value as Starting Value
« on: November 20, 2014, 03:15:51 PM »
My label represents a length value and changes as the user moves the end points.

The user clicks on the Collider for the UIInput and because the StartingValue is empty, it makes the label.text empty.

I had hoped to that it was as simple as creating a new class that inherits from UIInput and overrides the OnSelect or OnPress and assigns the mDefaultText to label.text before the UpdateLabel but that doesn't work.

Anyone attempted something like this before and have any suggestions?


  1. public class UIInput_LengthIndicator : UIInput {
  2.         protected override void OnPress (bool isPressed)
  3.         {
  4.                
  5.                
  6.                 mDefaultText = label.text;
  7.  
  8.                 if (isPressed && isSelected && label != null && UICamera.currentScheme == UICamera.ControlScheme.Mouse)
  9.                 {
  10.                         mSelectionEnd = GetCharUnderMouse();
  11.                         if (!Input.GetKey(KeyCode.LeftShift) &&
  12.                             !Input.GetKey(KeyCode.RightShift)) mSelectionStart = mSelectionEnd;
  13.  
  14.                         UpdateLabel();
  15.                 }
  16.         }
  17. }

4
NGUI 3 Support / Re: UIPanel movement appears to be Integer based
« on: August 05, 2014, 05:05:33 PM »
Yup; that explains the problem.  I definitely had it built with multiple UIRoots (which I obviously didn't need)

Thank you!

5
NGUI 3 Support / Re: UIPanel movement appears to be Integer based
« on: August 05, 2014, 08:05:31 AM »
Moving the Sprites underneath directly works correctly, but they have to move rather fast so there is some screen tear occasionally.

I've read that moving the UIPanel directly incurs little, to no, over head when being moved so I've been attempting it but I'm getting the above issue.

6
NGUI 3 Support / Re: UIPanel movement appears to be Integer based
« on: August 05, 2014, 06:45:57 AM »
The UIPanel Transform in my project snap to a scale of (0.002777778, 0.002777778, 0.002777778) when it was first created, so 1 unit is definitely not 1 pixel.

Is that perhaps the root problem?

I've tried setting the scales on the UIPanels to 1, but it's just reset back to .0027 while the UIRoot is enabled.

7
NGUI 3 Support / UIPanel movement appears to be Integer based
« on: August 03, 2014, 01:55:29 PM »


I have an Object with a UIPanel and UIRoot.  Under that I have two sprites.

When I move the UIPanel object, in code by moving the transform's local position, it appears to move fine but the underling sprites move as if the UIPanel's position was integer based.  IE: they 'pop' from position to position.

I'm lerping between a Vec3( -53, 41, 0) and Vec3( -51, 41, 0) and in code this works fine.  Transitioning from -53 to -51 over time, but the visiuals look as if it popped from -53 to -52 to -51 without hitting any points inbetween.

Any one have any suggestions?


8
NGUI 3 Support / Re: UIButtonTween and IsEnabled
« on: May 14, 2013, 03:24:28 PM »
Unfortunately, I was already looking at UpdateColor and had skipped the more important IsEnabled colider check.

9
NGUI 3 Support / Re: UIButtonTween and IsEnabled
« on: May 14, 2013, 02:58:52 PM »
So I tried this in the same way I saw in your picture (attached a screen shot).

In my code I do this and it says that each UIButton is being disabled, but still only the first image is being tween-ed.

  1. foreach( UIButton button in ButtonObject.GetComponentsInChildren<UIButton>() )
  2. {
  3.         print ( "Button fade color: " + button.disabledColor );
  4.         button.isEnabled = false;
  5. }

Which ever UIButton is first on the object is the one that gets run, the other two don't seem to run.


NOTE: This seems to work fine on Hover and Click for all 3 UIButtons, but IsDisabled doesn't seem to be working correctly

10
NGUI 3 Support / Re: UIButtonTween and IsEnabled
« on: May 14, 2013, 01:57:25 PM »
AHHHH!


Excellent, thank you.

11
NGUI 3 Support / Re: UIButtonTween and IsEnabled
« on: May 14, 2013, 01:07:43 PM »
I do use multiple UIButtonTweens to get it to go back and forth.

What I do not know how to do is: I only want this to happen when I set IsEnabled to true/false.

IT gives me options for Activated but I have no idea what that is or how to use it.

12
NGUI 3 Support / UIButtonTween and IsEnabled
« on: May 14, 2013, 09:47:44 AM »
Situation:
I have a button that I want to enable/disable often. I was using UIButton to do this and it functions correctly.
The 'button' has multiple labels/sprites/sliced sprites, but UIButton only darkens the first in the hierarchy (usually the background).

What I want:
I would like ALL the parts to darken/lighten.

What I tried:
I switched to an UIButtonTween and put TweenColor on all the elements.  I got this to function fine OnHover and OnPress, but I only want this to happen when I set the IsEnabled flag.

Maybe I'm just missing something simpler? Any suggestions?

Pages: [1]