1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-10-09 23:57:26 -04:00

document and demo PlotText colors

This commit is contained in:
epezent 2020-08-16 00:24:09 -05:00
parent df0a159391
commit 510366e12e
2 changed files with 4 additions and 1 deletions

View File

@ -280,7 +280,7 @@ void PlotDigital(const char* label_id, const float* xs, const float* ys, int cou
void PlotDigital(const char* label_id, const double* xs, const double* ys, int count, int offset = 0, int stride = sizeof(double));
void PlotDigital(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, int offset = 0);
// Plots a text label at point x,y.
// Plots a text label at point x,y. Text color can be changed with ImGui::PushStyleColor(ImGuiCol_Text, ...).
void PlotText(const char* text, float x, float y, bool vertical = false, const ImVec2& pixel_offset = ImVec2(0,0));
void PlotText(const char* text, double x, double y, bool vertical = false, const ImVec2& pixel_offset = ImVec2(0,0));

View File

@ -540,7 +540,10 @@ void ShowDemoWindow(bool* p_open) {
ImPlot::PlotText("Filled Markers", 1.5, 11.75);
ImPlot::PlotText("Open Markers", 6.75, 11.75);
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0,1,0,1));
ImPlot::PlotText("Fancy Markers", 4.5, 4.25, true);
ImGui::PopStyleColor();
ImPlot::SetColormap(ImPlotColormap_Default);