mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 14:50:44 +01:00
[python] add bgcolor to turtule module (#367)
* add bgcolor to turtul module * add bgcolor to toolbox and a minor fix * ok is ok now i hope however * Submodule Omega-Kawaii-Theme remove
This commit is contained in:
@@ -33,6 +33,7 @@ void Turtle::reset() {
|
||||
m_y = 0;
|
||||
m_heading = 0;
|
||||
m_color = k_defaultColor;
|
||||
m_bgcolor = k_defaultColorBG;
|
||||
m_penDown = true;
|
||||
m_visible = true;
|
||||
m_speed = k_defaultSpeed;
|
||||
@@ -40,6 +41,7 @@ void Turtle::reset() {
|
||||
m_mileage = 0;
|
||||
|
||||
// Draw the turtle
|
||||
drawBg();
|
||||
draw(true);
|
||||
}
|
||||
|
||||
@@ -202,6 +204,19 @@ bool Turtle::isOutOfBounds() const {
|
||||
return absF(x()) > k_maxPosition || absF(y()) > k_maxPosition;
|
||||
};
|
||||
|
||||
void Turtle::drawBg() {
|
||||
MicroPython::ExecutionEnvironment::currentExecutionEnvironment()->displaySandbox();
|
||||
|
||||
KDContext * ctx = KDIonContext::sharedContext();
|
||||
|
||||
KDRect bg = KDRect(
|
||||
0,
|
||||
0,
|
||||
320,
|
||||
229);
|
||||
ctx->fillRect(bg, m_bgcolor);
|
||||
}
|
||||
|
||||
// Private functions
|
||||
|
||||
void Turtle::setHeadingPrivate(mp_float_t angle) {
|
||||
@@ -406,4 +421,4 @@ void Turtle::erase() {
|
||||
KDContext * ctx = KDIonContext::sharedContext();
|
||||
ctx->fillRectWithPixels(iconRect(), m_underneathPixelBuffer, nullptr);
|
||||
m_drawn = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user