
button {
    border_width = border_width(15.0),
    border = border_image("ui/button", 15, 15, true),
    shadow = shadow(2.0, 2.0, rgba(0, 0, 0, 0.3), 3.0, 0.0, "outset"),
    layout = "center",
    can_hover = true,

    on_init = "init#
        node:set_property_float('$time', 0.0)
        node:set_property_float('$direction', -1.0)
    ",
    on_mouse_move_over = "ui.button#
        move_over(node, evt)
    ",
    on_mouse_move_out = "ui.button#
        move_out(node, evt)
    ",
}
button(animate=true) {
    on_update = "ui.button#update(node, evt)",
}

button(theme="blueprint") {
    border_width = border_width(15.0),
    border = border_image("ui/button", 15, 15, true),
    tint = rgba(0, 255, 255, 0.4),
}

button(x=x) {
    x = x,
}

button(y=y) {
    y = y,
}

button(bottom=y, height=height) {
    y = parent_height - y - height,
}

button(right=x, width=width) {
    x = parent_width - x - width,
}

button(width=width, height=height) {
    width = width,
    height = height,
}

button(on_click=click) {
    on_mouse_up = list(click, "init#
        audio.play_sound('click')
        return true
    "),
}

button(ani_offset=o, shadows_active=true) {
    shadow = shadows(
        shadow(2.0, 2.0, rgba(0, 0, 0, 0.3), 3.0, 0.0, "outset"),
        shadow(0.0, 0.0, rgba(255, 255, 0, 0.5 * o), 16.0, 0.0, "outset"),
        shadow(0.0, 0.0, rgba(255, 255, 0, 0.6 * o), 16.0, 0.0, "inset")),
}

button(disabled=true) {
    on_mouse_up = "init#return true",
    border = border_image("ui/button_tint", 15, 15, true),
    tint = rgb(0.6, 0.6, 0.6),
}

button > content {
    layout = "lined",
    line_height = parent_height,
    width = parent_width,
    word_wrap = false,
}

button > content > @text {
    font_size = parent_height - (parent_height/5),
    font_color = rgb(0, 0, 0),
}
button(ani_offset=o) > content > @text {
    font_size = float(parent_height) - (float(parent_height)/(5.0 + o * 2.0)),
    font_color = rgb(int(68.0 * o), 0, int(38.0 * o)),
}

button(theme="blueprint") > content > @text {
    font_color = rgb(255, 255, 0),
    text_shadow = text_shadow(1.0, 1.0, "#000000", 1.0),
}
button(disabled=true, theme="blueprint") > content > @text {
    font_color = rgb(120, 120, 0),
    text_shadow = text_shadow(1.0, 1.0, "#ffffff", 1.0),
}

button(theme="blueprint", ani_offset=o) > content > @text {
    font_color = rgb(int(255.0*(1.0 - o)), int(255.0*(1.0 - o)), 0),
    text_shadow = text_shadow(1.0, 1.0, rgb(int(255.0*o), int(255.0*o), 0), 3.0),
}