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

Pages: 1 [2] 3
16
NGUI 3 Support / Re: Discrepancy between scenes with new anchoring system
« on: December 29, 2013, 04:43:44 AM »
@Andrew: I agree that anchoring text label has now become less intuitive but I guess there must have been very good reasons from a programming standpoint; it's just that as a simple user they elude me.

@ArenMook: I just updated today to 3.0.8, hoping that it would fix the problem with prefabs you mentioned last time but as Andrew pointed out it seems it still doesn't work: the text label does not appear at the correct position (it's supposed to appear over its target transform).

I did use the "Offset" checkbox as you advised but still I can't manage to get it to work properly. Is this still a bug or am I doing something wrong?

17
NGUI 3 Support / Re: Discrepancy between scenes with new anchoring system
« on: December 20, 2013, 05:33:22 PM »
Thank you for your explanations ArenMook. I understand. So I guess I'll just have to be patient and wait for 3.0.8 to be released. Hopefully it'll take care of the main prefabs issue...

18
NGUI 3 Support / Re: Discrepancy between scenes with new anchoring system
« on: December 20, 2013, 12:24:47 PM »
Thank you, so I did just that but since I have version 3.0.7f3 that didn't fix the problem of course. Is there a way to download 3.0.8 yet (it doesn't show in the Asset Store yet)?

Also another unrelated issue: when leaving "UI Root (2D)" as the default target for the anchors, and then at runtime substituting that for a "real" transform then the UILabel appears at a wrong position on screen. It only works if you manually assign a "real" transform (I mean other than the UI root) in the editor. Only then will the UILabel actually follow the anchor transform assigned through code...

19
NGUI 3 Support / Discrepancy between scenes with new anchoring system
« on: December 20, 2013, 07:36:28 AM »
Hello,

I'm seeing a strange discrepancy from one scene to another with the new anchoring system. I'm simply telling a UILabel to follow an object on-screen using:

  1. objectUILabel.leftAnchor.target = objectLabelTarget;
  2. objectUILabel.rightAnchor.target = objectLabelTarget;
  3. objectUILabel.topAnchor.target = objectLabelTarget;
  4. objectUILabel.bottomAnchor.target = objectLabelTarget;
  5.  
The UI Root (2D) in both scenes points to the same prefab (and I made sure to click "Revert" so both are the identical, sitting at the world's origin).

Yet in one scene the UILabel is at the correct position on screen (ie: it appears right over the target transform), but in the other scene the label's position is completely offset on-screen (seemingly arbitrarily). I also checked that in both scenes the target transform is at the correct position in space.

So what could cause such a weird behavior if both the NGUI root objects are exactly the same and the target transform is in the correct position in both scenes? I'm a bit at a loss here...

The only difference between the scenes is that in the "correct" one the objects that the UILabel tracks are "in front" of the NGUI root, while in the "wrong" scene the objects are "behind". I don't think this should have any incidence though.

20
NGUI 3 Support / Re: How do I set an anchor target transform through code?
« on: December 19, 2013, 03:05:56 AM »
You're right, that's what I ended up doing. Thanks again for your help ArenMook!

21
NGUI 3 Support / Re: How do I set an anchor target transform through code?
« on: December 18, 2013, 03:26:05 PM »
Thank you for the links!

I meant that I would like my UILabel to follow a transform but I need to add an offset in space relative to that transform (a Vector3) so that the UILabel doesn't appear right at the transform's position but at: transform.position + Vector3(offset). Is there a way to do that?

Or is it maybe possible to feed a position (in world space) as a target rather than a transform?

22
NGUI 3 Support / Re: How do I set an anchor target transform through code?
« on: December 18, 2013, 10:25:05 AM »
Thank you! So I have a couple follow-up questions in order to make sure I understand correctly:

1) Where can I find all this related information so I can stop bugging you all about it? I swear I've spent a long time looking for this on the official documentation pages without any luck.

2) What are the offset's units (...leftAnchor.absolute) in relation to the transform anchor? Pixels relatives/absolute? Meters/centimeters?

3) I need to input a spatial offset to the position of the label (specific to each transform). What would be the best way to plug that spatial offset?

23
NGUI 3 Support / Re: How do I set an anchor target transform through code?
« on: December 18, 2013, 09:43:52 AM »
Thank you for your reply! I'm a bit confused though: I have to change those four variables to just change the single Target transform of the label?

But then how do I input a different offset for each of the left, right, top and bottom variables (the lines that say "Target's Center + ...")? I mean those are numbers, not transforms, right?

24
NGUI 3 Support / How do I set an anchor target transform through code?
« on: December 18, 2013, 08:44:14 AM »
Hello, I'm simply trying to to set the anchor target transform for a UILabel through code but I can't find the instructions anywhere. So far I tried:

- myUILabel.target = ...
- myUILabel.anchor.target = ...
- myUILabel.AnchorTarget = ...
- myUILabel.anchors.target = ...
- myUILabel.AnchorsTarget = ...
- myUILabel.anchortarget = ...
- myUILabel.AnchorPoint.target = ...

I'm sure it's plainly obvious to everyone but please... help...

25
NGUI 3 Support / Re: UICheckbox has disappeared?
« on: November 13, 2013, 10:56:24 AM »
Answer: It's been replaced by UIToggle of course! (http://www.tasharen.com/ngui/docs/class_u_i_toggle.html)

26
NGUI 3 Support / UICheckbox has disappeared?
« on: November 13, 2013, 09:36:08 AM »
Hello, I'm sorry if this is obvious to everyone but I just updated to the latest version of NGUI (3.0.5) and I get this error:

error CS0246: The type or namespace name `UICheckbox' could not be found. Are you missing a using directive or an assembly reference?

I looked everywhere in the NGUI folder and I cannot find the UICheckbox.cs file anymore. Could anyone help me please?

27
NGUI 3 Support / Re: Using the Xbox 360 gamepad B button
« on: June 25, 2013, 04:25:55 AM »
Thanks!

28
NGUI 3 Support / Using the Xbox 360 gamepad B button [Solved]
« on: June 23, 2013, 11:59:53 AM »
Hi, I'm using an xbox 360 gamepad and I would like to "click" my menu buttons with the B button instead of the default A button. How could I achieve that, please?

29
Oh I see, sorry. I removed the string.Replace operation from the label code and applied it to my own script just before I update the label's text. It works fine. Thanks.

30
I didn't want to start a new topic since I've got the same problem: line breaks are not working anymore. I'm reading the text strings from an XML file where I use "\n" to create a line break. A couple of NGUI updates ago this stopped working. I thought it was a bug and would be fixed eventually but the problem's still there.

Reading this thread I see it mentions replacing all the "\\n" by "\n" but I'm already using "\n". I also tried unchecking the "Encoding" check-box but it doesn't seem to make any difference.

I would really like to keep on using NGUI for "Ghost of a Tale" but I need to be able to create line breaks. Does anyone have a solution, please?

UPDATE:

I implemented the change suggested by realblues and it works (thanks realblues!)... :)

@ArenMook: Do you think it would be possible to include that bugfix in NGUI so line-breaks become supported again out of the box, please?

Pages: 1 [2] 3