Imported the graphics page

Kayne Ruse
2013-05-22 01:26:34 +10:00
parent c587feefa8
commit b5716d8b73
3 changed files with 20 additions and 19 deletions
-18
@@ -1,18 +0,0 @@
The graphics system is designed to be resource-efficient. It's made up of the following files:
* [surface_manager.hpp](https://github.com/Ratstail91/Tortuga/blob/master/client/surface_manager.hpp)
* [surface_manager.cpp](https://github.com/Ratstail91/Tortuga/blob/master/client/surface_manager.cpp)
* [image.hpp](https://github.com/Ratstail91/Tortuga/blob/master/client/image.hpp)
* [image.cpp](https://github.com/Ratstail91/Tortuga/blob/master/client/image.cpp)
* [sprite_sheet.hpp](https://github.com/Ratstail91/Tortuga/blob/master/client/sprite_sheet.hpp)
* [sprite_sheet.cpp](https://github.com/Ratstail91/Tortuga/blob/master/client/sprite_sheet.cpp)
## Breakdown
`surface_manager.hpp` and `surface_manager.cpp` hold the `SurfaceManager` class, which loads bitmap files into memory, distributes them throughout the program, and frees them when the resources are no longer needed.
`image.hpp` and `image.cpp` hold the `Image` class, which acts as a simple static image on the screen. This class requires that the image file is loaded beforehand, and passed to the `Image` object upon it's creation. It also handles the clipping rectangle and drawing to a specific location.
`sprite_sheet.hpp` and `sprite_sheet.cpp` hold the `SpriteSheet` class, which inherits from `Image`. This class is a specialized image that displays an animated sprite sheet to the screen (an example of a sprite sheet is shown below). In order to display this sprite sheet's animation, the width and height of a single "cell" of animation must be passed to the constructor alongside the surface. An "interval" must be specified using `SpriteSheet::SetInterval(int)`, and a "delta" value (time since the last call) must be passed to `SpriteSheet::Update(int)`.
## Example Sprite Sheet
![aniflower](http://art.devsader.com/content/contributions/sprites/Elliot_Moosader.png)
+19
@@ -0,0 +1,19 @@
_This page was copied from the [Codebase wiki](https://github.com/Ratstail91/Codebase/wiki/Graphics)._
The graphics systems are designed to be resource-efficient. They're made up of the following files:
* [surface_manager.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/surface_manager.hpp)
* [surface_manager.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/surface_manager.cpp)
* [image.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/image.hpp)
* [image.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/image.cpp)
* [sprite_sheet.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/sprite_sheet.hpp)
* [sprite_sheet.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/sprite_sheet.cpp)
* [raster_font.hpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/raster_font.hpp)
* [raster_font.cpp](https://github.com/Ratstail91/Codebase/blob/master/graphics/raster_font.cpp)
## Breakdown
`surface_manager.hpp` and `surface_manager.cpp` hold the `SurfaceManager` class, which loads bitmap files into memory, distributes them throughout the program, and frees them when the resources are no longer needed.
`image.hpp` and `image.cpp` hold the `Image` class, which acts as a simple static image on the screen. This class requires that the image file is loaded beforehand, and passed to the `Image` object. It also handles the clipping rectangle and drawing to a specific location.
`sprite_sheet.hpp` and `sprite_sheet.cpp` hold the `SpriteSheet` class, which inherits from `Image`. This class is a specialized image that displays an animated sprite sheet to the screen. In order to display this sprite sheet's animation, the width and height of a single "cell" of animation must be passed to the object alongside the surface. An "interval" must be specified using `SpriteSheet::SetInterval(int)`, and the delta time (time since the last call) must be passed to `SpriteSheet::Update(int)`.
`raster_font.hpp` and `raster_font.cpp` hold the `RasterFont` class, which inherits from `Image`. This class is used to draw text to the screen, using a specialized rasterized font surface.
+1 -1
@@ -9,7 +9,7 @@ This guide should help you to understand this project, as well as helping me to
## The Client
* [Scene Framework](wiki/Scene-Framework)
* [Graphics System](wiki/Graphics-System)
* [Graphics](wiki/Graphics)
* Player System (WIP)
## The Server