Created
October 16, 2012 08:55
-
-
Save hirosof/3898144 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #module | |
| #deffunc hsline int sx , int sy , int ex , int ey , int r,int g, int b | |
| x1 = sx | |
| y1 = sy | |
| x2 = ex | |
| y2 = ey | |
| namera = 0 | |
| Xupper = 1 | |
| Yupper = 1 | |
| Xdelta = x2 - x1 | |
| Ydelta = y2 - y1 | |
| nowcolor = ( ginfo_r << 16 ) || ( ginfo_g << 8 ) | ( ginfo_b ) | |
| color r,g,b | |
| if( Xdelta < 0 ) : Xdelta = -Xdelta : Xupper = -1 | |
| if( Ydelta < 0 ) : Ydelta = -Ydelta : Yupper = -1 | |
| if( Xdelta > Ydelta){ | |
| repeat Xdelta + 1 | |
| pset x1,y1 | |
| x1 += Xupper | |
| namera += Ydelta | |
| if(namera >= Xdelta) : namera-=Xdelta : y1+=Yupper | |
| loop | |
| }else{ | |
| repeat Ydelta + 1 | |
| pset x1,y1 | |
| y1 += Yupper | |
| namera += Xdelta | |
| if(namera >= Ydelta) : namera-=Ydelta : x1+=Xupper | |
| loop | |
| } | |
| color (nowcolor & 0xFF0000) >> 16 ,(nowcolor & 0xFF00) >> 8 ,(nowcolor & 0xFF) | |
| return | |
| #global | |
| hsline 5,5,100,100 , 0 , 200 , 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment