Colour pinstripe/Display: Difference between revisions
Content deleted Content added
Line 635: | Line 635: | ||
Sprite layers have a priority number, so 32 is the top one. We can change priorities sending back any sprite. |
Sprite layers have a priority number, so 32 is the top one. We can change priorities sending back any sprite. |
||
Version 2 |
|||
We change console width and height and put in the center of screen |
|||
We use a thread to move the layer above console (and inside console form), when we push any mouse button (only in console window). Program ends when we close the modal opened window. |
|||
<lang M2000 Interpreter> |
<lang M2000 Interpreter> |
||
Module |
Module Checkit { |
||
Window 16, 14000,12000; |
|||
Module Pinstripe { |
|||
Smooth off ' use of GDI32 |
|||
⚫ | |||
Dim colors(0 to 7) |
|||
pixelsX=scale.x/twipsX |
|||
⚫ | |||
⚫ | |||
pixelsX=scale.x/twipsX |
|||
pixelsY=scale.y/twipsY |
|||
⚫ | |||
⚫ | |||
n=0 |
|||
Refresh 5000 |
|||
For i=1 to 4 { |
|||
move 0, (i-1)*zoneheight |
|||
pinw=i*twipsx |
|||
For j=1 to pixelsX/i { |
|||
Fill pinw, zoneheight, color(n) |
|||
Step 0, -zoneheight |
|||
n++:if n=8 then n=0 |
|||
} |
|||
} |
} |
||
\\ now we make the refersh |
|||
⚫ | |||
} |
} |
||
\\ |
\\ draw to console window |
||
⚫ | |||
⚫ | |||
} |
|||
\\ draw to console window |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Pinstripe |
Pinstripe |
||
Layer 32 { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
motion 2000, 2000 |
|||
} |
|||
⚫ | |||
Thread { |
|||
if control$="MAIN" then if mouse then player 32, mousea.x, mousea.y |
|||
} as anyvar interval 100 |
|||
⚫ | |||
Threads Erase |
|||
⚫ | |||
Cls |
|||
} |
} |
||
Checkit |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
Layer 32 {Hide} |
|||
</lang> |
</lang> |
||