Search in sources :

Example 1 with ActionConfig

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;
}
Also used : ActionConfig(com.b3dgs.lionengine.game.ActionConfig) Xml(com.b3dgs.lionengine.io.Xml) Media(com.b3dgs.lionengine.Media)

Aggregations

Media (com.b3dgs.lionengine.Media)1 ActionConfig (com.b3dgs.lionengine.game.ActionConfig)1 Xml (com.b3dgs.lionengine.io.Xml)1