void drawGame(void) { if (state == STATE_LEAVE) return; if (isInvalid) { arduboy.clear(); if (state == STATE_ISSUES) { drawIssues(); } else if (state == STATE_RESULT) { drawResult(); } else { drawField(); if (state == STATE_PLAYING) { drawStrings(); drawCursor(); } if (blinkFrameFrames > 0 && blinkFlg) arduboy.drawRect(0, 0, WIDTH, HEIGHT, WHITE); } isInvalid = false; } if (state == STATE_MENU || state == STATE_RESULT) { drawMenuItems(false); arduboy.setRGBled(0, 0, 0); } else { if (state == STATE_OVER) drawOverAnimation(); arduboy.setRGBled(ledRGB[0] * vanishFlashFrames, ledRGB[1] * vanishFlashFrames, ledRGB[2] * vanishFlashFrames); } }
void HodginDidItApp::draw() { gl::clear( Color( 0, 0, 0 ) ); switch(mStage) { case 1: case 2: { drawStrings(); break; } case 3: case 4: case 5: { drawBlend(); break; } case 6: { drawVeil(); break; } } }
void drawGame(void) { if (toDraw) { arduboy.clear(); if (state != STATE_PAUSE) { drawChips(); drawFloors(); } drawPlayer(); drawStrings(); isBlink = !isBlink; toDraw = false; } }
void EditorBuffer::draw(float x, float y, float w, float h) { ofPushMatrix(); ofPushStyle(); ofTranslate(x, y); // Need to calculate size of editor before drawing updateBounds(); // Scale down if needed float scale = 1; if (bounds.width > 0 && bounds.height > 0) { scale = min(w / bounds.width, h / bounds.height); scale = min(scale, maxScale); scale = max(scale, minScale); ofScale(scale, scale); } // Move editor content if cursor is off screen float offsetY = (h / scale) - cursorPoint.y; if (offsetY < 0) { ofTranslate(0, offsetY); } float offsetX = (w / scale) - cursorPoint.x; if (offsetX < 0) { ofTranslate(offsetX, 0); } // Draw selected text highlight for (vector<ofTTFCharacter>::iterator i = shapes.begin(); i < shapes.end(); ++i) { (*i).draw(); } // Draw text buffer content ofSetColor(textColor); drawStrings(); // Draw cursor ofSetColor(cursorColor); ofRect(cursorPoint, 10, -lineHeight); ofPopStyle(); ofPopMatrix(); }