My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
FrameLayout  
A frame layout is a reserved area on the screen in which the elements are positioned.
Updated Dec 20, 2009 by tom.verg...@gmail.com

Description

A 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

Example

public 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"));
	}
}
Powered by Google Project Hosting