Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOAITextBox.LEFT_JUSTIFY v MOAITextBox.RIGHT_JUSTIFY (Y position problem) #122

Open
BenM1111 opened this issue Feb 7, 2013 · 2 comments

Comments

@BenM1111
Copy link

BenM1111 commented Feb 7, 2013

local MthPmtText = RNFactory.createText("Monthly Payment $", {size = 36, top = 0, left = 0, width = 200, height = 40, alignment = MOAITextBox.LEFT_JUSTIFY })

local MthPmtTextVal = RNFactory.createText(comma_value(mPmt), {size = 36, top = 0, left = 201, width = 200, height = 40, alignment = MOAITextBox.RIGHT_JUSTIFY })

I would think the above code should display the text at the same Y position, in this case 0. But it seems to actually display the LEFT_JUSTIFIED version a few pixels too high (maybe about 5?).

@MattiaFortunati
Copy link
Collaborator

Hi BenM1111,
you are right!
This happens because when you set alignment like in the code you posted, both vertical and horizontal alignments are set to LEFT or RIGHT.
This is made due to chinese language compatibility.

If you want to set only one of them you should use:

hAlignment=MOAITextBox. RIGHT_JUSTIFY
vAlignment=MOAITextBox.LEFT_JUSTIFY
MthPmtText.textbox:setAlignment(hAlignment, vAlignment)

Let me know if it's working :D

@BenM1111
Copy link
Author

BenM1111 commented Feb 7, 2013

Hi Mattia,

Ok got it. Yes that works perfectly, thanks.

Now if I can just figure out how to get a build for device to actually work, I will be set. Now that is frustrating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants