void Ellipse::draw() { if(get_filled_status()) al_draw_filled_ellipse(_V_pos_x,_V_pos_y,_V_radius_x*bitmap_scale_x,_V_radius_y*bitmap_scale_y,_V_color); al_draw_ellipse(_V_pos_x,_V_pos_y,_V_radius_x*bitmap_scale_x,_V_radius_y*bitmap_scale_y,_V_color, _V_thickness*primitives_scale); }
void Enemy::Draw () const { if (dead) return; if (!image) { al_draw_rectangle(posX, posY, posX + boxWidth*cTileSize, posY + boxHeight*cTileSize, cWhite,1); al_draw_ellipse(posX + boxWidth*cTileSize/2, posY + boxHeight*cTileSize/2, boxWidth*cTileSize/4 - 1, boxHeight*cTileSize/4 - 1, cWhite, 1); al_draw_ellipse(posX + boxWidth*cTileSize/2, posY + boxHeight*cTileSize/2, boxWidth*cTileSize/3 - 1, boxHeight*cTileSize/3 - 1, cWhite, 1); al_draw_ellipse(posX + boxWidth*cTileSize/2, posY + boxHeight*cTileSize/2, boxWidth*cTileSize/2 - 1, boxHeight*cTileSize/2 - 1, cWhite, 1); } else { Entity::Draw(); } }
/**< Função Desenha uma elipse na Janela */ void Des_Elipse( int desenha_elipse, ALLEGRO_FONT *fonte, int x1, int y1, int x2, int y2, int x3, int y3) { if (desenha_elipse == 1) { float a = sqrt(pow(x1 - x2,2) + pow(y1 - y2,2)); float b = sqrt(pow(x1 - x3,2) + pow(y1 - y3,2)); al_draw_text(fonte, al_map_rgb(255, 255, 255), 320, 70, ALLEGRO_ALIGN_CENTRE, "Precione em 2 pontos:"); al_draw_ellipse(x1, y1, b, a, al_map_rgb(255, 255, 255), 2); } }
void RenderTarget::drawEllipse(float x, float y, float w, float h, bool fill, const ALLEGRO_COLOR &color) { convertCoords(x, y); if (w < 0 || h < 0) { return; } setAsCurrent(); if (fill) { al_draw_filled_ellipse(x, y, w * 0.5f, h * 0.5f, color); } else { al_draw_ellipse(x, y, w * 0.5f, h * 0.5f, color, CBEnchanted::instance()->gfxInterface->getLineWidth()); } }
void shal_draw_ellipse(float cx, float cy, float rx, float ry, float color_r, float color_g, float color_b, float color_a, float thickness) { ALLEGRO_COLOR color; color.r = color_r; color.g = color_g; color.b = color_b; color.a = color_a; return al_draw_ellipse(cx, cy, rx, ry, color, thickness); }
static void primitive(float l, float t, float r, float b, ALLEGRO_COLOR color, bool never_fill) { float cx = (l + r) / 2; float cy = (t + b) / 2; float rx = (r - l) / 2; float ry = (b - t) / 2; int tk = never_fill ? 0 : ex.thickness; int w = ex.what; if (w == 0 && never_fill) w = 1; if (w == 2 && never_fill) w = 3; if (w == 0) al_draw_filled_rectangle(l, t, r, b, color); if (w == 1) al_draw_rectangle(l, t, r, b, color, tk); if (w == 2) al_draw_filled_ellipse(cx, cy, rx, ry, color); if (w == 3) al_draw_ellipse(cx, cy, rx, ry, color, tk); if (w == 4) al_draw_line(l, t, r, b, color, tk); }
static void TransformationsPrimitives(int mode) { float t = al_get_time(); if (mode == INIT) { } else if (mode == LOGIC) { Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, sinf(t / 5), cosf(t / 5), Theta); } else if (mode == DRAW) { float points[8] = { -300, -200, 700, 200, -700, 200, 300, -200 }; if (Blend) al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE); else al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO); al_use_transform(&MainTrans); al_draw_line(-300, -200, 300, 200, al_map_rgba_f(0, 0.5, 0.5, 1), Thickness); al_draw_triangle(-150, -250, 0, 250, 150, -250, al_map_rgba_f(0.5, 0, 0.5, 1), Thickness); al_draw_rectangle(-300, -200, 300, 200, al_map_rgba_f(0.5, 0, 0, 1), Thickness); al_draw_rounded_rectangle(-200, -125, 200, 125, 50, 100, al_map_rgba_f(0.2, 0.2, 0, 1), Thickness); al_draw_ellipse(0, 0, 300, 150, al_map_rgba_f(0, 0.5, 0.5, 1), Thickness); al_draw_elliptical_arc(-20, 0, 300, 200, -ALLEGRO_PI / 2, -ALLEGRO_PI, al_map_rgba_f(0.25, 0.25, 0.5, 1), Thickness); al_draw_arc(0, 0, 200, -ALLEGRO_PI / 2, ALLEGRO_PI, al_map_rgba_f(0.5, 0.25, 0, 1), Thickness); al_draw_spline(points, al_map_rgba_f(0.1, 0.2, 0.5, 1), Thickness); al_draw_pieslice(0, 25, 150, ALLEGRO_PI * 3 / 4, -ALLEGRO_PI / 2, al_map_rgba_f(0.4, 0.3, 0.1, 1), Thickness); al_use_transform(&Identity); } }
void DrawingClass::DrawEllipse (float x0, float y0, float rx, float ry, int r, int g, int b, float thick) { ALLEGRO_COLOR color = al_map_rgb(r, g, b); al_draw_ellipse(x0, y0, rx, ry, color, thick); }
void Ellipse::draw_in_another_target() { if(get_filled_status()) al_draw_filled_ellipse(_V_pos_x,_V_pos_y,_V_radius_x,_V_radius_y,_V_color); al_draw_ellipse(_V_pos_x,_V_pos_y,_V_radius_x,_V_radius_y,_V_color,_V_thickness); }
void al_draw_ellipse_w(float cx, float cy, float rx, float ry, ALLEGRO_COLOR *color, float thickness) { al_draw_ellipse(cx, cy, rx, ry, *color, thickness); }