View Source Exray.Shapes.Basic (Exray v0.6.0)

Draw pixels, lines and other basic geometry.

Summary

Functions

Draw circle outline (Vector version)

Draw a color-filled circle (Vector version)

Draw line segment cubic-bezier in-out interpolation

Draw a line (using triangles/quads)

Draw lines sequence (using gl lines)

Draw a line (using gl lines)

Draw a pixel (Vector version)

Draw a regular polygon (Vector version)

Draw a polygon outline of n sides with extended parameters

Draw a color-filled rectangle

Draw a gradient-filled rectangle with custom vertex colors

Draw a horizontal-gradient-filled rectangle

Draw rectangle outline with extended parameters

Draw a color-filled rectangle with pro parameters

Draw a color-filled rectangle

Draw a color-filled rectangle (Vector version)

Draw a color-filled triangle (vertex in counter-clockwise order!)

Draw a triangle fan defined by points (first vertex is the center)

Draw triangle outline (vertex in counter-clockwise order!)

Draw a triangle strip defined by points

Set texture and rectangle to be used on shapes drawing

Functions

Link to this function

draw_circle(centerX, centerY, radius, color)

View Source
@spec draw_circle(
  centerX :: integer(),
  centerY :: integer(),
  radius :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled circle

Link to this function

draw_circle_gradient(centerX, centerY, radius, color1, color2)

View Source
@spec draw_circle_gradient(
  centerX :: integer(),
  centerY :: integer(),
  radius :: float(),
  color1 :: Exray.Structs.Color.t(),
  color2 :: Exray.Structs.Color.t()
) :: :ok

Draw a gradient-filled circle

Link to this function

draw_circle_lines(centerX, centerY, radius, color)

View Source
@spec draw_circle_lines(
  centerX :: integer(),
  centerY :: integer(),
  radius :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw circle outline

Link to this function

draw_circle_lines_v(center, radius, color)

View Source
@spec draw_circle_lines_v(
  center :: Exray.Structs.Vector2.t(),
  radius :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw circle outline (Vector version)

Link to this function

draw_circle_sector(center, radius, start_angle, end_angle, segments, color)

View Source
@spec draw_circle_sector(
  center :: Exray.Structs.Vector2.t(),
  radius :: float(),
  start_angle :: float(),
  end_angle :: float(),
  segments :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a piece of a circle

Link to this function

draw_circle_sector_lines(center, radius, start_angle, end_angle, segments, color)

View Source
@spec draw_circle_sector_lines(
  center :: Exray.Structs.Vector2.t(),
  radius :: float(),
  start_angle :: float(),
  end_angle :: float(),
  segments :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw circle sector outline

Link to this function

draw_circle_v(center, radius, color)

View Source
@spec draw_circle_v(
  center :: Exray.Structs.Vector2.t(),
  radius :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled circle (Vector version)

Link to this function

draw_ellipse(centerX, centerY, radiusH, radiusV, color)

View Source
@spec draw_ellipse(
  centerX :: integer(),
  centerY :: integer(),
  radiusH :: float(),
  radiusV :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw ellipse

Link to this function

draw_ellipse_lines(centerX, centerY, radiusH, radiusV, color)

View Source
@spec draw_ellipse_lines(
  centerX :: integer(),
  centerY :: integer(),
  radiusH :: float(),
  radiusV :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw ellipse outline

Link to this function

draw_line(startPosX, startPosY, endPosX, endPosY, color)

View Source
@spec draw_line(
  startPosX :: integer(),
  startPosY :: integer(),
  endPosX :: integer(),
  endPosY :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a line

Link to this function

draw_line_bezier(startPos, endPos, thick, color)

View Source
@spec draw_line_bezier(
  startPos :: Exray.Structs.Vector2.t(),
  endPos :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw line segment cubic-bezier in-out interpolation

Link to this function

draw_line_ex(startPos, endPos, thick, color)

View Source
@spec draw_line_ex(
  startPos :: Exray.Structs.Vector2.t(),
  endPos :: Exray.Structs.Vector2.t(),
  thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a line (using triangles/quads)

Link to this function

draw_line_strip(points, color)

View Source
@spec draw_line_strip(
  points :: [Exray.Structs.Vector2.t()],
  color :: Exray.Structs.Color.t()
) :: :ok

Draw lines sequence (using gl lines)

Link to this function

draw_line_v(startPos, endPos, color)

View Source
@spec draw_line_v(
  startPos :: Exray.Structs.Vector2.t(),
  endPos :: Exray.Structs.Vector2.t(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a line (using gl lines)

Link to this function

draw_pixel(posX, posY, color)

View Source
@spec draw_pixel(
  posX :: integer(),
  posY :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a pixel

Link to this function

draw_pixel_v(position, color)

View Source
@spec draw_pixel_v(
  position :: Exray.Structs.Vector2.t(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a pixel (Vector version)

Link to this function

draw_poly(center, sides, radius, rotation, color)

View Source
@spec draw_poly(
  center :: Exray.Structs.Vector2.t(),
  sides :: integer(),
  radius :: float(),
  rotation :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a regular polygon (Vector version)

Link to this function

draw_poly_lines(center, sides, radius, rotation, color)

View Source
@spec draw_poly_lines(
  center :: Exray.Structs.Vector2.t(),
  sides :: integer(),
  radius :: float(),
  rotation :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a polygon outline of n sides

Link to this function

draw_poly_lines_ex(center, sides, radius, rotation, line_thick, color)

View Source
@spec draw_poly_lines_ex(
  center :: Exray.Structs.Vector2.t(),
  sides :: integer(),
  radius :: float(),
  rotation :: float(),
  line_thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a polygon outline of n sides with extended parameters

Link to this function

draw_rectangle(posX, posY, width, height, color)

View Source
@spec draw_rectangle(
  posX :: integer(),
  posY :: integer(),
  width :: integer(),
  height :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled rectangle

Link to this function

draw_rectangle_gradient_ex(rec, col1, col2, col3, col4)

View Source
@spec draw_rectangle_gradient_ex(
  rec :: Exray.Structs.Rectangle.t(),
  col1 :: Exray.Structs.Color.t(),
  col2 :: Exray.Structs.Color.t(),
  col3 :: Exray.Structs.Color.t(),
  col4 :: Exray.Structs.Color.t()
) :: :ok

Draw a gradient-filled rectangle with custom vertex colors

Link to this function

draw_rectangle_gradient_h(posX, posY, width, height, color1, color2)

View Source
@spec draw_rectangle_gradient_h(
  posX :: integer(),
  posY :: integer(),
  width :: integer(),
  height :: integer(),
  color1 :: Exray.Structs.Color.t(),
  color2 :: Exray.Structs.Color.t()
) :: :ok

Draw a horizontal-gradient-filled rectangle

Link to this function

draw_rectangle_gradient_v(posX, posY, width, height, color1, color2)

View Source
@spec draw_rectangle_gradient_v(
  posX :: integer(),
  posY :: integer(),
  width :: integer(),
  height :: integer(),
  color1 :: Exray.Structs.Color.t(),
  color2 :: Exray.Structs.Color.t()
) :: :ok

Draw a vertical-gradient-filled rectangle

Link to this function

draw_rectangle_lines(posX, posY, width, height, color)

View Source
@spec draw_rectangle_lines(
  posX :: integer(),
  posY :: integer(),
  width :: integer(),
  height :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw rectangle outline

Link to this function

draw_rectangle_lines_ex(rec, line_thick, color)

View Source
@spec draw_rectangle_lines_ex(
  rec :: Exray.Structs.Rectangle.t(),
  line_thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw rectangle outline with extended parameters

Link to this function

draw_rectangle_pro(rec, origin, rotation, color)

View Source
@spec draw_rectangle_pro(
  rec :: Exray.Structs.Rectangle.t(),
  origin :: Exray.Structs.Vector2.t(),
  rotation :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled rectangle with pro parameters

Link to this function

draw_rectangle_rec(rec, color)

View Source
@spec draw_rectangle_rec(
  rec :: Exray.Structs.Rectangle.t(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled rectangle

Link to this function

draw_rectangle_rounded(rec, roundness, segments, color)

View Source
@spec draw_rectangle_rounded(
  rec :: Exray.Structs.Rectangle.t(),
  roundness :: float(),
  segments :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw rectangle with rounded edges

Link to this function

draw_rectangle_rounded_lines(rec, roundness, segments, line_thick, color)

View Source
@spec draw_rectangle_rounded_lines(
  rec :: Exray.Structs.Rectangle.t(),
  roundness :: float(),
  segments :: integer(),
  line_thick :: float(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw rectangle with rounded edges outline

Link to this function

draw_rectangle_v(position, size, color)

View Source
@spec draw_rectangle_v(
  position :: Exray.Structs.Vector2.t(),
  size :: Exray.Structs.Vector2.t(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled rectangle (Vector version)

Link to this function

draw_ring(center, inner_radius, outer_radius, start_angle, end_angle, segments, color)

View Source
@spec draw_ring(
  center :: Exray.Structs.Vector2,
  inner_radius :: float(),
  outer_radius :: float(),
  start_angle :: float(),
  end_angle :: float(),
  segments :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw ring

Link to this function

draw_ring_lines(center, inner_radius, outer_radius, start_angle, end_angle, segments, color)

View Source
@spec draw_ring_lines(
  center :: Exray.Structs.Vector2.t(),
  inner_radius :: float(),
  outer_radius :: float(),
  start_angle :: float(),
  end_angle :: float(),
  segments :: integer(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw ring outline

Link to this function

draw_triangle(v1, v2, v3, color)

View Source
@spec draw_triangle(
  v1 :: Exray.Structs.Vector2.t(),
  v2 :: Exray.Structs.Vector2.t(),
  v3 :: Exray.Structs.Vector2.t(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a color-filled triangle (vertex in counter-clockwise order!)

Link to this function

draw_triangle_fan(points, color)

View Source
@spec draw_triangle_fan(
  points :: [Exray.Structs.Vector2.t()],
  color :: Exray.Structs.Color.t()
) :: :ok

Draw a triangle fan defined by points (first vertex is the center)

Link to this function

draw_triangle_lines(v1, v2, v3, color)

View Source
@spec draw_triangle_lines(
  v1 :: Exray.Structs.Vector2.t(),
  v2 :: Exray.Structs.Vector2.t(),
  v3 :: Exray.Structs.Vector2.t(),
  color :: Exray.Structs.Color.t()
) :: :ok

Draw triangle outline (vertex in counter-clockwise order!)

Link to this function

draw_triangle_strip(points, color)

View Source
@spec draw_triangle_strip(
  points :: [Exray.Structs.Vector2.t()],
  color :: Exray.Structs.Color.t()
) ::
  :ok

Draw a triangle strip defined by points

Link to this function

set_shapes_texture(texture, source)

View Source
@spec set_shapes_texture(
  texture :: Exray.Structs.Texture.t(),
  source :: Exray.Structs.Rectangle.t()
) ::
  :ok

Set texture and rectangle to be used on shapes drawing