Colour pinstripe/Display: Difference between revisions

Line 635:
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>
Module PinstripeCheckit {
SmoothWindow off16, ' use of GDI3214000,12000;
DimModule colors(0Pinstripe to 7){
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 pixelsX=scale.yx/4twipsX
n pixelsY=0scale.y/twipsY
pixelsY zoneheight=scale.y/twipsY4
Refresh 5000
For i=1 to 4 { n=0
moveRefresh 0, (i-1)*zoneheight5000
pinw=For i*twipsx=1 to 4 {
For j=1 to pixelsX/i { move 0, (i-1)*zoneheight
Fill pinw, zoneheight, color(n)=i*twipsx
StepFor j=1 0,to -zoneheightpixelsX/i {
n++:if n=8 then Fill pinw, zoneheight, color(n=0)
Step 0, -zoneheight
n++:if n=8 then n=0
}
}
\\ now we make the refersh
Refresh 5000100
}
\\ nowdraw weto makeconsole the refershwindow
\\ 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
MotionLayer 2000,200032 {
Window 12, 10000,10000
Show
Pinstripe
Show
}
Declare Pinstripe Form
Layer Pinstripe {
Window 12, 10000,10000
Pinstripe
motion 2000, 2000
}
Refreshrefresh 10020
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>
 
Anonymous user