Exemplo n.º 1
0
// draws the bullet to the screen
void Bullet::drawBullet() {
	
	// get points and draw the bullet
	set_fill_color(this->color);
	draw_rectangle_filled(this->pos.x, this->pos.y, size, size / 2);
	set_fill_color(WHITE);
}
void J_Text_Box::set_colors(J_Color_RGBA<j_float> i_cursor_color
			, J_Color_RGBA<j_float> i_fill_color, J_Color_RGBA<j_float> i_outline_color){

	set_cursor_color(i_cursor_color);
	set_fill_color(i_fill_color);
	set_outline_color(i_outline_color);
}
Exemplo n.º 3
0
Arquivo: NodeView.cpp Projeto: EQ4/lad
void
NodeView::on_property(machina::URIInt key, const Atom& value)
{
	static const uint32_t active_color        = 0x408040FF;
	static const uint32_t active_border_color = 0x00FF00FF;

	if (key == URIs::instance().machina_selector) {
		if (value.get<int32_t>()) {
			set_dash_length(4.0);
		} else {
			set_dash_length(0.0);
		}
	} else if (key == URIs::instance().machina_initial) {
		set_border_width(value.get<int32_t>() ? 4.0 : 1.0);
		set_is_source(value.get<int32_t>());
	} else if (key == URIs::instance().machina_active) {
		if (value.get<int32_t>()) {
			if (get_fill_color() != active_color) {
				set_fill_color(active_color);
				set_border_color(active_border_color);
			}
		} else if (get_fill_color() == active_color) {
			set_default_colors();
		}
	} else if (key == URIs::instance().machina_enter_action) {
		const uint64_t action_id = value.get<int32_t>();
		MachinaCanvas* canvas    = dynamic_cast<MachinaCanvas*>(this->canvas());
		_enter_action_connection.disconnect();
		_enter_action = canvas->app()->client_model()->find(action_id);
		if (_enter_action) {
			_enter_action_connection = _enter_action->signal_property.connect(
				sigc::mem_fun(this, &NodeView::on_action_property));
			for (auto i : _enter_action->properties()) {
				on_action_property(i.first, i.second);
			}
		}
	}
}
Exemplo n.º 4
0
// draws the player to the screen
void Player::drawPlayer() {
	set_fill_color(WHITE);

	int size = this->size;
	int xSize = this->facingEast ? size : size * -1;
	int x = this->pos.x;
	int y = this->pos.y;

	// draw the bill
	Point billP1 = Point::Point(x - xSize, y - size / 2);
	Point billP2 = Point::Point(x + xSize / 2, y - size);
	draw_rectangle_filled(billP1, billP2);

	// draw the head
	draw_square(x, y - size, size / 2);

	// draw the eyes
	draw_circle_filled(x - xSize / 4, y - (size * 12 / 11), size / 8);
	draw_circle_filled(x + xSize / 8, y - (size * 12 / 11), size / 8);

	// draw the left arm
	draw_square(x - xSize, y, size / 2);

	// draw the right arm
	draw_square(x + xSize, y, size / 2);

	// draw the left foot
	Point leftFootP1 = Point::Point(x - xSize, y + size);
	Point leftFootP2 = Point::Point(x + (xSize * 1/10), y + (size * 12/10));
	draw_rectangle_filled(leftFootP1, leftFootP2);

	// draw the right arm
	Point rightFootP1 = Point::Point(x + xSize, y + size);
	Point rightFootP2 = Point::Point(x + (xSize * 1/10), y + (size * 12/10));
	draw_rectangle_filled(rightFootP1, rightFootP2);
}
Exemplo n.º 5
0
void WMFUpdateState::SelectObject(int nIndex)
{
	ASSERT(nIndex < m_cpaGdiObjects.GetSize());
	if (nIndex != -1 && nIndex < m_cpaGdiObjects.GetSize())
	{
		CWMFGdiObject* pObject = (CWMFGdiObject*)m_cpaGdiObjects.GetAt(nIndex);
		ASSERT(pObject != NULL);
		if (pObject != NULL)
		{
			// We have an object.
			switch (pObject->m_nType)
			{
				case CWMFGdiObject::Brush:
				{
					m_DCState.m_nCurrentBrush = nIndex;
					CWMFBrushObject* pBrush = (CWMFBrushObject*)pObject;

					// Handle the interior style.
					switch (pBrush->m_LogBrush.lbStyle)
					{
						case BS_NULL:
						{
							set_interior_style(STYLE_Empty);
							break;
						}
						case BS_HATCHED:
						{
							set_interior_style(STYLE_Hatch);
//							set_hatch_index(?);
							break;
						}
						case BS_PATTERN:
						{
							set_interior_style(STYLE_Pattern);
							break;
						}
						default:
						case BS_SOLID:
						{
							set_interior_style(STYLE_Solid);
							break;
						}
					}

					// Handle the interior color.
					set_fill_color(RGBToOutlineColor(pBrush->m_LogBrush.lbColor));
					break;
				}
				case CWMFGdiObject::Pen:
				{
					m_DCState.m_nCurrentPen = nIndex;
					CWMFPenObject* pPen = (CWMFPenObject*)pObject;

					// Handle the edge visibility.
					set_edge_visibility(pPen->m_LogPen.lopnStyle != PS_NULL);

					// Handle the line/edge color.
					OUTLINE_COLOR Color = RGBToOutlineColor(pPen->m_LogPen.lopnColor);
					set_line_color(Color);
					set_edge_color(Color);

//					TRACE("Select Pen - Style: %u; Width: %d, %d; Color: %08lx\n",
//							pPen->m_LogPen.lopnStyle,
//							pPen->m_LogPen.lopnWidth.x,
//							pPen->m_LogPen.lopnWidth.y,
//							pPen->m_LogPen.lopnColor);

					// Handle the line/edge width.
					int nWidth = (pPen->m_LogPen.lopnWidth.y > pPen->m_LogPen.lopnWidth.x)
										? pPen->m_LogPen.lopnWidth.y : pPen->m_LogPen.lopnWidth.x;
					set_edge_width((short)nWidth);
					set_line_width((short)nWidth);
					break;
				}
				case CWMFGdiObject::Font:
				{
					m_DCState.m_nCurrentFont = nIndex;
					SetCurrentFont(((CWMFFontObject*)pObject)->m_LogFont);

					break;
				}
				case CWMFGdiObject::Palette:
				{
					m_DCState.m_nCurrentPalette = nIndex;
					SetCurrentPalette(((CWMFPaletteObject*)pObject)->m_pPalette);

					break;
				}
				default:
				{
					// Invalid GDI object type.
					ASSERT(FALSE);
					break;
				}
			}
		}
	}
}
Exemplo n.º 6
0
Arquivo: NodeView.cpp Projeto: EQ4/lad
void
NodeView::set_default_colors()
{
	set_fill_color(_default_fill_color);
	set_border_color(_default_border_color);
}