I have a problem with text overriding each other..

Here is my code:

function groupTextUpdate() if group[i].amountText.width \> maxWidthForMaara then group[i].amountText.xScale = group[i].amountText.xScale / group[i].amountText.width \* maxWidthForMaara group[i].amountText.yScale = group[i].amountText.yScale / group[i].amountText.width \* maxWidthForMaara maxWidthForMaara = group[i].amountText.width end if group[i].costText.width \> maxWidthForMaara then group[i].costText.xScale = group[i].costText.xScale / group[i].costText.width \* maxWidthForMaara group[i].costText.yScale = group[i].costText.yScale / group[i].costText.width \* maxWidthForMaara maxWidthForMaara = group[i].costText.width end group[i].amountText.text = "["..comma\_value(settings.m.group[i].amount).."]" group[i].costText.text = ""..translations["SHORT\_K"][settings.m.language].." "..comma\_value(settings.m.group[i].cost).."" end groupTextUpdate()

Is there anything wrong with it because this is what I get in the simulator:

I do not get any errors though.

See that, it goes over the border. Can you all help me?

Difficult to tell as we don’t know what maxWidthForMaara is initially. 

It is display.contentWidth / 2.6

Ok, so is that the same widith as your rectangle above? If you want to keep it within the bounds of that, test against the width of the rectangle (minus a few pixels to leave a gap either side).

Thanks. I debugged it successfully!

Difficult to tell as we don’t know what maxWidthForMaara is initially. 

It is display.contentWidth / 2.6

Ok, so is that the same widith as your rectangle above? If you want to keep it within the bounds of that, test against the width of the rectangle (minus a few pixels to leave a gap either side).

Thanks. I debugged it successfully!