function p.__on_start(wid)
    --This function is called when this
    --hud window is added to the hud.
    --The function to add a window to the hud is
    --"ga_hud_window_add".
    --That function takes both the window name
    --and the "priority".
    --Windows are rendered in order from
    --smallest priority to highest.
    --The name of this window is "hud_diamonds".
end

function p.__on_end(wid)
    --This function is called when this
    --hud window is removed from the hud.
    --The function to remove a window from the hud
    --is "ga_hud_window_remove".
end

function p.__render(wid)
    --"ga_win_" stands for "window API".
    ga_win_set_char_size(wid, 0.012, 0.024)
    ga_win_set_front_color(wid, std.vec(0.0,1.0,0.0)) --green

    --"ga_" stands for "game API".
    --Getting the number of diamonds from
    --the global variable "game.diamonds".
    --The engine stores this in the environment variable
    local num_diamonds = ga_get_i("game.diamonds")

    --Rendering text centered at the x-value 0.97
    --with a min_y value of 0.3.
    ga_win_txt_center_at_bg(wid, 0.97, 0.3, num_diamonds)

    --Rendering a quad.
    --Args: min_x, min_y, max_x, max_y, tex_name.
    ga_win_quad(wid, 0.94,0.2, 1.0,0.3, "diamond")
end
