Using HTML + CSS + JS to build libGDX UI!
η¨HTML+CSS+JSζε»ΊlibGDXηUI!
Stage stage = HTMLStage.buildPath(path-to-html-file);
//done!
(In order to be compatible with css properties, some heavy-performance-cost hack tricks have been used)
- π width (px / em)
- π height (px / em)
- π padding (padding-left / right / top / bottom)
- π margin (margin-left(auto) / right(auto) / top / bottom)
- π font-size (px)
- π color (color-name / hex / rgb / rgba)
- π text-align (left / center / right)
- β€οΈ line-height (px)
- β€οΈ letter-spacing (px)
- π -gdx-markup (true)
- β€οΈ -gdx-wrap (true / false)
- π <img src="..." />
- π -gdx-image-scaling
-
Image is loaded asynchronously by default, which does not block the rendering of html, but when the Image is loaded, it will be re-layout, which will make the whole interface flash and affect performance. If your image is not very large, set <img async="false" src="..." /> and then becomes synchronous load. You can also preset a fixed width and height for the Image.
-
- π background-color (color-name / hex / rgb / rgba)
- π background-image
- π background-position
- π background-size
- π position: static
- π position: relative
- π position: absolute
- π position: fixed
- π position: sticky
- π display: inline
- β€οΈ display: inline-block
- β€οΈ display: block
- π display: table
- π <table /> with display: table
- π <tr /> with display: table-row
- π <td /> <th /> with display: table-cell
- π vertical-align
- π font-family
- π border
- π Nope, float is SHIT.
- π :hover
- π :active
- π :lt / :gt / :eq / :first-child / :last-child
- π :has(selector) / :not(selector)
- π :contains(text)
- π See link to visit all support selectors / pseudo selectors
- π Coming soon.
- π Coming soon.
- π π π
- This project is expected to be too large, I need contributors. Please help us.
- mailto: dingjibang@qq.com
- QQ: 1406547525