alert()

Type    

function

[gd]

Return

Group object


Overview

Creates alert window that has message text and confirm button


See also

Group, Display



Syntax


alert(message)

alert(message, option)

alert(message, func)

alert(message, func, option)


  • message (required : string )  message text


  • func (optional : function )  callback function called when button is pushed


  • option (optional : table) = {


fontSize = n -- font size of value (default: 50)

textColor = color -- message text color (default: Color.WHITE)

bgColor = color,        -- background color (default : Color.BLUE)

strokeColor = color,   -- border line color (default:Color.ROYAL_BLUE)

strokeWidth = n, -- border line width (default : fontsize*0.15)

popupTime = n, -- popup time in millisecond (default: 150 ms)

verticalMargin = n,  -- margin from upper/lower boundary to contents in pixel


sideMargin = n   -- margin from left/right boundary to contents in pixel

buttonText = string -- text in the confirm button

width = n -- width of alert window in pixel

height = n -- height of alert window in pixel


}



Examples


alert('Game Over')


alert('Warning!'):setXY(500,500)



alert("Game Over", {fontSize=100})


alert("Game Over", function()

    print("goto start scene")

end)



alert("Game Over", function()

    print("confirmed")

end, {

    fontSize=60,

    textColor=Color.RED,

})

댓글 없음:

댓글 쓰기