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

Pages: [1]
1
Same thing for me using 4.6.
Absolutely not showing the keyboard on a Surface Pro device :(

I already posted a hack in this very same thread, less than 10 posts behind.

The problem that is still not solved (or hacked) is that Backspace and arrow keys don't work.

2
NGUI 3 Support / Re: UIGrid pivot does nothing. Always renders on TopRight.
« on: December 01, 2014, 06:43:09 AM »
The grid simply changes the position of transforms below it. It isn't even working with widgets -- it works with transforms. Meaning whatever the pivot point of the content below the grid, that will be the position that will be adjusted.

Then, the problem persists. How am I supposed to give support to different aspect ratios if the UIGrid object is positioned using absolute values in transform?

As an example, for a 4:3 aspect ratio its x-axis position must be x= -400px, and for 16:9 x= -632px.

3
NGUI 3 Support / Re: UILabel - How to make "justified"align right to left?
« on: November 27, 2014, 04:57:00 AM »
Just look for an Unity RTL plugin that parses the text, and write down said text to the UILabel.

4
As I posted in OP, there's an easy hack that forces the keyboard to show up each time you click on the UIInput.

We force the keyboard to open directly in OnPress. This is the method Arenmook is using for the caret positioning/selection handling.

This means, adding the following code to OnPress (posting the whole method goes against the rules, but it is a small one):
  1. #if UNITY_METRO
  2.       var key = TouchScreenKeyboard.Open(null); // null is also not what we need here, but as a hack it is good enough
  3.       key.active = true;
  4. #endif

But showing the keyboard is only the first of the problems!

The second problem, which I wasn't able to bypass, is that the UIInput themselves don't receive the "Backspace" or "Arrow key"s key inputs.
Therefore, it is impossible to remove things you have written.

Anyone got any idea? I will try tracing back the events again, but from my first try:
  • He calls DoBackspace() inside ProcessEvent()
  • He calls Insert("") which theoretically replaces the last character with "" (empty character).

5
We are having 2 problems related to UIInput in Windows Store compilations. I checked that these happen in both desktop, arm and x86 tablets (Surface and Surface Pro). We're updated to 3.7.6.

1st problem)
The keyboard doesn't open. I saw that you already call mKeyboard.active = true on Update when MOBILE is defined.
MOBILE directive is, however, not defined when we are in UNITY_METRO.
We were able to hack that problem adding (mKey = keyboard.Open(null); mKey.active=true; ) to OnPress.
But this is not a solution, and the behaviour is not the intended.
In Windows Store desktop there's no touch keyboard, so obviously it doesn't show up.

2nd problem)
The backspace doesn't work. The directional keys don't work neither, but those we don't use.
We tried tracking the methods up to DoBackspace->Insert("") and found that they are not even called in Windows Store compilations.
Neither desktop or tablet compilations detect backspace.

6
NGUI 3 Support / Re: UIGrid pivot does nothing. Always renders on TopRight.
« on: November 14, 2014, 05:42:09 AM »
Grid's pivot point simply changes the grid's position after all items get placed. If you want them to grow toward the left instead of right, change the cell X size to a negative number.

What I want is for the first item to render on the Top Left corner of the panel.

This is, that the UIGrid anchors to the top left. I don't want it floating aimlessly on the right corner as you can see in all the pictures. I want to give support to all kind of aspect ratios, thus anchoring and not absolute position (with transform).

Sorry for not pointing this out explicitly/accurately.

7
NGUI 3 Support / Re: UIGrid pivot does nothing. Always renders on TopRight.
« on: November 12, 2014, 11:16:54 AM »
I guess the pivot works fine.
You can try add 3 elements to the UIGrid and see.
If you want to move the place of the UIGrid, don't attach UIGrid Script and UIPanel to the same GameObject.
Attach UIGrid to a child of the gameobject that the UIPanel attached to, and adjust the transform.

Something is not working right and I guessed it was the pivot, because it is on TopLeft and it is placing them incorrectly as seen in the picture. It seems to be placing them in TopRight.

Whatever I do. It doesn't matter if I add 3 more elements, dynamically in runtime or manually on the editor.

I don't want to move the UIGrid using transform. It is properly anchored in the exact position I want it. You can see the square that is the UIPanel and it is placed correctly. And adding the UIGrid component to a child of the UIPanel, and then anchoring that one on the right place behaves in the exact same way.

I'm attaching a third picture that shows how it behaves as you asked, with 3 more items.

8
NGUI 3 Support / UIGrid pivot does nothing. Always renders on TopRight.
« on: November 11, 2014, 06:16:20 AM »
Hi ArenMook.

I created an UIGrid, which I'm going to populate dynamically using NGUITools.AddChild.

When I simply populate and then show it, it doesn't have enough time to properly reposition the children.
<image attachment number 1>
They are shown all over the place.

That's why I created a coroutine to wait for exactly 2 frames before calling Reposition and then showing it.

But then, for some reason, it always positions them on TopRight pivot, whatever pivot I pick, and however much I wait or reposition.
<image attachment number 2>

Any ideas?

9
NGUI 3 Support / Re: support for right to left input
« on: October 08, 2014, 03:01:33 AM »
Thank you for the fast answer! I2 Localization seems to be handling this already, so I won't have to reinvent the wheel.

10
NGUI 3 Support / Re: support for right to left input
« on: October 07, 2014, 09:12:34 AM »
I noted that. but i have got a great fix, free and works well for both unity and NGUI (with a bit of tweaks...)

i'm using this to flip the strings:
https://www.assetstore.unity3d.com/#/content/2674

Even using a RTL plugin does not solve this issue. The way UILabel (or the Unity logic underneath it) renders its Text is from left to right, doesn't matter if the string is RTL or not.

What this does cause is that, when there is more than one line, the actual beginning of the sentence is at the bottom right. Thus, the sentence end is on the top-left side. In other words: It is written bottom-to-top.

This is because UILabel begins rendering on the LTR beginning (the first char in the Text string) and goes on rendering rightwise until a new line is needed. Even if right alignment is picked.

As an example, this following sentence:
متعدد الوجوه مع 6 وجوه. حيث الوجوه التي تشكل المكعب هي مربعات. بجانب كونها متعددة الوجوه عادية، فإنه يمكن أيضا أن تصنف على أنها متوازية ، ومتوازية المستطيلات، ومنشور مستقيم مع قاعدة مربعة.

Is rendered as seen in the attached screenshot. Notice that the "6" is at the beginning (right side) of the sentence, but it is rendered at the bottom of the UILabel.

So, what I was getting to with this:
Arenmook, do you think there is a way to fix this without heavily modifying your UILabel?
If there is not, any method I can begin looking at? (I'm guessing in NGUIText)
Even more so, is this even related to UILabel or do I have to look into Unity's library?

Thank you for your attention, and excuse me if re-bumping this old post wasn't the right approach.

11
Thank you very much for the steady and concise answer.


Quote
1. Creating content doesn't immediately add it to the managing panels. This process is delayed, so assuming you instantiate content and then try to reset the scroll view, doing so will do nothing. You can force widgets to be added by calling CreatePanel() (you can just broadcast it).

I'm not really sure what are you referring to with broadcast (most likely because of limited C# knowledge). In any case, reading the code of CreatePanel I see that what you do is look for a panel and force/assign it to the widget. It works, with a patch.

I must wait a handful of frames. Is there any other way other than forcing such a wait to reset the position? I can add a tweenalpha or something to disguise it, but that is nonetheless a patch.

Also, should I care about what panel is being picked and take precautions? or can I shamelessly use this method for all the widgets in each of these structures with no downsides?


Quote
2. Not sure about this one.
Actually, it was a byproduct of one of the other 2 problems. It's not happening anymore.


Quote
3. The option to prevent moving if the content fits is specified on the scroll view (cancel drag if fits). However if the content doesn't fit (like it starts outside), then you will still be able to move it.
That option has always been ticked, because it's the behaviour I obviously want.

I found that I explained myself very poorly, but I'm not going to rephrase it because I found more precise details about what was causing the strange behaviour: a ScrollBar.

If I just remove the scrollbar, this problem is solved and I cannot move outside the scrollview boundaries. As for now, I'm just not going to use the ScrollBars and work on the other two problems. If, in a future, I happen to encounter this again, I'll ask here with more details.



12
Hi. First of all, thank you for NGUI.

I'm having three different problems within the same game object structure. Said structure is as follows:

+ PanelDescription   <-- UIPanel with a lateral tweening
   + Scroll              <-- UIPanel with a vertical UIScrollView
      + Text1           <-- UIWidgets with child UILabel and UISprites
      + Text2
      + Text3

Being its intended behaviour:
- The whole panel is usually hidden. Under certain conditions, it is shown or hidden with the tweening.
- The scroll must be on a panel because we want vertical 'softening' and clipping.
- The number of Text objects inside the scrollview will vary dynamically.

I'm not using UIGrid because I have objects of varying sizes that stack on the bottom of each other.

Each time I want to add or remove a Text object I first clean the scrollview, repositioning it with UIScrollView.ResetPosition() before and after the cleanse.
After I repopulate it, I ResetPosition again just in case.

And regarding the scrolling itself: I tried both using a single invisible collider that anchors to the first and last Text object, and making each Text object a drag scrollview collider itself.

Oh, and the lateral tweening of PanelDescription is being done by a TweenAnchor I made myself to tween directly with the anchors.
Now, with the problems:
1st) The scrollview NEVER begins at its correct, topmost, position. Even when the content origin is set as TopLeft.
2nd) The scrollview automatically moves up when the father PanelFormulas is tweening. Even if it is at its bottom. I must say that I made sure, and even more it has absolutely no sense, that the tweening itself is somehow directly affecting the scrollview. This correlation (or maybe causation) has to be caused indirectly.
3nd) The scrollview movement itself is flawed: When dragging a dragscrollview object after we are in a boundary I can move outside the boundaries. If we are not yet on a boundary, then it stops properly.

Both the first and third problem can only seem to be "solved" (more like patched) setting the Y position manually in the transform of the Scroll object. However this Y position changes each repopulation, thus making this not even a patch.

I've been looking for a while for any of these 3 problems in these forums but couldn't find it solved. I'm sorry if any of them are.


Thank you for your attention, and I hope I didn't miss any key information and that I made myself clear.

Pages: [1]