You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most objects have x, y as the center however RNText is using the top left corner of the textbox when set. For example the following code should make the text be centered at the bottom right corner of the screen but instead it is near the middle:
local clickOnTheScreen = RNFactory.createText("Click on the screen", { size = 30, top = 0, left = 0, width = 200, height = 60 })
clickOnTheScreen.x = RNFactory.width/2.0;
clickOnTheScreen.y = RNFactory.height/2.0;
As a side note it would be nice to figure out the width of the top, left, width and height for the user (though I know this is not easy.
The text was updated successfully, but these errors were encountered:
RNTexts don't work as other regular RNObjects regarding coordinates.
You have to practice a little bit with them, at the moment , but it would be nice to have their coordinates to work exactly as a regular RNObject.
Also, you are right, at the moment width and height are not stored in RNTexts as accessible values to the user. This could be a fast / one line improvement.
Most objects have x, y as the center however RNText is using the top left corner of the textbox when set. For example the following code should make the text be centered at the bottom right corner of the screen but instead it is near the middle:
local clickOnTheScreen = RNFactory.createText("Click on the screen", { size = 30, top = 0, left = 0, width = 200, height = 60 })
clickOnTheScreen.x = RNFactory.width/2.0;
clickOnTheScreen.y = RNFactory.height/2.0;
As a side note it would be nice to figure out the width of the top, left, width and height for the user (though I know this is not easy.
The text was updated successfully, but these errors were encountered: