2022-12-12 21:56:04 -05:00
|
|
|
local playAreaApi = require("core/PlayAreaApi")
|
2022-11-11 02:59:55 -05:00
|
|
|
|
2022-11-30 06:11:07 -05:00
|
|
|
local UI_offset = 1.15
|
|
|
|
|
|
|
|
local buttonParamaters = {}
|
|
|
|
buttonParamaters.function_owner = self
|
|
|
|
buttonParamaters.label = ""
|
|
|
|
buttonParamaters.height = 500
|
|
|
|
buttonParamaters.width = 500
|
|
|
|
buttonParamaters.color = { 0, 0, 0, 0 }
|
2022-11-11 02:59:55 -05:00
|
|
|
|
2022-11-30 06:11:07 -05:00
|
|
|
function onLoad()
|
|
|
|
-- index 0: left
|
|
|
|
buttonParamaters.click_function = "shift_left"
|
|
|
|
buttonParamaters.tooltip = "Move left"
|
|
|
|
buttonParamaters.position = { -UI_offset, 0, 0 }
|
|
|
|
self.createButton(buttonParamaters)
|
2022-11-11 02:59:55 -05:00
|
|
|
|
2022-11-30 06:11:07 -05:00
|
|
|
-- index 1: right
|
|
|
|
buttonParamaters.click_function = "shift_right"
|
|
|
|
buttonParamaters.tooltip = "Move right"
|
|
|
|
buttonParamaters.position = { UI_offset, 0, 0 }
|
|
|
|
self.createButton(buttonParamaters)
|
|
|
|
|
|
|
|
-- index 2: up
|
|
|
|
buttonParamaters.click_function = "shift_up"
|
|
|
|
buttonParamaters.tooltip = "Move up"
|
|
|
|
buttonParamaters.position = { 0, 0, -UI_offset }
|
|
|
|
self.createButton(buttonParamaters)
|
|
|
|
|
|
|
|
-- index 3: down
|
|
|
|
buttonParamaters.click_function = "shift_down"
|
|
|
|
buttonParamaters.tooltip = "Move down"
|
|
|
|
buttonParamaters.position = { 0, 0, UI_offset }
|
|
|
|
self.createButton(buttonParamaters)
|
|
|
|
end
|
|
|
|
|
2022-12-12 21:56:04 -05:00
|
|
|
function shift_left(color) playAreaApi.shiftContentsLeft(color) end
|
2022-11-30 06:11:07 -05:00
|
|
|
|
2022-12-12 21:56:04 -05:00
|
|
|
function shift_right(color) playAreaApi.shiftContentsRight(color) end
|
2022-11-30 06:11:07 -05:00
|
|
|
|
2022-12-12 21:56:04 -05:00
|
|
|
function shift_up(color) playAreaApi.shiftContentsUp(color) end
|
2022-11-30 06:11:07 -05:00
|
|
|
|
2022-12-12 21:56:04 -05:00
|
|
|
function shift_down(color) playAreaApi.shiftContentsDown(color) end
|