This README is just an overview document. You can find more detailed documentation within the repo in future updates.
What is material-ui?
A loosely based Material UI library for Corona Labs SDK. It is written in Lua using the free edition of the SDK. The library will help build a UI based on Material Design.
Requires Corona SDK build 2017.3135 or greater.
Supports: iOS 9+, Android 6.x+ and other Corona SDK supported platforms.
Read config.lua to copy to your config.lua the "MUI SET UP" section and also follow the 'content' section for specifying width and height.
Using material-ui
Warning: The latest update could break your code if you used an older copy. I have not updated the documentation yet. I will get it updated :).
If using the GitHub repo, edit your scene file and be sure to include at the top:
local mui = require( "materialui.mui" )
local muiData = require( "materialui.mui-data" )
In the scene create function add in the initializer and any user-interface elements
mui.init()
mui.newRoundedRectButton({
name = "newGame",
text = "New Game",
width = 150,
height = 30,
x = 100,
y = 100,
font = native.systemFont,
fillColor = { 0, 0.82, 1 },
textColor = { 1, 1, 1 },
callBack = mui.actionForButton
})
In the scene destroy function add in the destroy method to remove all user-interface elements in the scene.
mui.destroy()
Building for Device
Due to device keyboard possibly covering up input fields, be sure to include "coronaWindowMovesWhenKeyboardAppears=true" into iOS settings->iphone->plist table and Android settings.
请发表评论