1 #include "lxgui/gui_material.hpp"
12 pixel_uv *=
quad.dimensions();
14 pixel_uv +=
quad.top_left();
25 pixel_uv -=
quad.top_left();
28 pixel_uv /=
quad.dimensions();
material(bool is_atlas)
Constructor.
vector2f get_local_uv(const vector2f &canvas_uv, bool as_normalized) const
Returns local UV coordinates on the texture, given canvas UV coordinates.
virtual bounds2f get_rect() const =0
Returns the pixel rect in pixels of the canvas containing this texture (if any).
vector2f get_canvas_uv(const vector2f &texture_uv, bool from_normalized) const
Returns normalized UV coordinates on the canvas, given local UV coordinates.
bool is_in_atlas() const
Checks if the material is embedded in an atlas.
virtual vector2ui get_canvas_dimensions() const =0
Returns the physical dimensions (in pixels) of the canvas containing this texture (if any).
vector2< float > vector2f
Holds 2D coordinates (as floats)
Simple structure holding four vertices and a material.