Lemur 9 patch scaling with TbtQuad constructor

I’m trying to figure out how to use the TbtQuad for a simple texture scaling label, but I don’t understand the constructor. I understand the docs, but the docs don’t line up with the source it seems.

The TbtQuad constructor takes in a width, height, x1,y1, x2,y2, imageWidth, imageHeight, imageScale. What are the width and height parameters for? I thought they might define the actual width and height to scale to, but that doesn’t make sense because the actual GUI element should dictate that given it’s input text or whatever.

And for that matter, how does the other simpler constructor work? It just takes in a width and height.

I’m sorry I’m confused about this stuff; it seems simple enough.

TbtQuad exists on its own and thus must have a width and a height… that’s what the width and height are. The same thing they would be for a regular quad.

When the TbtQuad is used by the GUI elements then it is resized as needed.

The simpler constructor simply sets the texture coordinates and the ‘folds’ to thirds making it an evenly subdivided 9-patch.

If you are using this for a label then I guess you should really be looking at the TbtQuadBackgroundComponent and just use one of its static create() methods.

Aaah the create method is what I’m looking for! I guess I got tunnel vision while looking at the docs. Thanks for the speedy response.

Heheh… you’re welcome. After all, it is right there in my name. :slight_smile: