supertux
|
This class provides functions for drawing things on screen. More...
#include <drawing_context.hpp>
Public Member Functions | |
DrawingContext (VideoSystem &video_system, obstack &obst, bool overlay, float time_offset) | |
Rectf | get_cliprect () const |
Returns the visible area in world coordinates. | |
Canvas & | color () |
Canvas & | light () |
Canvas & | get_canvas (DrawingTarget target) |
void | set_ambient_color (Color ambient_color) |
Color | get_ambient_color () const |
void | push_transform () |
void | pop_transform () |
DrawingTransform & | transform () |
const DrawingTransform & | transform () const |
const Vector & | get_translation () const |
void | set_translation (const Vector &newtranslation) |
float | get_scale () const |
void | scale (float scale) |
bool | perspective_scale (float speed_x, float speed_y) |
Recalculates the scaling factor for parallax layers. More... | |
void | set_flip (Flip flip) |
Apply that flip in the next draws (flips are listed on surface.h). More... | |
Flip | get_flip () const |
void | set_alpha (float alpha) |
apply that alpha in the next draws (1.0 means fully opaque) | |
float | get_alpha () const |
void | set_time_offset (float time_offset) |
For position extrapolation at high frame rates: real time since last game update step. | |
float | get_time_offset () const |
void | clear () |
void | set_viewport (const Rect &viewport) |
const Rect & | get_viewport () const |
float | get_width () const |
float | get_height () const |
Vector | get_size () const |
Rectf | get_rect () const |
bool | use_lightmap () const |
bool | is_overlay () const |
This class provides functions for drawing things on screen.
It also maintains a stack of transforms that are applied to graphics.
bool DrawingContext::perspective_scale | ( | float | speed_x, |
float | speed_y | ||
) |
Recalculates the scaling factor for parallax layers.
void DrawingContext::set_flip | ( | Flip | flip | ) |
Apply that flip in the next draws (flips are listed on surface.h).