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

Pages: [1] 2 3 4
1
NGUI 3 Support / UISprite : Scale Suggestion Advice
« on: June 17, 2014, 11:11:55 PM »
Just a suggestion but, I think it would be better to name the UISprite "Dimensions" to "Width/Height".

Now that it is also definied as part of the Widget, I think this is a great addition. However, being an old NGUI user I remember the days when the Unity scale defined the size of the sprite.
Coming back to the UI recently, the first thing I do is transform.LocalScale and then my sprite is absolutely massive.

Then when I try to find the "Dimensions" the first thing I come across is

.drawingDimensions

I debug it and of course, there it is, the second half of the Vector4, so I try and set that and get a readonly error. I search a bit further and then I find .localSize, this appears to be what I am looking for, but I set this with a new Vector2 and again, a readonly error.

Eventually I stumble across .width and .height and sure enough changing these paramaters is what I am looking for. But finding them doesn't seem intuitive.
But I can't help feeling that is the naming of some of these variables .GetLocalSize would help programmers like myself from having to hunt around.

Why does .localSize even exist anyway, why not just use .width and .height?

Anyway, hope this doesn't sound like a rant. Just something that freaked me out a bit just now when trying to do something I have been used to doing. :)

2
NGUI 3 Support / Correct usage of UILabel Shrink to Fit
« on: August 28, 2013, 04:16:57 AM »
I am pretty sure this is a feature rather than a bug but, but I have text, that I want to resize.

In doing so, using "Shrink to Fit" does odd things. Mostly though revolving around snapping back to the "Make Pixel-Perfect" size and auto adjusting the MaxWidth along with it.

I guess then there is no support for Shrink to Fit on using text of different sizes other than the default atlas size?

3
NGUI 3 Support / How do you stretch an UISlider?
« on: June 21, 2013, 01:05:21 AM »
Hello, not quite sure why I am problems with this. Must be doing something wrong.

Ok, I have an energy bar using UISlider that has a length of about 200 pixels.

I want the energy to increase in length, for example to 300 pixels. But the UIValue "Value" slider from 0-1 is locked to 0-200.

I can modify the background image to stretch it to 300 but can't do it with the foreground image.

4
NGUI 3 Support / UIInput, deleting buffer?
« on: November 28, 2012, 09:33:19 PM »
This is probably an easy one but I can't seem to figure it out.

I use UIInput to enter a string, such as "Hello". I press enter, and the string is saved to my UILabel.
However when I open UIInput again, the prompt is blank, but as soon as I type "Hello" appears again in the display box.

How do I delete this?

I've setting a blank string to both the .text of the UILabel I'm passing the string too and also the .text of UIInput.
But no luck.

5
NGUI 3 Support / Sending Parameters within Buttons?
« on: November 21, 2012, 10:08:34 PM »
This has been bugging me for ages, seems like a really easy thing to do but yet without fiddly work arounds I can't seem to cleanly get this to work.

Anyway, my example.

Let's say I have a flick panel full of buttons, I duplicate lots of buttons from the 1st entry, but each button has OnClickButton. So each button points to the same function in code.
What I want is something like "OnClickButton(1)", "OnClickButton(2)" etc. But it seems you can only point to a function but not pass it any parameters.
So unless I have something like:-

void OnClickButton(int p)
{
}

void OnClickButton1()
{
 OnClickButton(1)
}

void OnClickButton2()
{
 OnClickButton(2)
}

void OnClickButton3()
{
 OnClickButton(3)
}

... etc
I can't get which button was clicked in the flick panel.
Any ideas on how I could do this effectively?

ArenMook, I looked in many of your threads. Such as this one

http://www.tasharen.com/forum/index.php?topic=318.msg2254#msg2254

and I am completely lost.

In the end I got around the 'issue' by renaming my Button objects to simply numbers and then grabbing the Unity GameObject object name using MyObject.name and then converting the string to an int.

6
NGUI 3 Support / Changing an Atlas assigned to a UISprite?
« on: September 08, 2012, 07:41:33 AM »
How do I do this?

So far I have assigning new sprites in an atlas. Using something like this:-

mySprite.spriteName = "other_sprite_name";

This all works but now I want to do something like this.
mySprite.atlasName = "other_atlas_name";

I have searched around on this forum and found .replacement

But I can't seem to get it to work. I have loaded two atlases like this:-

UIAtlas myAtlas1 = Resources.Load("mydir/myAtlas1", typeof(UIAtlas)) as UIAtlas;
UIAtlas myAtlas2 = Resources.Load("mydir/myAtlas2", typeof(UIAtlas)) as UIAtlas;

Then I call my atlas change.

mySprite.atlas.replacement = myAtlas2;


However if I debug the atlas (mySprite.atlas), it is still pointing to myAtlas1.

Am I missing something obvious?

7
NGUI 3 Support / Yikes, can't Select UIAtlas
« on: September 08, 2012, 06:16:30 AM »
Not sure if this is a problem with Unity but the "Select UIAtlas" "List of recently used components box", it has no scrollbar...

I can extend the window to the height of my screen resolution but now I have more atlases than I can fit on the screen. And since there is no scrollbar there now, atlases missing off the bottom I can't select.

Is there any way around this?

8
NGUI 3 Support / Unity freeze with NGUITools Refresh
« on: September 06, 2012, 05:13:33 AM »
My program starting freezing, Unity completely froze and made it so I had to CTRL+ALT+DEL.
Finally tracked the fault down to

NGUITools.Broadcast("Refresh");

If I remove this line, my program no longer freezes. I am not sure exactly what is happening but I can only assume that maybe I have too many children in my UnityObject?

9
NGUI 3 Support / UILabel Line Spacing?
« on: September 03, 2012, 11:38:06 PM »
Is there anywhere to adjust vertical line spacing?
If I have UILabel, the text string when it goes onto the next line, it is a quite a big step in most cases. Presumably the line spacing is determined by the maximum height of the biggest height character.

Is there anyway to adjust this? Up till now I have been positioning 2 or 3 UILabels close together to get around this issue. But I am beginning to wonder if there is a better way?

10
NGUI 3 Support / Straight Lines?
« on: September 03, 2012, 04:35:00 AM »
Probably a long shot, but it is possible to render straight lines using NGUI?

Basically I want to draw some lines between boxes, as if I was in Excel doing a diagram.
I am almost certain this is a no, but I just thought I would check anyway :)

11
NGUI 3 Support / Feature Request : Pixel Perfect TweenPosition
« on: August 30, 2012, 07:23:10 AM »
When you have pixel perfect buttons (or items in general) and attach a UIButtonOffset, all the gfx go a bit blurry.

I've tinkered with the tween code and basically put an Int modifer on the vector before setting it.

eg

Vector = new Vector3( (int)Vector.transform.Local.Position.x, (int)Vector.transform.Local.Position.y, (int)Vector.transform.Local.Position.z);

Perhaps there should be a option, so float values or int values are used in the tween.

PixelPerfect Move []


For certain, the smoothness is ever so slightly jerky, but now the gfx don't go blurry. Same goes for UIButtonScale.

12
NGUI 3 Support / Get UILabel size?
« on: August 26, 2012, 01:52:01 AM »
If there a way to get the size of a UILabel's mesh?

I have a UILabel inside a Draggable Panel and I want to find out the size (height) so I adjust its box collider values accordingly to whatever size it is.

13
NGUI 3 Support / UILocalize's UpdateText gone?
« on: August 23, 2012, 07:53:31 AM »
On some old code, I was changing the text of a Label by changing its keycode.
eg

Prologue_Text_Slider.GetComponentInChildren<UILocalize>().key = key_name;

However the text did not actually update until I called this:-

Prologue_Text_Slider.GetComponentInChildren<UILocalize>().UpdateText(key_name);

Unfortunately after updating NGUI, this UpdateText function is now gone, deleting this line means now the text no longer changes. Has this function been changed to something else?

14
NGUI 3 Support / How to, two Draggable Panels Next to each other?
« on: August 23, 2012, 02:09:49 AM »
When you use a Draggable Panel, the items outside the panel are still there, to avoid clicking on them you have a collider each side (as in the tutorial) to mask these areas so you don't click on them.

Right now I have two horizontal slider panels but they are positioned right next to each other so the off panel objects are interfering with the neighbouring panel. And Vice Versa.

Any tips on how to get around this? What I am planning on doing is making it so any objects that appear outside of the panel are disabled / moved a large distance in the Z direction. That should work, but just wondering if there is any other method, a better method.

Has anyone else come across this problem yet?

15
NGUI 3 Support / Getting 3D Objects to appear in front of NGUI?
« on: August 17, 2012, 02:32:32 AM »
I have my character select done, what I want to do is have the 3D mesh of the character appear on the menu and spin around. Now I have spawned the 3D Character into the scene, but I can't figure out how to do this.

I know that NGUI is rendered to a different layer, I probably need to use a separate camera or something, but I have no idea where to start. I wish I understood Unity better.

Pages: [1] 2 3 4