Otter  0.9.8.91
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Draw Class Reference

Class used for rendering graphics. More...

Static Public Member Functions

static void Graphic (Graphic graphic, float x=0, float y=0)
 Renders a Graphic to the current target Surface. More...
 
static void Entity (Entity e)
 Renders an Entity. More...
 
static void Entity (Entity e, float x=0, float y=0)
 Renders an Entity at a specified X Y position. More...
 
static void Text (string str, int size, float x=0, float y=0)
 Draws simple Text. Should only be used for debugging as this creates Text Graphics each time it's called! More...
 
static void ImageClip (Image image, Rectangle clip, float x=0, float y=0)
 Renders a clipped Image to the current target Surface. More...
 
static void ImageWaveX (Image image, int step, float timer, float rate, float amp, float freq, float x=0, float y=0)
 Draws an Image in parts to form a horizontally waving image. More...
 
static void ImageWaveY (Image image, int step, float timer, float rate, float amp, float freq, float x=0, float y=0)
 Draws an Image in parts to form a vertically waving image. More...
 
static void SetTarget (Surface target)
 Change the Surface that is being rendered to. More...
 
static void ResetTarget ()
 Reset the Surface that is being rendered to back to the default for the current Game. More...
 
static void Circle (float x, float y, int radius, Color fill=null, Color outline=null, float outlineThickness=0)
 Draws a circle. Recommended to use only for debugging purposes. More...
 
static void Circle (float x, float y, float radius, Color color)
 Draws a circle. Recommended to use only for debugging purposes. More...
 
static void Rectangle (float x, float y, float width, float height, Color fill=null, Color outline=null, float outlineThickness=0)
 Draws a rectangle. Recommended to use only for debugging purposes. More...
 
static void Line (float x1, float y1, float x2, float y2, Color color)
 Draws a line using an OpenGL line. More...
 
static void Line (float x1, float y1, float x2, float y2, Color color, float thickness)
 Draws a line with a thickness using a quad. More...
 
static void RoundedLine (float x1, float y1, float x2, float y2, Color color, float thickness)
 Draws a line with rounded ends. More...
 

Properties

static Surface Target [get, set]
 The current target Surface to render to. More...
 
static Surface GameTarget [get, set]
 The surface that current Game is rendering to. More...
 

Detailed Description

Class used for rendering graphics.

Member Function Documentation

static void Otter.Draw.Circle ( float  x,
float  y,
int  radius,
Color  fill = null,
Color  outline = null,
float  outlineThickness = 0 
)
static

Draws a circle. Recommended to use only for debugging purposes.

Parameters
xThe X position of the top left of the circle.
yThe Y position of the top left of the circle.
radiusThe radius of the circle.
fillThe fill color of the circle.
outlineThe outline color of the circle.
outlineThicknessThe outline thickness of the circle.
static void Otter.Draw.Circle ( float  x,
float  y,
float  radius,
Color  color 
)
static

Draws a circle. Recommended to use only for debugging purposes.

Parameters
xThe X position of the top left of the circle.
yThe Y position of the top left of the circle.
radiusThe radius of the circle.
colorThe fill color of the circle.
static void Otter.Draw.Entity ( Entity  e)
static

Renders an Entity.

Parameters
eThe Entity to render.
static void Otter.Draw.Entity ( Entity  e,
float  x = 0,
float  y = 0 
)
static

Renders an Entity at a specified X Y position.

Parameters
eThe Entity to render.
xThe X position to place the Entity for rendering.
yThe Y position to place the Entity for rendering.
static void Otter.Draw.Graphic ( Graphic  graphic,
float  x = 0,
float  y = 0 
)
static

Renders a Graphic to the current target Surface.

Parameters
graphicThe Graphic to render.
xThe x offset to position the Graphic at.
yThe y offset to position the Graphic at.
static void Otter.Draw.ImageClip ( Image  image,
Rectangle  clip,
float  x = 0,
float  y = 0 
)
static

Renders a clipped Image to the current target Surface.

Parameters
imagethe Image to render.
clipThe portion of the Image to render.
xThe x offset to position the Image at.
yThe y offset to position the Image at.
static void Otter.Draw.ImageWaveX ( Image  image,
int  step,
float  timer,
float  rate,
float  amp,
float  freq,
float  x = 0,
float  y = 0 
)
static

Draws an Image in parts to form a horizontally waving image.

Parameters
imageThe image to draw.
stepHow many steps to iterate through for the wave.
timerThe timer the wave should act with.
rateThe rate which the wave should move at.
ampHow far the wave will offset the image.
freqHow frequent the wave should repeat.
xThe x position to draw the image from.
yThe y position to draw the image from.
static void Otter.Draw.ImageWaveY ( Image  image,
int  step,
float  timer,
float  rate,
float  amp,
float  freq,
float  x = 0,
float  y = 0 
)
static

Draws an Image in parts to form a vertically waving image.

Parameters
imageThe image to draw.
stepHow many steps to iterate through for the wave.
timerThe timer the wave should act with.
rateThe rate which the wave should move at.
ampHow far the wave will offset the image.
freqHow frequent the wave should repeat.
xThe x position to draw the image from.
yThe y position to draw the image from.
static void Otter.Draw.Line ( float  x1,
float  y1,
float  x2,
float  y2,
Color  color 
)
static

Draws a line using an OpenGL line.

Parameters
x1The X position of the first point.
y1The Y position of the first point.
x2The X position of the second point.
y2The Y position of the second point.
colorThe color of the line.
static void Otter.Draw.Line ( float  x1,
float  y1,
float  x2,
float  y2,
Color  color,
float  thickness 
)
static

Draws a line with a thickness using a quad.

Parameters
x1The X position of the first point.
y1The Y position of the first point.
x2The X position of the second point.
y2The Y position of the second point.
colorThe color of the line.
thicknessThe thickness of the line.
static void Otter.Draw.Rectangle ( float  x,
float  y,
float  width,
float  height,
Color  fill = null,
Color  outline = null,
float  outlineThickness = 0 
)
static

Draws a rectangle. Recommended to use only for debugging purposes.

Parameters
xThe X position of the top left of the rectangle.
yThe Y position of the top left of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
fillThe fill color of the rectangle.
outlineThe outline color of the rectangle.
outlineThicknessThe outline thickness of the rectangle.
static void Otter.Draw.ResetTarget ( )
static

Reset the Surface that is being rendered to back to the default for the current Game.

static void Otter.Draw.RoundedLine ( float  x1,
float  y1,
float  x2,
float  y2,
Color  color,
float  thickness 
)
static

Draws a line with rounded ends.

Parameters
x1The X position of the first point.
y1The Y position of the first point.
x2The X position of the second point.
y2The Y position of the second point.
colorThe color of the line.
thicknessThe thickness of the line.
static void Otter.Draw.SetTarget ( Surface  target)
static

Change the Surface that is being rendered to.

Parameters
targetThe new target Surface.
static void Otter.Draw.Text ( string  str,
int  size,
float  x = 0,
float  y = 0 
)
static

Draws simple Text. Should only be used for debugging as this creates Text Graphics each time it's called!

Parameters
strThe string to display.
sizeThe size of the Text.
xThe X position to render the Text from.
yThe Y position to render the Text from.

Property Documentation

Surface Otter.Draw.GameTarget
staticgetset

The surface that current Game is rendering to.

Surface Otter.Draw.Target
staticgetset

The current target Surface to render to.


The documentation for this class was generated from the following file: