use of com.b3dgs.lionengine.game.ActionConfig in project lionengine by b3dgs.
the class UtilActionnable method createAction.
/**
* Create a default action.
*
* @param description The description.
* @param rectangle The button.
* @return The temp media.
*/
public static Media createAction(String description, Rectangle rectangle) {
final Media media = Medias.create("action.xml");
final String name = "name";
final ActionConfig action = new ActionConfig(name, description, (int) rectangle.getX(), (int) rectangle.getY(), rectangle.getWidth(), rectangle.getHeight());
final Xml root = new Xml("test");
root.add(ActionConfig.exports(action));
root.save(media);
return media;
}
Aggregations