[Help]drawLine

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
N00b
Posts: 9
Joined: Sat Dec 24, 2005 4:49 am

[Help]drawLine

Post by N00b »

How do you write this code "nil image:drawLine(x0, y0, x1, y1, [color = black])"
link
Posts: 61
Joined: Wed Oct 19, 2005 6:17 am

Re: [Help]drawLine

Post by link »

N00b wrote:How do you write this code "nil image:drawLine(x0, y0, x1, y1, [color = black])"
the x0, and y0 are your starting points adn x1, and y1 are your end points.

so if you want a line from 10, 10 to 100, 100 you go

image:drawLine(10, 10, 100, 100, [color = black])
00100000 01101001 01101101 00100000 01110010 01101001 01100111 01101000 01110100 00100000 01100010 01100101 01101000 01101001 01101110 01100100 00100000 01111001 01101111 01110101 00100001
N00b
Posts: 9
Joined: Sat Dec 24, 2005 4:49 am

Post by N00b »

that I know but wen i try to run my script

Code: Select all

white = Color.new(255,255,255)

image:drawLine(10, 10, 100, 100, white)
it's gives me a error! can someone explan how to setup a full working script!?
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

white = Color.new(255,255,255)

Image can be screen so try (that way you are not drawing on a nill value)
screen:drawLine(10, 10, 100, 100, white)

otherwise you have to do
image = Image.createEmpty(width, height)
image:drawLine(10, 10, 100, 100, white)
User avatar
Zaibach333
Posts: 3
Joined: Sun Jan 01, 2006 8:44 am

Post by Zaibach333 »

indeed
using namespace yourface;
Post Reply