void UIButton::internalCheckState() { if (hasAttr(STATE_PRESSED)) { m_color = m_button.m_pressedBkColor; m_font.m_color = m_button.m_pressedFontColor; m_button.m_frameColor = m_button.m_pressedFrameColor; } else if (hasAttr(STATE_HOT)) { m_color = m_button.m_hotBkColor; m_font.m_color = m_button.m_hotFontColor; m_button.m_frameColor = m_button.m_hotFrameColor; } else if (hasAttr(STATE_FOCUSED)) { m_color = m_button.m_focusedBkColor; m_font.m_color = m_button.m_focusedFontColor; m_button.m_frameColor = m_button.m_focusedFrameColor; } else { m_color = getTrueColor(m_button.m_normalBkColor); m_font.m_color = getTrueColor(m_button.m_normalFontColor); m_button.m_frameColor = getTrueColor(m_button.m_normalFrameColor); } }
void UILabel::onPaintText(Graphics& graphics, Rect rect) { StringFormat stringFormat; stringFormat.SetTrimming(m_font.m_trimming); stringFormat.SetAlignment(m_font.m_horizen); stringFormat.SetLineAlignment(m_font.m_vertical); Font font(m_font.m_family, m_font.m_size, m_font.m_style, m_font.m_unit); SolidBrush brush(getTrueColor(m_font.m_color)); graphics.DrawString(m_font.m_text, -1, &font, m_font.m_rect, &stringFormat, &brush); }
bool VoxelTreeElement::findSpherePenetration(const glm::vec3& center, float radius, glm::vec3& penetration, void** penetratedObject) const { if (_box.findSpherePenetration(center, radius, penetration)) { // if the caller wants details about the voxel, then return them here... if (penetratedObject) { VoxelDetail* voxelDetails = new VoxelDetail; voxelDetails->x = _box.getCorner().x; voxelDetails->y = _box.getCorner().y; voxelDetails->z = _box.getCorner().z; voxelDetails->s = _box.getScale(); voxelDetails->red = getTrueColor()[RED_INDEX]; voxelDetails->green = getTrueColor()[GREEN_INDEX]; voxelDetails->blue = getTrueColor()[BLUE_INDEX]; *penetratedObject = (void*)voxelDetails; } return true; } return false; }