Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: cypressx1 on July 08, 2011, 09:00:20 am

Title: setPen
Post by: cypressx1 on July 08, 2011, 09:00:20 am
l'm learning lua now. l've learnt a lot such as on.timer(),class()...l found that lua is much much better than the Ti-Basic.but l still have plenty of questions ??? so where do we use the setPen ? and what can it do ? Can you give me some examples? Thanks a lot.. :)
Title: Re: setPen
Post by: Munchor on July 08, 2011, 09:06:01 am
How are you learning Lua?

Either way, here's how setPen() works:

Quote
gc:setPen(thickness, smoothness) : thickness {“thin”, “medium”, "thick"}, smoothness {“smooth”, "dotted", "dashed"}

You use it in the on.paint() function for example:

Code: [Select]
function on.paint(gc)
    gc:setPen("thick", "dashed")
    gc:drawRect(10, 10, 30, 30)
end

The rectangle at (10,10) is drawn with a thick and dashed line, try it :)
Title: Re: setPen
Post by: cypressx1 on July 08, 2011, 09:28:49 am
oh! l see
just like setFont ,Right?!
--[[l'm learning lua by reading Ti's examples,books about lua ,and ...oclua...Just again and again..]]
Title: Re: setPen
Post by: Munchor on July 08, 2011, 09:31:35 am
I highly recommend you to check wiki.inspired-lua.org and inspired-lua.org

Indeed, just like setFont()