Single pixel with polyvector?

Previous topic - Next topic

ampos

How do I draw a single white pixel using polyvector?

Ian Price

Code (glbasic) Select


WHILE TRUE

FOR n=0 TO 100
polypixel(RND(480),RND(320))
NEXT

SHOWSCREEN

WEND

// Draw 1x1 pixel polyvector
FUNCTION polypixel: x,y

STARTPOLY 0
POLYVECTOR x,y,x,y
POLYVECTOR x+1,y,x+1,y
POLYVECTOR x+1,y+1,x+1,y+1
POLYVECTOR x,y+1,x,y+1
ENDPOLY

ENDFUNCTION
I came. I saw. I played.

ampos


Minion

Quote from: Ian Price on 2010-Oct-08
Code (glbasic) Select


WHILE TRUE

FOR n=0 TO 100
polypixel(RND(480),RND(320))
NEXT

SHOWSCREEN

WEND

// Draw 1x1 pixel polyvector
FUNCTION polypixel: x,y

STARTPOLY 0
POLYVECTOR x,y,x,y
POLYVECTOR x+1,y,x+1,y
POLYVECTOR x+1,y+1,x+1,y+1
POLYVECTOR x,y+1,x,y+1
ENDPOLY

ENDFUNCTION


Not bad. But how do I go about rotating it ?

Ian Price

QuoteNot bad. But how do I go about rotating it ?

LOL.

You have to have a box to circle collision routine before you can rotate it Min ;) :P
I came. I saw. I played.

Marmor

rotate is easy ! rotate your iphone  :whistle:

Ian Price

Have twenty beers - everything rotates then :P
I came. I saw. I played.

Kitty Hello

uhm - WHY?
I mean, if you want a pixel, use SETPIXEL.
If you want FAST pixels, use MEM2SPR and set the pixels in a DIM array beforehand.

ampos

Yes, I was looking for FAST pixels, so my question. But I did found a quick enough system. Anyway, will check mem2spr.