RosettaCodeData/Task/Draw-a-pixel/M2000-Interpreter/draw-a-pixel.m2000

35 lines
1005 B
Plaintext

Module CheckIt {
Module PlotPixel (a as single, b as single) {
Move a*TwipsX, b*TwipsX
Draw TwipsX, TwipsY
}
Cls 5,0 \\ clear console with Magenta (5) and set split screen from 0 (no split screen)
Pen #55FF77 {
PlotPixel 1000, 200
}
Wait 1000
Title "", 1
Declare DrawPixelForm Form
With DrawPixelForm, "Title", "Draw a Pixel at 100,100"
Layer DrawPixelForm {
\\ 12 for 12pt fonts
\\ use ; to center window
Window 12, 320*twipsx, 240*twipsy;
Cls #333333
Pen Color(255,0,0) {
PlotPixel 100, 100
}
}
\\ code to show/hide console clicking form
\\ console shown behind form
k=0
Function DrawPixelForm.Click {
Title "Rosetta Code Example", abs(k)
if k then show
k~
}
Method DrawPixelForm, "Show", 1
Declare DrawPixelForm Nothing
}
CheckIt