Custom rendering almost works

This commit is contained in:
Michal Moskal
2017-07-11 14:43:12 +02:00
parent 3bf3d07e4c
commit a3db891673
5 changed files with 161 additions and 65 deletions

View File

@ -1,29 +1,30 @@
screen.clear()
screen.setFont(ScreenFont.Large)
screen.drawText(10, 30, "Welcome PXT!")
screen.drawText(10, 30, "Welcome PXT!", Draw.Double)
screen.drawEllipse(40, 40, 20, 10, Draw.Fill)
screen.drawRect(40, 40, 20, 10, Draw.Fill)
output.setLights(LightsPattern.Orange)
screen.drawIcon(100, 50, screen.heart, Draw.Double)
input.buttonEnter.onEvent(ButtonEvent.Click, () => {
screen.clear()
})
input.buttonLeft.onEvent(ButtonEvent.Click, () => {
screen.drawRect(10, 70, 20, 10, Draw.Fill)
output.setLights(LightsPattern.Red)
})
input.buttonRight.onEvent(ButtonEvent.Click, () => {
screen.setFont(ScreenFont.Normal)
screen.drawText(10, 60, "Bang!")
screen.drawText(10, 60, "Right!")
})
input.buttonDown.onEvent(ButtonEvent.Click, () => {
screen.scroll(-10)
screen.drawText(10, 60, "Down! ")
})
input.buttonUp.onEvent(ButtonEvent.Click, () => {
screen.scroll(10)
screen.drawText(10, 60, "Up! ")
})