term.clear() os.loadAPI("Apis/DesignUtil") os.loadAPI("Apis/AccountSytem") DesignUtil.setDesign("whiteLightGray") local backGround,topBar=DesignUtil.getDesign() local drawO1=false; term.setTextColor(colors.black) local O1B= { text="O1|"; x=1; y=1; W=math.ceil(3); H=math.ceil(1); } local O1Menu = { line1text="About this device"; line1x=1; line1y=2; line1W=18; line1H=1 } function drawO1Menu() while drawO1==true do term.setCursorPos(O1Menu.line1x,O1Menu.line1y) print(O1Menu.line1text) sleep(0.15) end end function registerClick(x,y) if x > O1B.x and x < O1B.x + O1B.w - 1 and y > O1B.y and y < O1B.y + O1B.h then drawO1=not drawO1 end end while true do paintutils.drawImage(backGround,1,1) paintutils.drawImage(topBar,1,1) term.setCursorPos(1,1) print(O1B.text) event, button, xPos, yPos = os.pullEvent("mouse_click") print(x..y) registerClick(xPos,yPos) drawO1Menu() sleep(0.15) end
heres the code, the problem is that registerClick OR drawO1Menu are not working somehow, when I click on the text, the menu wont be drawn. What is the issue & how to fix?