xmario/README.md

27 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

## xSDL
2019-11-05 20:50:17 +00:00
```yaml
package: xSDL
language: c++
version: 0.1.0
author: xdrm-brackets
```
xSDL is a simple 2D wrapper around the SDL2 to make your life easier.
### Documentation
The API aims to be straightforward as possible and tries to take advantage of patterns and principles to achieve its goal.
> xSDL can be compiled as a dynamic library (_e.g. lib.so_). The include header is located in _include/xSDL.h_. It can also be compiled directly within your application.
The class `xApplication` is a singleton representing your application, its window, renderer, etc. An `xApplication` features a `xController` that manages user input.
The interface `xElement` represents any graphical feature to be drawn on the screen. Any number of `xElement` can be pushed to or pulled from the application at any time in order to show them or not.
The interface `xOrchestrable` represents any class that can be called during the application scheduling. Any number of `xOrchestrable` can be added or removed from the application at any time in order to execute them or not.
The class `xSprite` represents a sprite that can is a rectangle that can draw either as a single color, an image, or a copy of another sprite. It can be moved over time. Also, it allows you to set a custom clip if this is an image sprite.
The class `xSpriteAnimation` derives from an image sprite, which clip can change over time. These clips are called _frames_ and have to be set beforehand. It is also an orchestrable (i.e. animates on application ticks), you can start or stop the animation with a specified time interval. Every `xSpriteAnimation` is scheduled by the `xApplication`.