Bundle SDL2-based game framework with sprite management, collision detection, tilemaps, camera, and scene graph. Builds on sdl2.obl for structured 2D game development. Compile with -lib sdl2.
Sprite
Bitmap sprite
Implements: Shape
Operations
- AddX
- AddY
- Free
- GetBottom
- GetCenterX
- GetCenterY
- GetHeight
- GetLeft
- GetPosition
- GetRight
- GetScale
- GetTop
- GetWidth
- Render
- Set
- SetAlpha
- SetBlendMode
- SetBottom
- SetCenter
- SetCenterX
- SetCenterY
- SetColor
- SetLeft
- SetPostion
- SetRight
- SetScale
- SetTop
AddX #
Increments the current x-position
method : public : AddX(x:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | increment to the current x-position |
AddY #
Increments the current y-position
method : public : AddY(y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| y | Int | increment to the current y-position |
GetBottom #
Gets bottom position
method : public : GetBottom() ~ IntReturn
| Type | Description |
|---|---|
| Int | bottom position |
GetCenterX #
Gets the center x-position
method : public : GetCenterX() ~ IntReturn
| Type | Description |
|---|---|
| Int | center x-position |
GetCenterY #
Gets the center y-position
method : public : GetCenterY() ~ IntReturn
| Type | Description |
|---|---|
| Int | center y-position |
GetHeight #
Gets sprite height
method : public : GetHeight() ~ IntReturn
| Type | Description |
|---|---|
| Int | sprite height |
GetPosition #
Gets sprite position
method : public : GetPosition() ~ PositionReturn
| Type | Description |
|---|---|
| Position | sprite position |
GetRight #
Gets right position
method : public : GetRight() ~ IntReturn
| Type | Description |
|---|---|
| Int | right position |
GetScale #
Gets scaling percentage
method : public : GetScale() ~ FloatReturn
| Type | Description |
|---|---|
| Float | scaling percentage |
Render #
Renders sprite
method : public : Render(x:Int, y:Int, clip:Rect, angle:Float, center:Point, flip:RendererFlip) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | x position |
| y | Int | y position |
| clip | Rect | clipping rectangle |
| angle | Float | clipping rectangle |
| center | Point | center point |
| flip | RendererFlip | flip direction |
Set #
Sets upper left position
method : public : Set(x:Int, y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | x-position |
| y | Int | y-position |
Set #
Sets position
method : public : Set(v2:Vector2) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| v2 | Vector2 | vector position |
SetAlpha #
Sets alpha
method : public : SetAlpha(alpha:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| alpha | Int | setting |
SetBlendMode #
Sets blend mode
method : public : SetBlendMode(blending:BlendMode) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| blending | BlendMode | blend mode |
SetBottom #
Sets bottom position
method : public : SetBottom(y2:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| y2 | Int | bottom position |
SetCenter #
Sets cener position
method : public : SetCenter(x:Int, y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | x-position |
| y | Int | y-position |
SetCenterX #
Sets center x-position
method : public : SetCenterX(x:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | center x-position |
SetCenterY #
Sets center y-position
method : public : SetCenterY(y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| y | Int | center y-position |
SetColor #
Sets the color
method : public : SetColor(red:Int, green:Int, blue:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| red | Int | red |
| green | Int | green |
| blue | Int | blue |
SetLeft #
Sets left position
method : public : SetLeft(x:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | left position |
SetPostion #
Sets the current x-position
method : public : SetPostion(position:Position) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| position | Position | new position |
SetRight #
Sets right position
method : public : SetRight(x2:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x2 | Int | right position |