- This wiki is out of date, use the continuation of this wiki instead
Drawing stipple
From FenixWiki
(Difference between revisions)
| Revision as of 00:00, 20 November 2007 (edit) Sandman (Talk | contribs) (New page: Category:functions Category:drawing ==Definition== '''INT''' drawing_stipple ( <'''INT''' stipple> ) Tells Fenix to draw the coming drawings in stipplemode or not. == P...) ← Previous diff |
Revision as of 01:06, 20 November 2007 (edit) (undo) Sandman (Talk | contribs) Next diff → |
||
| Line 3: | Line 3: | ||
| ==Definition== | ==Definition== | ||
| - | '''INT''' drawing_stipple ( <'''INT''' | + | '''INT''' drawing_stipple ( <'''INT''' stipples> ) |
| - | Tells [[Fenix]] to draw the coming [[drawing]]s | + | Tells [[Fenix]] which pixels to draw of the coming [[drawing]]s. |
| + | |||
| + | This is done by passing a 32bit value, each bit representing a pixel. Bit 0 represents the first pixels drawn, bit 1 represents the second, etc. When a 33th pixel is to be drawn or not, bit 0 is checked, etc. This means a value of ''-1'' means normal operation, that is all the pixels will be drawn. | ||
| == Parameters == | == Parameters == | ||
| {| | {| | ||
| - | | '''INT''' | + | | '''INT''' stipples - Which pixels to draw, repetitive 32bits. |
| |} | |} | ||
| == Returns == | == Returns == | ||
| '''INT''' : [[true]] | '''INT''' : [[true]] | ||
| + | |||
| + | == Example == | ||
| + | <pre> | ||
| + | Program example; | ||
| + | Private | ||
| + | // int draw_id; | ||
| + | Begin | ||
| + | |||
| + | // Draw in background | ||
| + | drawing_map(0,background); | ||
| + | |||
| + | // Set stipplemode to display every other pixel. | ||
| + | // binary code 0101 0101 0101 0101 0101 0101 0101 0101 | ||
| + | // hex code 55555555 | ||
| + | // 10base code 1431655765 | ||
| + | drawing_stipple(1431655765); | ||
| + | |||
| + | // Draw two lines | ||
| + | draw_line(10,10,190,10); | ||
| + | draw_line(11,12,190,12); | ||
| + | |||
| + | // Draw this funy pattern | ||
| + | // binary code 0011 1100 0111 1100 1010 0001 1101 0011 | ||
| + | // hex code 3C7CA1D3 | ||
| + | // 10base code 1014800851 | ||
| + | drawing_stipple(1014800851); | ||
| + | |||
| + | // Draw two lines | ||
| + | draw_line(10,20,190,20); | ||
| + | draw_line(11,22,190,22); | ||
| + | |||
| + | // Wait for key ESC | ||
| + | Repeat | ||
| + | frame; | ||
| + | Until(key(_ESC)) | ||
| + | |||
| + | End | ||
| + | </pre> | ||
| + | Used in example: [[drawing_map]](), [[draw_line]](), [[key]]() | ||
| + | |||
| + | This will result in something like:<br> | ||
| + | {{Image | ||
| + | | image=Drawing_stipple.PNG | ||
| + | | caption=The workings of drawing_stipple(): pixel patterns | ||
| + | }} | ||
| {{Funcbox | {{Funcbox | ||
| | category=Drawing | | category=Drawing | ||
| }} | }} | ||
Revision as of 01:06, 20 November 2007
Contents |
Definition
INT drawing_stipple ( <INT stipples> )
Tells Fenix which pixels to draw of the coming drawings.
This is done by passing a 32bit value, each bit representing a pixel. Bit 0 represents the first pixels drawn, bit 1 represents the second, etc. When a 33th pixel is to be drawn or not, bit 0 is checked, etc. This means a value of -1 means normal operation, that is all the pixels will be drawn.
Parameters
| INT stipples - Which pixels to draw, repetitive 32bits. |
Returns
INT : true
Example
Program example;
Private
// int draw_id;
Begin
// Draw in background
drawing_map(0,background);
// Set stipplemode to display every other pixel.
// binary code 0101 0101 0101 0101 0101 0101 0101 0101
// hex code 55555555
// 10base code 1431655765
drawing_stipple(1431655765);
// Draw two lines
draw_line(10,10,190,10);
draw_line(11,12,190,12);
// Draw this funy pattern
// binary code 0011 1100 0111 1100 1010 0001 1101 0011
// hex code 3C7CA1D3
// 10base code 1014800851
drawing_stipple(1014800851);
// Draw two lines
draw_line(10,20,190,20);
draw_line(11,22,190,22);
// Wait for key ESC
Repeat
frame;
Until(key(_ESC))
End
Used in example: drawing_map(), draw_line(), key()
This will result in something like:
|
| Drawing Functions | |
| • Delete_draw() • Draw_box() • Draw_circle() • Draw_curve() • Draw_fcircle() • Draw_line() • Draw_rect() • Drawing_alpha() • Drawing_color() • Drawing_map() • Drawing_stipple() • Drawing_z() • Move_draw() • | |
