Mar 3, 2011
I want to create a panel (or any other component) inside a component that has a 5 pixel border on all sides, but scales fully when the window is resized. I know I can set width to "100%" to make it resize, but that gives me no borders. If I put it to "95%",I have borders, but they scale annoyingly. Also, that only works for borders on the right or lower bounds, and not to the left or upper sides.Is there a convenient way to do this without having to write tons of resize-code (in which case I will not bother and just accept bad rescale behaviour, as it is for a private pet project).
View 1 Replies
EDIT: I know that I can just overwrite the display handling and set the positions manually every frame. I wondered if there is a cheap way to do it in the mxml-structure, along these lines:
Coming from C++ and Java, I am intrigued by the option of setting something to "95%" and let the library work out the details, instead of having to write many lines of code, just so my text-area always keeps a 5 pixel distance from the border, but scales with window width.If there is no easier way to do it than figuring out pixel sizes by hand and setting the coordinates.