2017-01-16 20:40:45 -05:00
|
|
|
#pragma once
|
|
|
|
#include "starlight/_global.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "starlight/ThemeManager.h"
|
|
|
|
#include "starlight/gfx/ThemeRef.h"
|
|
|
|
|
|
|
|
#include "starlight/gfx/DrawContextCanvas.h"
|
|
|
|
|
|
|
|
#include "starlight/ui/UIElement.h"
|
|
|
|
|
|
|
|
namespace starlight {
|
|
|
|
namespace ui {
|
|
|
|
class Image : public UIElement {
|
|
|
|
private:
|
|
|
|
//
|
|
|
|
public:
|
|
|
|
gfx::ThemeRef<gfx::Drawable> image;
|
|
|
|
Color tint = Color::white;
|
2017-03-05 09:12:17 -05:00
|
|
|
bool blockTouch = false;
|
2017-01-16 20:40:45 -05:00
|
|
|
|
|
|
|
Image(VRect rect, const std::string& imgPath);
|
|
|
|
Image(Vector2 pos, const std::string& imgPath);
|
|
|
|
~Image() override { }
|
|
|
|
|
|
|
|
void SetImage(const std::string& imgPath, bool resize = true);
|
|
|
|
|
|
|
|
void Draw() override;
|
2017-03-05 09:12:17 -05:00
|
|
|
|
|
|
|
bool InterceptsTouch(Vector2 where) override { return blockTouch; }
|
2017-01-16 20:40:45 -05:00
|
|
|
};
|
|
|
|
}
|
2017-03-05 09:12:17 -05:00
|
|
|
}
|