2Tv˜ºÜþåîî^ÞÝÍìÞîîìÞîîíÞîîíþîîíþßÝíåîî^åîî^ÞÝÍìÞíÞìÞîîíÞîîíþíÞíþßÝíåîî^åîî^þÞÍìþîÝìþïÞíÿîíðïîÿïåîî^åîîîÎÜÝÝÎÝÎÝÞíîÝÞîÞÝÞïÝýÞÝÝÿåîîîåîîîÎÜÝÝÎÞÞÞÞÝÝÝÞÝÝÝÞííýÞÝÝÿåîîîåîî^ÎÜÝíÎíÞíÞîîíÞíÞíÞíÞïÞÝýïåîî^ >À?3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333D33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333CD4CD4DD3D34CD4CD4D13333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333D4AD4D14AD13333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333D3CD1CDCD4D33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333CD4CDD131CDDDD13333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331333113333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333#"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""3333333333333333333333333333333333# 3333333333333333333333333ãîî>33333# 3333333333333333333333333ÎÜÝí33333# 3333333333333333333333333ÎíÞí33333# 3333333333333333333333333Þîîí33333# 3333333333333333333333333ÞíÞí33333# 3333333333333333333333333ÞíÞï33333# 3333333333333333333333333ÞÝýï33333# 3333333333333333333333333ãîî>33333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333D33333333333333333333# 3333333CD4CD3D13D4CD43DD3333333333# 3333333DD4D1CACACD1333333333# 3333333D3D1D1CCA31AD3333333333# 3333333CD4CDCD3D4A3CD1333333333# 3333333331313333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 333"""""""""""""""""""""""""333333# 333!""233CDDTUUeffvww'333333# 333!""233CDDTUUeffvww'333333# 333!""233CDDTUUeffvww'333333# 333!""233CDDTUUeffvww'333333# 333!""233CDDTUUeffvww'333333# 333!""233CDDTUUeffvww'333333# 333‚ˆˆ˜™™©ªªº»»ËÌÌÜÝÝíîîþÿÿ/333333# 333‚ˆˆ˜™™©ªªº»»ËÌÌÜÝÝíîîþÿÿ/333333# 333‚ˆˆ˜™™©ªªº»»ËÌÌÜÝÝíîîþÿÿ/333333# 333‚ˆˆ˜™™©ªªº»»ËÌÌÜÝÝíîîþÿÿ/333333# 333‚ˆˆ˜™™©ªªº»»ËÌÌÜÝÝíîîþÿÿ/333333# 333‚ˆˆ˜™™©ªªº»»ËÌÌÜÝÝíîîþÿÿ/333333# 333"""""""""""""""""""""""""333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333C43333333D33333333333333333# 3333333DD4CD3CD3D13DD3333333333333# 3333333CD4D4D1CD1333333333333# 3333333C3D1D1D13AD3333333333333# 33333333D4CDCDCDCD1333333333333# 333333333131313333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 33333333333333333333333333ãîîî3333# 33333333333333333333333333ÎÜÝÝ3333# 33333333333333333333333333ÎÞÞÞ3333# 33333333333333333333333333ÞÝÝÝ3333# 33333333333333333333333333ÞÝÝÝ3333# 33333333333333333333333333Þííý3333# 33333333333333333333333333ÞÝÝÿ3333# 33333333333333333333333333ãîîî3333# 3333333333333333333333333333333333# 33333333333333333333333333ãîîî3333# 33333333333333333333333333ÎÜÝÝ3333# 33333333333333333333333333ÎÝÎÝ3333# 33333333333333333333333333ÞíîÝ3333# 33333333333333333333333333ÞîÞÝ3333# 33333333333333333333333333ÞïÝý3333# 33333333333333333333333333ÞÝÝÿ3333# 33333333333333333333333333ãîîî3333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333C43333333D33333333333333# 33333DD3D4C3CD3DD3D13333333333333# 3333CDAAC3D4D413333333333333# 3333CD1CCA3D1D1D33333333333333# 33333DD3D41D4CDD13D13333333333333# 3333313311313333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 3333333333333333333333333333333333# 333"""""""""""""""""""""""""333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333# 333 333333#"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""333 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333"""""""""""""""""""""""""33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333T-- title: painTic -- author: Rk_80 -- desc: a paint tool for tic80 -- site: rpage.cf -- license: MIT License -- version: 1.0 -- script: lua| spec = {x=240, y=138,cols=15, scn=1} brush = {type=1, col=0, size=2} inp = {x=0, y=0, lc=false, rc=false,scy=0} function input() local x,y,l,s,r,sx,sy=mouse() inp.x=x inp.y=y inp.lc=l inp.rc=r inp.scy=sy end function canvas() if inp.lc then --circle brush if brush.type==0 then circ(inp.x,inp.y,brush.size,brush.col) end --scuare brush if brush.type==1 then local amin = {x=inp.x-brush.size/2,y=inp.y-brush.size/2} rect(amin.x,amin.y,brush.size,brush.size,brush.col) end end end function tools() --color picker if inp.rc then brush.col=pix(inp.x,inp.y) end --brush size brush.size=brush.size+inp.scy if brush.size<0 then brush.size=0 end end function m_over(x,y,ex,ey) local mov=false if inp.x>=x and inp.x<=ex then if inp.y>=y and inp.y<=ey then mov=true else mov=false end end return mov end function colsinterface() --yellow borders rect(0,0,spec.x,10,3) rect(0,spec.y-12,spec.x,12,3) rect(0,0,10,spec.y,3) --color pallete spr(0,spec.x-53,40,16,6) rect(spec.x-53,spec.y-50,48,39,brush.col) rect(spec.x-60,0,spec.x,40,3) rect(spec.x-60,52,spec.x,50,3) rect(spec.x-60,40,7,90,3) rect(spec.x-5,40,8,90,3) --==========borders============= rectb(9,9,spec.x-69,spec.y-21,2) rectb(spec.x-54,39,50,14,2) rectb(spec.x-54,101,50,27,2) --TeEeEeeeeXT print("colors",spec.x-45,30,1) print("colors",spec.x-46,29,4) print("color:",spec.x-50,spec.y-45,1) print("color:",spec.x-51,spec.y-46,4) print("tools",spec.x-45,59,1) print("tools",spec.x-46,58,4) --important thing spr(8,spec.x-10,10,5) if m_over(spec.x-10,10,spec.x-10+8,18) and inp.lc then cls(brush.col) end end function helpinterface() rect(10,10,spec.x-20,spec.y-20,13) rectb(10,10,spec.x-20,spec.y-20,14) --TexTTTT print("Welcome to PainTic!",70,20,15) print("Right click = Color Picker",40,40,15) print("left click = Draw",40,50,15) spr(8,90,65,5) print("Fill the screen",40,75,15) print("with the selected color",40,85,15) end function toolsinterface() --yellow borders rect(0,0,spec.x,10,3) rect(0,spec.y-12,spec.x,12,3) rect(0,0,10,spec.y,3) rect(spec.x-60,0,60,spec.y,3) --==========borders============= rectb(9,9,spec.x-69,spec.y-21,2) --tools print("tool",spec.x-44,30,1) print("tool",spec.x-45,29,4) spr(1,spec.x-30,40,5) spr(2,spec.x-40,40,5) --brush selector print("Tool:",spec.x-41,spec.y-55,1) print("Tool:",spec.x-40,spec.y-56,4) print("Size:",spec.x-41,spec.y-25,1) print("Size:",spec.x-40,spec.y-26,4) print(brush.size,spec.x-41,spec.y-15,1) print(brush.size,spec.x-40,spec.y-16,4) if brush.type==0 then print("Circle",spec.x-41,spec.y-45,1) print("Circle",spec.x-40,spec.y-46,4) end if brush.type==1 then print("Scuare",spec.x-41,spec.y-45,1) print("Scuare",spec.x-40,spec.y-46,4) end if m_over(spec.x-30,40,spec.x-30+8,48) and inp.lc then brush.type=1 end if m_over(spec.x-40,40,spec.x-40+8,48) and inp.lc then brush.type=0 end --end brush selector end function scenes() --colors interface if spec.scn==1 then colsinterface() end if spec.scn==0 then toolsinterface() end --buttons if m_over(spec.x-8,spec.y-60,spec.x,spec.y-53) and inp.lc then spec.scn=0 end if m_over(spec.x-8,spec.y-69,spec.x,spec.y-61) and inp.lc then spec.scn=1 end spr(5,spec.x-8,spec.y-60,5) spr(6,spec.x-8,spec.y-69,5) --end buttons print("canvas:",3,3,1) print("canvas:",2,2,4) end function TIC() --i call it the draw order canvas() input() tools() scenes() if spec.scn==2 and inp.lc then spec.scn=1 cls(0)end end function BOOT() cls(0) helpinterface() spec.scn=2 end