diff options
Diffstat (limited to 'source/windowing/StarGuiContext.cpp')
-rw-r--r-- | source/windowing/StarGuiContext.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/windowing/StarGuiContext.cpp b/source/windowing/StarGuiContext.cpp index 10cbefc..463e341 100644 --- a/source/windowing/StarGuiContext.cpp +++ b/source/windowing/StarGuiContext.cpp @@ -307,6 +307,15 @@ void GuiContext::drawImageStretchSet(ImageStretchSet const& imageSet, RectF cons drawInterfaceQuad(imageSet.end, RectF(Vec2F(), Vec2F(textureSize(imageSet.end))), end, color); } +bool GuiContext::trySetCursor(Drawable const& drawable, Vec2I const& offset, int pixelRatio) { + if (!drawable.isImage()) + return false; + + auto assets = Root::singleton().assets(); + auto& imagePath = drawable.imagePart().image; + return applicationController()->setCursorImage(imagePath, assets->image(imagePath), pixelRatio, offset); +} + RectF GuiContext::renderText(String const& s, TextPositioning const& position) { return textPainter()->renderText(s, position); } |