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.
Rectangle
Rectangle shape
Implements: Shape
Operations
- AddX
- AddY
- GetBottom
- GetCenterX
- GetColor
- GetFill
- GetHeight
- GetLeft
- GetPosition
- GetRight
- GetTop
- GetWidth
- Render
- Set
- SetBottom
- SetCenter
- SetCenterX
- SetCenterY
- SetColor
- SetFill
- SetLeft
- SetPostion
- SetRight
- 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 |
GetFill #
Sets color fill
method : public : GetFill() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | if true, color fills rectangle; false otherwise |
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 |
Render #
Renders an image
method : public : Render(x:Int, y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | x-position |
| y | Int | y-position |
Set #
Sets left upper 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 |
SetBottom #
Sets bottom position
method : public : SetBottom(y2:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| y2 | Int | bottom position |
SetCenter #
Sets center position
method : public : SetCenter(x:Int, y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | x-position |
| y | Int | y-position |
SetCenterX #
Sets center y-position
method : public : SetCenterX(x:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| x | Int | center y-position |
SetCenterY #
Sets center y-position
method : public : SetCenterY(y:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| y | Int | center y-position |
SetColor #
Sets rectangle color
method : public : SetColor(color:Color) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| color | Color | color |
SetFill #
Sets color fill
method : public : SetFill(fill:Bool) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| fill | Bool | if true, color fills rectangle; false otherwise |
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 |