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

Pages: [1]
1
NGUI 3 Support / Re: UILabel - How to make "justified"align right to left?
« on: November 26, 2014, 01:53:54 AM »
you can set alignment to right...maybe your ngui verson is too old...

Thanks for the answer, i appreciate it but please read the question: How to make "justified"align right to left?
There is options for aligning the text RTL, LTR, Center and Justified, i want to use justify, justify makes the text align LTR by default, i want RTL.

2
NGUI 3 Support / UILabel - How to get the width of UILabel?
« on: November 25, 2014, 10:13:32 AM »
I am trying to get the width of UILabel but it seems it is not related to the screen but related to some virtual size of UIRoot? i do not understand this O_O
how can i get UILabel size related to the srceen like a normal Unity GUI and get and set its size?

3
NGUI 3 Support / UILabel - How can i make UILabel not .ProcessText() ?
« on: November 25, 2014, 10:09:31 AM »
I am writing code to process the texts my way because the language that i am using is right to left and not Unity neither NGUI supports right to left, so all calculations like shrink text and such are calculated by my method, i want to UILabel not to process it and just show it as it is.

4
NGUI 3 Support / UILabel - How to make "justified"align right to left?
« on: November 25, 2014, 10:04:53 AM »
Hi,

I spent a good amount of time to make it align right to left but i couldn't make it :| I am a newbie in programming ;/

So how can i make to align right to left? any thoughts? O_O

The pic shows my problem o_o its left to right but the lang i use is written from right to left.

5
NGUI 3 Support / Re: UILabel - How does "Shrink Content" work?
« on: November 06, 2014, 02:42:11 AM »
Your string split is way too long. It should be simply:
  1. processedText.Split('\n');

It is not the problem i tested it, no different. hmmm its weird...

6
NGUI 3 Support / Re: UILabel - How does "Shrink Content" work?
« on: November 05, 2014, 11:14:54 AM »
I'm trying to find where the wrap text happens, if i understand correctly in the NGUIText.cs it puts a \n where ever it see its needed. i'm trying to find the \n in the new proceeded (wraped) text but i cant find the \n in it O_O

I am using this code to store every line in a string so i can reverse the order of them to be shown:

  1. string[] test = mUILabel.processedText.Split(new string[] { "\n", "\r\n" }, System.StringSplitOptions.None);
  2.  
  3.             foreach (string s in test)
  4.             {
  5.                 Debug.Log(s);
  6.             }

But only 1 string will be stored in the "test" string as if there is only 1 line where i see 3 line in the game view when play it O_O

Any thoughts?

7
NGUI 3 Support / Re: UILabel - How does "Shrink Content" work?
« on: November 04, 2014, 11:51:42 AM »
You will want to look at UILabel.ProcessText function. It calculates the size using NGUIText.Wrap, and if it doesn't fit, reduces the font size by a notch and tries again until it does.

Thanks, ill look into it ASAP, But how does it know when to break a long line into 2 or more lines?
The re size part work correctly but when it break a long line into multi lines then the problem rises.

*Look at it:

Ill press enter after this line!

This long line is for test purpose and i don't know what else to write, please read it at your own risk!

*when i change screen size it will be correctly like this in left to right languages:

Ill press enter after this line!

This long line is for test purpose and i
don't know what else to write, please
read it at your own risk!

*but it will be like this in right to left languages:

read it at your own risk!
don't know what else to write, please
This long line is for test purpose and i

Ill press enter after this line!

*How do you think we can fix this? Can you change the text wrap function to recognize right to left languages and break lines correctly?

8
NGUI 3 Support / Re: UILabel - How does "Shrink Content" work?
« on: November 04, 2014, 10:58:16 AM »
You will need to ask the plugin's author, not I. You are correct in your initial assumption that NGUI doesn't support RTL languages natively.

I asked him, he doesn't work on this plugin anymore and it works great for smal labels and smal text till they does't need to be shrinked. I want to use it with nGUI and use shrink text that comes with NGui, so i want to make it correct for everyone who use nGUI and want to write right to left, i know there are many.

Just if u can tell me how shrinking works ill try to collaborate with that plugin author to make something out of it and make it compatile with nGUI! and then u can use it in nGUI to support right to left too because that plugin is free.

Thanks.

9
NGUI 3 Support / UILabel - How does "Shrink Content" work?
« on: November 03, 2014, 07:16:11 PM »
Hi there

First of all thanks for your great plugin, second: if i am no mistaken nGUi doesn't support right to left languages like Arabic and Persian? For that matter i am using this plugin https://www.assetstore.unity3d.com/en/#!/content/2674, it is good for writing words and single line texts or multiline text by using /n in them manually but it cannot shrink them automatically based on size of the screen like nGUI does with the texts in its labels.

What i want to do: Create wall of texts! that can re size and shrink itself automatically so it can be fitted in any screen.

I use that plugin i linked before in combination with nGUI's Label to make Arabic and Persian GUI's, with that in mind lets go to where the problem rises: look at the pics i have attached, the first one is OK in landscape mode with no shrinking by nGUI but look at the second pic O_O when i change the screen to portrait mode where shrinking happens line are written in reverse from bottom top top O_O

I have no idea of how the shrinking works, if i know how it works i may be able to make it shrink texts correctly for the left to right languages! tho i am not a skilled programmer ;/ some helps would be nice ;p i guess i just have to find where line should  end and then i can put a /n in the string? but how O_O

Best Regards
Mohammad



Pages: [1]