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 Pinstripe {
Module Checkit {
Smooth off ' use of GDI32
Window 16, 14000,12000;
Dim colors(0 to 7)
Module Pinstripe {
Smooth off ' use of GDI32
Colors(0)=#000000,#FF0000, #00FF00, #0000FF, #FF00FF, #00FFFF, #FFFF00, #FFFFFF
Dim colors(0 to 7)
pixelsX=scale.x/twipsX
Colors(0)=#000000,#FF0000, #00FF00, #0000FF, #FF00FF, #00FFFF, #FFFF00, #FFFFFF
pixelsY=scale.y/twipsY
zoneheight=scale.y/4
pixelsX=scale.x/twipsX
n=0
pixelsY=scale.y/twipsY
zoneheight=scale.y/4
Refresh 5000
For i=1 to 4 {
n=0
move 0, (i-1)*zoneheight
Refresh 5000
pinw=i*twipsx
For i=1 to 4 {
For j=1 to pixelsX/i {
move 0, (i-1)*zoneheight
Fill pinw, zoneheight, color(n)
pinw=i*twipsx
Step 0, -zoneheight
For j=1 to pixelsX/i {
n++:if n=8 then n=0
Fill pinw, zoneheight, color(n)
Step 0, -zoneheight
n++:if n=8 then n=0
}
}
}
\\ now we make the refersh
Refresh 100
}
}
\\ now we make the refersh
\\ draw to console window
\\ now we make a window and draw there
Refresh 100
}
\\ draw to console window
\\ now we make a window and draw there
Pinstripe
Layer 32 {
Window 12, 10000,10000
Pinstripe
Pinstripe
Motion 2000,2000
Layer 32 {
Window 12, 10000,10000
Show
Pinstripe
Show
}
Declare Pinstripe Form
Layer Pinstripe {
Window 12, 10000,10000
Pinstripe
motion 2000, 2000
}
refresh 20
Thread {
if control$="MAIN" then if mouse then player 32, mousea.x, mousea.y
} as anyvar interval 100
Method Pinstripe, "Show", 1
Threads Erase
Layer 32 {Hide}
Cls
}
}
Checkit
Declare Pinstripe Form

Layer Pinstripe {
Window 12, 10000,10000
Pinstripe
}
Method Pinstripe, "Show", 1
Layer 32 {Hide}
</lang>
</lang>