forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Help]drawLine

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
N00b



Joined: 24 Dec 2005
Posts: 9

PostPosted: Sat Dec 24, 2005 5:02 am    Post subject: [Help]drawLine Reply with quote

How do you write this code "nil image:drawLine(x0, y0, x1, y1, [color = black])"
Back to top
View user's profile Send private message
link



Joined: 19 Oct 2005
Posts: 61

PostPosted: Sat Dec 24, 2005 7:17 am    Post subject: Re: [Help]drawLine Reply with quote

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
Back to top
View user's profile Send private message
N00b



Joined: 24 Dec 2005
Posts: 9

PostPosted: Sat Dec 24, 2005 8:43 am    Post subject: Reply with quote

that I know but wen i try to run my script
Code:
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!?
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Sat Dec 24, 2005 3:03 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
Zaibach333



Joined: 01 Jan 2006
Posts: 3

PostPosted: Sun Jan 01, 2006 9:03 am    Post subject: Reply with quote

indeed
_________________
using namespace yourface;
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group