public void DrawIcons(Camera camera) { float offset = 0.0f; if (icons_top.Count != 0) { foreach (MarkerIcon icon in icons_top) { offset += icon.center.X; } foreach (MarkerIcon icon in icons_top) { offset -= icon.center.X; Vector2 position = camera.Map(pos + new Vector2(0, -radius)) - new Vector2(offset, ICON_HEIGHT_OFFSET + line_thickness + (icon.center.Y)); icon.Draw(camera, position); offset -= icon.center.X; } } if (icons_bot.Count != 0) { offset = 0.0f; foreach (MarkerIcon icon in icons_bot) { offset += icon.center.X; } foreach (MarkerIcon icon in icons_bot) { offset -= icon.center.X; Vector2 position = camera.Map(pos + new Vector2(0, radius)) - new Vector2(offset, -ICON_HEIGHT_OFFSET - line_thickness - (icon.center.Y)); icon.Draw(camera, position); offset -= icon.center.X; } } }
public override void Draw(Camera camera) { fill = Utility.Clamp(fill, 0.0f, 1.0f); Vector2 length = Utility.CosSin(angle) * size.X; Vector2 posm = camera.Map(pos); Vector2 mid = camera.Map(pos + length * fill); Vector2 end = camera.Map(pos + length); ArtPrimitive.DrawLine(posm, mid, full_color, size.Y); ArtPrimitive.DrawLine(mid, end, empty_color, size.Y); }
public override void Draw(Camera camera) { Vector2 center = camera.Map(origin); ArtPrimitive.DrawArc(center, start_angle, delta_angle * fill, radius, full_color, size.Y, segments_per_2pi:64); ArtPrimitive.DrawArc(center, end_angle, delta_angle * (fill - 1), radius, empty_color, size.Y, segments_per_2pi:64); }
public void Draw(Camera camera, float line_width) { for (int i = 0; i < armor.segment_count; i++) { Color color = ColorManager.HPColor(armor.integrity[i] / armor.max_integrity); List<Vector2> segments = nodes[i]; int segment_count = nodes[i].Count - 1; Vector2 st = camera.Map(segments[0]); for (int k = 0; k < segment_count; k++) { Vector2 en = camera.Map(segments[k + 1]); ArtPrimitive.DrawLine(st, en, color, line_width * camera.ui_feature_scale); if (k < segment_count - 1) { ArtPrimitive.DrawCircle(en, color, line_width * camera.ui_feature_scale / 2.0f); st = en; } } } }
public override void Draw(Camera camera) { pos = camera.Map(phys.pos); float scaled_line_width = line_width * camera.ui_feature_scale; float angle = phys.angle; float armor_bar_radius = radius * camera.scale; float shield_bar_radius = armor_bar_radius + (scaled_line_width * 2); float m_radius = MINIMUM_RADIUS * camera.ui_feature_scale; bool compact_view = shield_bar_radius < m_radius; if (phys.shield != null) { float s_integrity = phys.shield.integrity / phys.shield.max_integrity; if (compact_view) { if (phys.shield.active) { Color shcolor = Color.Lerp(Color.Black, ColorManager.shield_color, s_integrity); ArtPrimitive.DrawCircle(pos, shcolor, m_radius); } } else { Color shcolor = (phys.shield.active) ? ColorManager.shield_color : ColorManager.dead_shield_color; ArtPrimitive.DrawArc(pos, -MathHelper.PiOver2, MathHelper.TwoPi * s_integrity, shield_bar_radius, shcolor, scaled_line_width); } } if (phys.armor != null) { if (compact_view) { float a_integrity = 0.0f; for (int i = 0; i < phys.armor.segment_count; i++) { a_integrity += phys.armor.integrity[i] / phys.armor.max_integrity; } a_integrity /= phys.armor.segment_count; ArtPrimitive.DrawCircleTag(pos, m_radius * 0.9f, ColorManager.HPColor(a_integrity), phys.angle); } else { float a1 = phys.armor.start_angle + angle; a1 = Utility.WrapAngle(a1); for (int i = 0; i < phys.armor.segment_count; i++) { float a2 = a1 + phys.armor.per_segment_angle; float k = phys.armor.integrity[i] / phys.armor.max_integrity; ArtPrimitive.DrawArc(pos, a1 + armor_bar_sep, phys.armor.per_segment_angle - (2 * armor_bar_sep), armor_bar_radius, ColorManager.HPColor(k), scaled_line_width); a1 = a2; } } } }
public override void Draw(Camera camera) { if (!InView(camera)) { return; } Vector2 center = camera.Map(pos); if (radius < minimum_radius * camera.ui_feature_scale) { DrawCenter(camera, center, line_color, minimum_radius * camera.ui_feature_scale); } else { DrawCenter(camera, center, fill_color, radius * camera.scale); ArtPrimitive.DrawPolyLine(center, radius * camera.scale, n, line_color, line_thickness * camera.ui_feature_scale, angle, dashing); } DrawIcons(camera); }
public override void Draw(Camera camera) { DoubleCheckSubMarkers(); radius = (startpoint.pos - endpoint.pos).Length() / 2.0f; pos = (startpoint.pos + endpoint.pos) / 2.0f; if (InView(camera)) { Vector2 line_vector = (endpoint.pos - startpoint.pos); if (line_vector != Vector2.Zero) // if the startpoint and endpoint are set to the same, then line_vector.normalize fails { line_vector.Normalize(); float angle = Utility.Angle(line_vector); Vector2 st = startpoint.pos + (startpoint.LineRadius(camera.scale, angle) * line_vector); Vector2 en = endpoint.pos - (endpoint.LineRadius(camera.scale, angle - MathHelper.TwoPi) * line_vector); if (Utility.Dot(en - st, line_vector) > 0.0f) { float line_width = camera.ui_feature_scale * line_thickness *2.0f / (line_count + 1.0f); if (line_count < 1) { line_count = 1; } else if (line_count > 3) { line_count = 3; } // make sure its in range else if (line_count == 1 || line_count == 3) // odd numbers get a center line { ArtPrimitive.DrawLine(camera.Map(st), camera.Map(en), line_color, line_width); } if (line_count > 1) // two and three get edge lines { Vector2 delta = Utility.RotatePos(line_vector) * line_width * (line_count == 2 ? 1f: 2f); ArtPrimitive.DrawLine(camera.Map(st) + delta, camera.Map(en) + delta, line_color, line_width); ArtPrimitive.DrawLine(camera.Map(st) - delta, camera.Map(en) - delta, line_color, line_width); } } } } if (draw_startpoint) { startpoint.Draw(camera); } if (draw_endpoint) { endpoint.Draw(camera); } }
public override void Draw(Camera camera) { if (!InView(camera)) { return; } if (icon == null) { ArtPrimitive.DrawCircle(camera.Map(pos), line_color, radius * camera.ui_feature_scale); } else { icon.Draw(camera, camera.Map(pos)); } DrawIcons(camera); }
public override void Draw(Camera camera) { if (!InView(camera)) { return; } Vector2 center = camera.Map(pos); if (radius < minimum_radius * camera.ui_feature_scale) { ArtPrimitive.DrawCircle(center, line_color, minimum_radius * camera.ui_feature_scale); } else { ArtPrimitive.DrawCircle(center, fill_color, radius * camera.scale); if (line_color != Color.Transparent) { ArtPrimitive.DrawCircleLine(center, radius * camera.scale, line_color, line_thickness * camera.ui_feature_scale, dashing); } } DrawIcons(camera); }
public bool InView( Camera camera ) { Vector2 onscreen = camera.Map(pos); float cull_radius = resource.radius * camera.scale; return onscreen.X + cull_radius > 0 && onscreen.Y + cull_radius > 0 && onscreen.X - cull_radius < camera.res.X && onscreen.Y - cull_radius < camera.res.Y; }
public void Draw( Camera camera ) { if (!InView(camera)) { return; } camera.batch.Draw(resource.sprite, camera.Map(pos), null, Color.White, angle, resource.center, camera.scale * resource.scale, SpriteEffects.None, 0); }
public void Draw(Camera camera) { if (!InView(camera)) { return; } for (int i = 0; i < count; i++) { Vector2 ppos = camera.Map( pos + Utility.CosSin(angle[i], depth[i]) ); if (alpha[i] > 0.05) { //Color k = color * alpha[i]; Color k = Color.Lerp(resource.particle_color_end, resource.particle_color_start, alpha[i]) * alpha[i]; camera.batch.Draw(resource.sprite, ppos, null, k, angle[i], resource.sprite_center, size[i] * new Vector2(0.3f, 1.0f) * camera.scale, SpriteEffects.None, 0); } } }
public void DrawParticle(Camera camera, int i, Color color) { Color k = color*alpha[i]; Vector2 transform = (particle_size_0 + (particle_size_1 * alpha[i])); transform *= scale[i]; camera.batch.Draw(resource.sprite, camera.Map(position[i]), null, k, angle[i], resource.sprite_center, transform * (camera.scale), SpriteEffects.None, 0); }
public void Draw(Camera camera, Vector2 pos_override, float angle_override) { camera.batch.Draw(resource.sprite, camera.Map(pos_override), null, color, angle_override, resource.center, camera.scale * scale, SpriteEffects.None, 0); }
// draws the red outlines of the hitbox onto screen. Kinda usefull. public override void Draw(Camera camera, Color color, float width) { if (!camera.ContainsCircle(pos, radius)) { return; } Vector2 p1 = Utility.Rotate( corners[0], angle) + pos; p1 = camera.Map(p1); Vector2 p2; for (int j = 0; j < count; j++) { int i = j + 1; if ( i == count ) { i = 0; } p2 = Utility.Rotate(corners[i], angle) + pos; p2 = camera.Map(p2); ArtPrimitive.DrawLine(p1, p2, color, width * camera.ui_feature_scale); ArtPrimitive.DrawCircle(p2, color, width * camera.ui_feature_scale); p1 = p2; } }
public override void Draw(Camera camera, Color color, float width = 2.0f) { if (!camera.ContainsCircle(pos, radius)) { return; } Vector2 center = camera.Map(pos); ArtPrimitive.DrawArc(center, 0.0f, MathHelper.TwoPi, radius * camera.scale, color, width * camera.ui_feature_scale); }