1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #ifndef TEXTURE_FRAME_H
- #define TEXTURE_FRAME_H
- #include "scene/gui/control.h"
- class TextureRect : public Control {
- GDCLASS(TextureRect, Control);
- public:
- enum StretchMode {
- STRETCH_SCALE_ON_EXPAND,
- STRETCH_SCALE,
- STRETCH_TILE,
- STRETCH_KEEP,
- STRETCH_KEEP_CENTERED,
- STRETCH_KEEP_ASPECT,
- STRETCH_KEEP_ASPECT_CENTERED,
- STRETCH_KEEP_ASPECT_COVERED,
- };
- private:
- bool expand;
- Ref<Texture> texture;
- StretchMode stretch_mode;
- protected:
- void _notification(int p_what);
- virtual Size2 get_minimum_size() const;
- static void _bind_methods();
- public:
- void set_texture(const Ref<Texture> &p_tex);
- Ref<Texture> get_texture() const;
- void set_expand(bool p_expand);
- bool has_expand() const;
- void set_stretch_mode(StretchMode p_mode);
- StretchMode get_stretch_mode() const;
- TextureRect();
- ~TextureRect();
- };
- VARIANT_ENUM_CAST(TextureRect::StretchMode);
- #endif
|