From 1f272c9d392cbfa435958601936576f7c9f8bc5d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 15 Nov 2023 09:02:22 -0800 Subject: [PATCH] mock up rest of menu bar and nav buttons --- 0021-draw_menu | 31 ++++++++++++++++++++++++++++++- 0027-Menu_background | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/0021-draw_menu b/0021-draw_menu index 58bb0df..5913b8b 100644 --- a/0021-draw_menu +++ b/0021-draw_menu @@ -1,13 +1,42 @@ draw_menu = function() App.color(Menu_background) love.graphics.rectangle('fill', 0,0, App.screen.width, Menu_bottom) - button(Editor_state, 'run', {x=Menu_left+5, y=Menu_top+5, w=App.width('Run')+10, h=Line_height, bg={r=0.5, g=0.8, b=0.5}, + -- main buttons + button(Editor_state, 'run', {x=Menu_left+5, y=Menu_top+5, w=App.width('Run')+10, h=Line_height, bg={r=0.6, g=0.8, b=0.6}, icon = function(p) App.color{r=0,g=0,b=0} + 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() print('run') end, }) + -- settings button on right + local w = App.width('settings') + button(Editor_state, 'settings', {x=Safe_width-w-10-5, 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{r=0,g=0,b=0} + 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() + print('settings') + end, + }) + -- nav buttons along sides + button(Editor_state, 'left', {x=0, y=Menu_bottom, w=Menu_left+30, h=App.screen.height, bg={r=0.5, g=0.5, b=0.5, a=0.2}, + icon = function(p) + App.color{r=0.4,g=0.4,b=0.4} + love.graphics.polygon('fill', Menu_left+5, App.screen.height/2, Menu_left+25, App.screen.height/2-10, Menu_left+25, App.screen.height/2+10) + end, + }) + local r = Menu_left + Safe_width + button(Editor_state, 'left', {x=r-30, y=Menu_bottom, w=100, h=App.screen.height, bg={r=0.5, g=0.5, b=0.5, a=0.2}, + icon = function(p) + App.color{r=0.4,g=0.4,b=0.4} + love.graphics.polygon('fill', r-25, App.screen.height/2-10, r-25, App.screen.height/2+10, r-5, App.screen.height/2) + end, + }) + end \ No newline at end of file diff --git a/0027-Menu_background b/0027-Menu_background index f6f5d83..14a3493 100644 --- a/0027-Menu_background +++ b/0027-Menu_background @@ -1 +1 @@ -Menu_background = {r=0.2, g=0.2, b=0.2} \ No newline at end of file +Menu_background = {r=0.6, g=0.8, b=0.6} \ No newline at end of file