|
Mountain
1.0.0
Simple C++ 2D Game Framework
|
The Draw class contains static functions to draw various things on screen. More...
#include <draw.hpp>
Static Public Member Functions | |
| static MOUNTAIN_API void | Clear (const Color &color) |
| Clear the current RenderTarget. More... | |
| static MOUNTAIN_API void | Point (Vector2 position, const Color &color=Color::White()) |
| static MOUNTAIN_API void | Line (Vector2 point1, Vector2 point2, const Color &color=Color::White()) |
| Draw a line. More... | |
| static MOUNTAIN_API void | Line (Vector2 point1, Vector2 point2, const Color &color1, const Color &color2) |
| Draw a line. More... | |
| static MOUNTAIN_API void | Triangle (Vector2 point1, Vector2 point2, Vector2 point3, const Color &color=Color::White()) |
| Draw a hollow triangle. More... | |
| static MOUNTAIN_API void | Triangle (Vector2 point1, Vector2 point2, Vector2 point3, const Color &color1, const Color &color2, const Color &color3) |
| Draw a hollow triangle. More... | |
| static MOUNTAIN_API void | TriangleFilled (Vector2 point1, Vector2 point2, Vector2 point3, const Color &color=Color::White()) |
| Draw a filled triangle. More... | |
| static MOUNTAIN_API void | TriangleFilled (Vector2 point1, Vector2 point2, Vector2 point3, const Color &color1, const Color &color2, const Color &color3) |
| Draw a filled triangle. More... | |
| static MOUNTAIN_API void | Rectangle (Vector2 position, Vector2 size, const Color &color=Color::White()) |
| Draw a hollow rectangle. More... | |
| static MOUNTAIN_API void | Rectangle (const Mountain::Rectangle &rectangle, const Color &color=Color::White()) |
| Draw a hollow rectangle. More... | |
| static MOUNTAIN_API void | RectangleFilled (Vector2 position, Vector2 size, const Color &color=Color::White()) |
| Draw a filled rectangle. More... | |
| static MOUNTAIN_API void | RectangleFilled (const Mountain::Rectangle &rectangle, const Color &color=Color::White()) |
| Draw a filled rectangle. More... | |
| static MOUNTAIN_API void | Circle (Vector2 center, float_t radius, Vector2 scale=Vector2::One(), const Color &color=Color::White()) |
| Draw a hollow circle. More... | |
| static MOUNTAIN_API void | CircleFilled (Vector2 center, float_t radius, Vector2 scale=Vector2::One(), const Color &color=Color::White()) |
| Draw a filled circle. More... | |
| static MOUNTAIN_API void | Arc (Vector2 center, float_t radius, float_t startingAngle, float_t deltaAngle, Vector2 scale=Vector2::One(), const Color &color=Color::White()) |
| Draw a hollow arc. More... | |
| static MOUNTAIN_API void | ArcFilled (Vector2 center, float_t radius, float_t startingAngle, float_t deltaAngle, Vector2 scale=Vector2::One(), const Color &color=Color::White()) |
| Draw a filled arc. More... | |
| static MOUNTAIN_API void | Texture (const Texture &texture, Vector2 position, Vector2 scale=Vector2::One(), float_t rotation=0.f, Vector2 origin=Vector2::Zero(), Vector2 uv0=Vector2::Zero(), Vector2 uv1=Vector2::One(), const Color &color=Color::White(), Meta::UnderlyingEnumType< DrawTextureFlipping > flipFlags=static_cast< Meta::UnderlyingEnumType< DrawTextureFlipping >>(DrawTextureFlipping::None)) |
| Draw a texture. More... | |
| static MOUNTAIN_API void | Text (const Font &font, const std::string &text, Vector2 position, float_t scale=1.f, const Color &color=Color::White()) |
| Draw text. More... | |
| static MOUNTAIN_API void | RenderTarget (const RenderTarget &renderTarget, Vector2 position=Vector2::Zero(), Vector2 scale=Vector2::One(), float_t rotation=0, Vector2 uv0=Vector2::Zero(), Vector2 uv1=Vector2::One(), const Color &color=Color::White(), Meta::UnderlyingEnumType< DrawTextureFlipping > flipFlags=static_cast< Meta::UnderlyingEnumType< DrawTextureFlipping >>(DrawTextureFlipping::None)) |
| Draw a RenderTarget. More... | |
| static MOUNTAIN_API void | Flush () |
| Flushes the cached draw data onto the current RenderTarget. More... | |
Friends | |
| class | Renderer |
| class | RenderTarget |
| class | ParticleSystem |
The Draw class contains static functions to draw various things on screen.
|
static |
Draw a hollow arc.
| center | The center position of the arc |
| radius | The radius of the arc |
| startingAngle | The starting angle of the arc |
| deltaAngle | The delta angle of the arc, e.g. the ending angle is startingAngle + deltaAngle |
| scale | The scale of the arc |
| color | The color of the arc |
|
static |
Draw a filled arc.
| center | The center position of the arc |
| radius | The radius of the arc |
| startingAngle | The starting angle of the arc |
| deltaAngle | The delta angle of the arc, e.g. the ending angle is startingAngle + deltaAngle |
| scale | The scale of the arc |
| color | The color of the arc |
|
static |
Draw a hollow circle.
| center | The center position of the circle |
| radius | The radius of the circle |
| scale | The scale of the circle |
| color | The color of the circle |
|
static |
Draw a filled circle.
| center | The center position of the circle |
| radius | The radius of the circle |
| scale | The scale of the circle |
| color | The color of the circle |
|
static |
Clear the current RenderTarget.
| color | The new color of all the pixels |
|
static |
Flushes the cached draw data onto the current RenderTarget.
This effectively renders everything that was scheduled since the last RenderTarget push/pop or Flush()
|
static |
Draw a line.
| point1 | The first point of the line |
| point2 | The second point of the line |
| color | The color of the line |
|
static |
Draw a line.
| point1 | The first point of the line |
| point2 | The second point of the line |
| color1 | The color of the first point |
| color2 | The color of the second point |
|
static |
Draw a hollow rectangle.
| position | The top-left position of the rectangle |
| size | The size of the rectangle |
| color | The color of the rectangle |
|
static |
Draw a hollow rectangle.
| rectangle | The rectangle position and size |
| color | The color of the rectangle |
|
static |
Draw a filled rectangle.
| position | The top-left position of the rectangle |
| size | The size of the rectangle |
| color | The color of the rectangle |
|
static |
Draw a filled rectangle.
| rectangle | The rectangle position and size |
| color | The color of the rectangle |
|
static |
Draw a RenderTarget.
| renderTarget | The RenderTarget to draw |
| position | The top-left position of the RenderTarget |
| scale | The scale to apply to the RenderTarget |
| rotation | The rotation in radians to apply to the RenderTarget |
| uv0 | The first texture UV position |
| uv1 | The second texture UV position |
| color | The color of the RenderTarget |
| flipFlags | Flip flags from the DrawTextureFlipping enum |
| std::invalid_argument | If uv0 is greater than uv1 |
|
static |
Draw text.
| font | The font of the text |
| text | The text to draw |
| position | The top-left position of the text |
| scale | The scale to apply to the text |
| color | The color of the text |
|
static |
Draw a texture.
| texture | The texture to draw |
| position | The position of the texture |
| scale | The scale to apply to the texture |
| rotation | The rotation in radians to apply to the texture |
| origin | The rotation origin. Value in the range [{ 0, 0 }, { 1, 1 }] |
| uv0 | The first texture UV position |
| uv1 | The second texture UV position |
| color | The tint color of the texture. Use white for default colors |
| flipFlags | Flip flags from the DrawTextureFlipping enum |
| std::invalid_argument | If uv0 is greater than uv1 |
|
static |
Draw a hollow triangle.
| point1 | The first point |
| point2 | The second point |
| point3 | The third point |
| color | The color of the triangle |
|
static |
Draw a hollow triangle.
| point1 | The first point |
| point2 | The second point |
| point3 | The third point |
| color1 | The color of the first point |
| color2 | The color of the second point |
| color3 | The color of the third point |
|
static |
Draw a filled triangle.
| point1 | The first point |
| point2 | The second point |
| point3 | The third point |
| color | The color of the triangle |
|
static |
Draw a filled triangle.
| point1 | The first point |
| point2 | The second point |
| point3 | The third point |
| color1 | The color of the first point |
| color2 | The color of the second point |
| color3 | The color of the third point |