Author Topic: setPen  (Read 2870 times)

0 Members and 1 Guest are viewing this topic.

Offline cypressx1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 45
  • Rating: +0/-0
    • View Profile
setPen
« 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.. :)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: setPen
« Reply #1 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 :)
« Last Edit: July 08, 2011, 09:06:12 am by ephan »

Offline cypressx1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 45
  • Rating: +0/-0
    • View Profile
Re: setPen
« Reply #2 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..]]

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: setPen
« Reply #3 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()