rudl_video_sdl_gfx

Back to index

# Index

SDL_gfx functions
SDL_gfx: SDL_rotozoom
`Surface#rotozoom( angle, zoom, smooth )`
`Surface#zoom( zoom_horizontal, zoom_vertical, smooth )`
SDL_gfx: SDL_gfxPrimitives
`Surface#plot( coordinate, color )`
`Surface#[ x, y ]= color`
`Surface#horizontal_line( coord, endx, color )`
`Surface#vertical_line( coord, endy, color )`
`Surface#rectangle( rect, color )`
`Surface#filled_rectangle( rect, color )`
`Surface#line( coord1, coord2, color )`
`Surface#antialiased_line( coord1, coord2, color )`
`Surface#circle( coord, radius, color )`
`Surface#filled_circle( coord, radius, color )`
`Surface#antialiased_circle( coord, radius, color )`
`Surface#filled_pie( coord, radius, start, end, color )`
`Surface#ellipse( coord, radius_x, radius_y, color )`
`Surface#antialiased_ellipse( coord, radius_x, radius_y, color )`
`Surface#filled_ellipse( coord, radius_x, radius_y, color )`
`Surface#polygon( coord_list, color )`
`Surface#filled_polygon( coord_list, color )`
`Surface#antialiased_polygon( coord_list, color)`
`Surface#print( coord, text, color )`

# SDL_gfx functions

SDL_gfx was written by Andreas Schiffler. See <URL:http://de.ferzkopp.net/>

## SDL_gfx: SDL_rotozoom

`Surface#rotozoom( angle, zoom, smooth )`

Returns a new surface that is rotated angle degrees and zoomed zoom times (fractions are OK). This method returns a 32 bit surface. Exception: for now it returns an 8 bit surface when fed an 8 bit surface. If smooth is true and the surface is not 8 bits, bilinear interpolation will be applied, resulting in a smoother image.

`Surface#zoom( zoom_horizontal, zoom_vertical, smooth )`

Returns a new surface that is zoomed. 1.0 doesn't zoom, bigger than 1.0 zooms in, smaller than 1.0 zooms out. This method returns a 32 bit surface. Exception: for now it returns an 8 bit surface when fed an 8 bit surface. If smooth is true and the surface is not 8 bits, bilinear interpolation will be applied, resulting in a smoother image. (The last two methods are from Andreas Schiffler's SDL_rotozoom, aschiffler@home.com)

## SDL_gfx: SDL_gfxPrimitives

For these methods, "antialiased" means that drawing is done with many shades of the requested color to simulate

`Surface#plot( coordinate, color )`
`Surface#[ x, y ]= color`

These methods access single pixels on a surface. plot or []= set a pixel to color at coordinate. get or [] get the color of a pixel. These methods require the surface to be locked if neccesary. []= and [] are the only methods in RUDL that take a seperate x and y coordinate.

`Surface#horizontal_line( coord, endx, color )`

`Surface#vertical_line( coord, endy, color )`

`Surface#rectangle( rect, color )`

`Surface#filled_rectangle( rect, color )`

`Surface#line( coord1, coord2, color )`

`Surface#antialiased_line( coord1, coord2, color )`

`Surface#circle( coord, radius, color )`

`Surface#filled_circle( coord, radius, color )`

`Surface#antialiased_circle( coord, radius, color )`

`Surface#filled_pie( coord, radius, start, end, color )`

`Surface#ellipse( coord, radius_x, radius_y, color )`

`Surface#antialiased_ellipse( coord, radius_x, radius_y, color )`

`Surface#filled_ellipse( coord, radius_x, radius_y, color )`

These methods are thought to be self-explanatory. Filled_rectangle is a lot like fill. Fill comes from SDL, filled_rectangle from SDL_gfx, choose whichever you like best.

`Surface#polygon( coord_list, color )`

`Surface#filled_polygon( coord_list, color )`

`Surface#antialiased_polygon( coord_list, color)`

The polygon methods take an array of [x,y], like [[10,10],[40,60],[16,66]].

`Surface#print( coord, text, color )`

Puts text on the surface in a monospaced 8x8 standard old ASCII font.

Back to index