make button backgrounds optional
Dependencies
- [2]
MXXCTVXWdocument facilities for buttons on screen - [3]
EDWRWZRVuse color alpha in button backgrounds - [4]
N2NUGNN4include a brief reference enabling many useful apps - [5]
54HEXCWVclearer API for drawing a button - [6]
GJ4LBCIEstreamline button.lua - [7]
C2M4RUU5reorganize some comments - [8]
XX7G2FFJintermingle freehand line drawings with text - [9]
PP2IIHL6stop putting button state in a global - [10]
BZHJNMDNdocument some editor constants - [11]
H5UZI3YNeditor documentation - [12]
GZ5WULJVswitch source side to new screen-line-based render - [*]
KKMFQDR4editing source code from within the app
Change contents
- replacement in source_text.lua at line 37
button(State, 'link', {x=State.left+lo, y=y, w=hi-lo, h=State.line_height, bg={r=1,g=1,b=1},button(State, 'link', {x=State.left+lo, y=y, w=hi-lo, h=State.line_height, - replacement in reference.md at line 280
button(state, name, {x=..., y=..., w=..., h=..., color={r,g,b},button(state, name, {x=..., y=..., w=..., h=..., bg={r,g,b}, - replacement in reference.md at line 286
Call this either directly or indirectly from `App.draw`. It will paint arectangle to the screen with top-left at (x,y), dimensions w×h pixels in thespecified `color`. It will then overlay any drawing instructions within`icon` atop it. The `icon` callback will receive a table containing the samex/y/w/h.Call this either directly or indirectly from `App.draw`. It will assign arectangle with the given dimensions and trigger the provided (zero-arg)`onpress1` callback when the primary mouse button is clicked within.It will also optionally paint the rectangle with the specified backgroundcolor `bg` and a foreground described by the `icon` callback (which willreceive the same dimensions). - replacement in reference.md at line 293
The rectangle also registers within `state` the `onpress1` callback (withoutany arguments) when mouse button 1 is clicked on it. This way you can seeeverything about a button in one place. Create as many buttons as you likewithin a single shared `state`.This way you can see everything about a button in one place. Create as manybuttons as you like within a single shared `state`. - replacement in button.lua at line 12
love.graphics.setColor(params.bg.r, params.bg.g, params.bg.b, params.bg.a)if params.bg thenlove.graphics.setColor(params.bg.r, params.bg.g, params.bg.b, params.bg.a)end