function _init() texts = { {"press down to","see more text","about me"}, {"notice the window is", "changing to dynamically", "contain the content"}, {"it is also", "centered"}, {"it's only 115 tokens"}, {"plus one token","for every panel"}, {"and one for each", "line inside the panel"}, {"and you can even go so","far as filling the", "entire screen up", "with whatever combination", "of characters you prefer"}, {"pretty neat, huh?"}, {"just be careful with 😐","and other icons"}, {" "}, } text_select = 1 end function _update() if (btnp(2)) then text_select-=1 end if (btnp(3)) then text_select+=1 end if (text_select>#texts) then text_select = 1 end if (text_select<1) then text_select = #texts end end function _draw() cls(14) pal(14,128,1) if (text_select) then text_window(text_select) end end function text_window(text_id) local t_length local lines = texts[text_id] for line in all(lines) do t_length = max(t_length, #line) end left = 64-t_length*2 top = 64-#lines*3 rectfill(left-3, top-3, left+(t_length*4)+2, top+(#lines*6)+1, 0 ) rect(left-2, top-2, left+(t_length*4)+1, top+(#lines*6), 9 ) for key,line in pairs(lines) do cursor(64-#line*2, top+key*6-6, 6) print(line) end end