|
FrameLayout
A frame layout is a reserved area on the screen in which the elements are positioned.
DescriptionA frame layout is a reserved area on the screen in which the elements are positioned according to the assigned gravity. All elements are printed with their center anchor on the location of the first element found in the group. Inspired by http://developer.android.com/reference/android/widget/FrameLayout.html Examplepublic class TestScene extends Scene2D
{
@Override
public void load()
{
// add a frame layout stretched over the entire stage and print elements in it's center.
FrameLayout layout = new FrameLayout(Stage.getWidth(), Stage.getHeight());
add(layout);
// Add 2 buttons to the layout
layout.add(ButtonFactory.createLabeledButton("First button"));
layout.add(ButtonFactory.createLabeledButton("Second"));
}
}
|