extract a second helper for buttons
Dependencies
- [2]
5JMR2IJSbugfix: save settings on mobile devices - [3]
SIJ5I4NZextract a helper for buttons - [4]
YS4AQXJChide other menus when opening one - [5]
I52S4E5Frunning `print` now appends to output editor - [6]
FPSPT5TMshow current pane number - [7]
GWLETNMWMike's suggested button layout - [8]
5MEJ7XNHlay out buttons based on device dimensions - [9]
RK2ASPN7add lots of buttons to the toolbar - [10]
JV27LDDKsliders for font size and color settings - [11]
QGSOEM7Zbugfix: 'show' button layout - [*]
R5QXEHUIsomebody stop me
Change contents
- file addition: 0124-styled_button[13.2]
styled_button = function(name, x, y, onpress1)local w = App.width(name)+10button(Global_state, name, {x=x, y=y, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print(name, p.x+5,p.y+2)end,onpress1 = onpress1,})end - edit in 0118-overflowable_button at line 1
-- draw a button in the menu if possible-- if not, stash it behind an overflow ('>>') button - replacement in 0118-overflowable_button at line 14
button(Global_state, name, {x=x, y=y, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print(name, p.x+5,p.y+2)end,onpress1 = onpress1,})styled_button(name, x,y, onpress1) - replacement in 0109-overflow_button at line 2
local w = App.width('>>')+10button(Global_state, 'overflow', {x=x, y=y, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print('>>', p.x+5,p.y+2)end,onpress1 = function()styled_button('>>', x,y,function() - replacement in 0109-overflow_button at line 6
end,})end) - edit in 0106-stop_button at line 2
styled_button('stop', x,y, clear_handlers) - edit in 0106-stop_button at line 4
button(Global_state, 'stop', {x=x, y=y, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print('stop', p.x+5,p.y+2)end,onpress1 = clear_handlers,}) - replacement in 0072-settings_button at line 2
button(Global_state, 'settings', {x=x, y=Menu_top+5, w=w+10, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print('settings', p.x+5,p.y+2)end,onpress1 = function()styled_button('settings', x, Menu_top+5,function() - replacement in 0072-settings_button at line 10[4.169]→[4.1705:1716](∅→∅),[2.180]→[4.1705:1716](∅→∅),[4.5557]→[4.1705:1716](∅→∅),[4.1705]→[4.1705:1716](∅→∅)
end,})end) - replacement in 0051-run_button at line 2[4.3980]→[4.405:436](∅→∅),[4.56]→[4.405:436](∅→∅),[4.436]→[4.3981:4067](∅→∅),[4.182]→[4.149:255](∅→∅),[4.4067]→[4.149:255](∅→∅),[4.149]→[4.149:255](∅→∅),[4.255]→[4.437:480](∅→∅),[4.480]→[4.298:329](∅→∅),[4.298]→[4.298:329](∅→∅)
local w = App.width('run')+10button(Global_state, 'run', {x=x, y=y, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print('run', p.x+5,p.y+2)end,onpress1 = function()styled_button('run', x,y,function() - replacement in 0051-run_button at line 28
end,})end)local w = App.width('run')+10