Search in sources :

Example 1 with ActionConfig

use of com.b3dgs.lionengine.game.feature.ActionConfig in project lionengine by b3dgs.

the class UtilActionnable method createAction.

/**
 * Create a default action.
 *
 * @param description The description.
 * @param area The button.
 * @return The temp media.
 */
public static Media createAction(String description, Area area) {
    final Media media = Medias.create("action.xml");
    final String name = "name";
    final ActionConfig action = new ActionConfig(name, description, (int) area.getX(), (int) area.getY(), area.getWidth(), area.getHeight());
    final Xml root = new Xml("test");
    root.add(ActionConfig.exports(action));
    root.save(media);
    return media;
}
Also used : ActionConfig(com.b3dgs.lionengine.game.feature.ActionConfig) Xml(com.b3dgs.lionengine.Xml) Media(com.b3dgs.lionengine.Media)

Aggregations

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