View Source Rayex.Shapes (Rayex v0.0.3)

Shapes related functions

Summary

Functions

Check if point is inside rectangle

Draw rectangle outline with extended parameters

Draw a color-filled rectangle

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

Get collision info between ray and box

Set texture and rectangle to be used on shapes drawing

Functions

Link to this function

check_collision_point_rec(point, rectangle)

View Source
@spec check_collision_point_rec(
  Rayex.Structs.Vector2.t(),
  Rayex.Structs.Rectangle.t()
) :: boolean()

Check if point is inside rectangle

Link to this function

draw_line(start_x, start_y, end_x, end_y, color)

View Source
@spec draw_line(integer(), integer(), integer(), integer(), Rayex.Structs.Color.t()) ::
  :ok

Draw a line

@spec draw_pixel(integer(), integer(), Rayex.Structs.Color.t()) :: :ok

Draw a pixel

Link to this function

draw_rectangle_lines_ex(rectangle, line_thick, color)

View Source
@spec draw_rectangle_lines_ex(
  Rayex.Structs.Rectangle.t(),
  integer(),
  Rayex.Structs.Color.t()
) :: :ok

Draw rectangle outline with extended parameters

Link to this function

draw_rectangle_rec(rectangle, color)

View Source
@spec draw_rectangle_rec(Rayex.Structs.Rectangle.t(), Rayex.Structs.Color.t()) :: :ok

Draw a color-filled rectangle

Link to this function

draw_triangle(vertice1, vertice2, vertice3, color)

View Source

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

Link to this function

get_ray_collision_box(ray, bounding_box)

View Source

Get collision info between ray and box

Link to this function

set_shapes_texture(texture, source)

View Source
@spec set_shapes_texture(Rayex.Structs.Texture2D.t(), Rayex.Structs.Rectangle.t()) ::
  :ok

Set texture and rectangle to be used on shapes drawing