Skip to content

Latest commit

History

History

lml

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

LibGDX Markup Language

Templates for LibGDX Scene2D with HTML-like syntax and FreeMarker-inspired macros.

Examples

Seegdx-lml-testsfor example uses of all available tags and macros.

Check it outon-line.

Documentation

SeeLibGDX forum thread,example project,tutorialandDTD schema section.

Extensions

VisUIsyntax support is available throughgdx-lml-vis library.Additionally to replacing standard Scene2D actors with improved VisUI widgets, it offers full support for other VisUI features - including color picker, file chooser, other new widgets, listeners and validators.

Check it outon-line.

Dependencies

gdx-lmlis available through the official project creator tool:gdx-setup(in third party extensions). However, its version might not be up to date.

To import LML withGradle,add this dependency to your core project:

compile "com.crashinvaders.lml:gdx-lml:$libVersion.$gdxVersion"

$libVersionis the current version of the library, usually followingMAJOR.MINORschema.$gdxVersionis the LibGDX version used to build (and required by) the library. You can check the current library versionhere- or you can use thesnapshots.

If you want to use LML with GWT, you have to add this module to yourGdxDefinition:

<inherits name='com.github.czyzby.lml.GdxLml' />

What's new

1.8 -> 1.9

  • Fixed string to upper/lower case conversions that caused issues with some default locales.
  • elseconditional tags did not accept whitespaces. Now a single space can be optionally used inelsetags. For example,<if:else />is a valid conditional tag.
  • LmlApplicationListenerno longer tries to pause a view on application resume.
  • @LmlActornow supports field injection by field name. If no actor ID is passed to the annotation, field name will be used instead to select the actor. Note that this approach is prone to refactoring and obfuscation of the code.
  • @LmlActionnow supports field access and method invocation by name. If no action IDs are passed, field/method name will be used as action ID instead. Note that this approach is prone to refactoring and obfuscation of the code.

1.7 -> 1.8

  • Added<:random>macro, which allows to choose a random value from the passed array.
  • Added LML style sheets support. See wiki for more info.
  • Added<:style>macro, which allows to set default values of tag attributes at runtime, similarly to LML style sheets.
  • Added<:importStyleSheet>macro, which allows to import LML style sheet file from within LML templates.
  • Added missingprogrammaticChangeEventsattribute to all button tags.
  • Added support for<container>pad-related attributes, even when outside of<table>tag.
  • SelectBoxinstances now can store any type of objects.

1.6 -> 1.7

  • A new mechanism - isolation - was introduced through<isolate>tag. Isolated actors are parsed along with the rest of the templates, but are not immediately added to stage or they tag parents. This basically allows to create actors with LML without adding them to the stage - something that previously wasn't achievable withfillStageorcreateViewmethods.ActorStorageis anActorextension that keeps track of a list of actors, but does not draw them in any way: this actor is used internally by isolation tags and can be injected if you want to access the list of its parsed children actors.
  • Lml#EXTRACT_UNANNOTATED_METHODSsetting added. When this is set tofalse,ActionContainermethods and fields that arenotannotated with@LmlActionwill not be available in LML templates. Defaults totrue,but if you consequently annotate methods and fields that are accessed by LML actors, you should consider setting this value tofalse,as it will considerably speed up method look-up time.
  • DefaultLmlSyntax.INSTANCEwas removed. It was entirely unnecessary when using a different syntax, likeVisLmlSyntax.
  • DefaultLmlSyntaxnow extendsEmptyLmlSyntax.EmptyLmlSyntaximplements allLmlSyntaxinterface methods and manages all tag, attribute and macro mechanisms internally, but registers no tags or attributes on its own. This can be a very useful utility class if you want to manually choose which tags, macros and attributes should be supported.
  • Added conditions evaluating in arguments, similarly to how you can evaluate equations{=likeThis}.Using this syntax:{? condition? onTrue: onFalse},you can process simple conditions anywhere in the code. See new condition syntax examples ingdx-lml-testsandgdx-lml-vis-testsprojects.
  • Added:cellmacro. Adds an empty cell to the chosen table and allows to parse any cell attributes. Useful if you need to preserve a certain table layout, but do not want to create unnecessary mock-up actors with the sole purpose to fill a cell.

Archive

Older change logs are available inCHANGES.mdfile.