infrastructure for caching LÖVE text objects
[?]
Aug 24, 2022, 8:27 PM
2Y7YH7UPQWDNYDJN4BYY2MOHA36B2BIRX6DMIAKHJPQC7UP2R6NQCDependencies
- [2]
H6QZ7GRRmore precise name - [3]
VHQCNMARseveral more modules - [4]
P4376EXKadd state arg to few functions - [5]
LF7BWEG4group all editor globals - [*]
OTIBCAUJlove2d scaffold - [*]
UHB4GARJleft/right margin -> left/right coordinates - [*]
3QQZ7W4Ebring couple more globals back to the app level - [*]
JRLBUB6Lmore intuitive point delete from polygons - [*]
2L5MEZV3experiment: new edit namespace
Change contents
- edit in main.lua at line 18
-- a few text objects we can avoid recomputing unless the font changesText_cache = {} - edit in main.lua at line 210[10.331]
-- use this sparinglyfunction to_text(s)if Text_cache[s] == nil thenText_cache[s] = App.newText(love.graphics.getFont(), s)endreturn Text_cache[s]end - edit in help.lua at line 149
_bullet_indent = nil - replacement in help.lua at line 150
if _bullet_indent == nil thenlocal text = love.graphics.newText(love.graphics.getFont(), '* ')_bullet_indent = text:getWidth()endreturn _bullet_indentreturn App.width(to_text('* ')) - edit in edit.lua at line 470
Text_cache = {}