pixel and line

Non-platform specific questions.

pixel and line

Postby sportmaster » Wed Nov 24, 2010 12:16 am

How can I: put pixel, define it's colour, draw line and determine line's colour ?
User avatar
sportmaster
 
Posts: 32
Joined: Thu Jun 25, 2009 8:29 pm
Score: 0 Give a positive score

Re: pixel and line

Postby skydereign » Wed Nov 24, 2010 6:02 am

There is no way to check a pixels color, there is a getpixel example on the forums, but you can't do this without creating an array. To put a pixel, you use the function putpixel.
Code: Select all
putpixel(x,y);


To draw a line, use lineto. It will draw a line from the current position (the pen) to the specified (x,y).
Code: Select all
lineto(x,y);


To move where the pen of the actor is, use moveto.
Code: Select all
moveto(x,y);


To set the color of the pixel, or the line, use setpen.
Code: Select all
setpen(r,g,b,transparency,size);
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: pixel and line

Postby sportmaster » Thu Nov 25, 2010 6:33 am

Your advices were very usefull. I've managed to create the game with a line. Thanks to you, the game is completed :) http://game-editor.com/forum/viewtopic.php?f=6&t=9437
User avatar
sportmaster
 
Posts: 32
Joined: Thu Jun 25, 2009 8:29 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest