GameFramework
Game framework
Operations
- New
- AddAnimatedImageSprite
- AddFont
- AddImageSprite
- AddMixChunk
- AddRectangle
- AddTextSprite
- AddTitledImageSprite
- BuildFromFile
- Clear
- Debug
- FrameEnd
- FrameStart
- FreeFonts
- FreeMixChunks
- FreeMusic
- FreeShapes
- GetClearColor
- GetColor
- GetEvent
- GetFont
- GetFps
- GetImageSprite
- GetMixChunk
- GetRectangle
- GetRenderer
- GetShapes
- GetTextSprite
- IsOk
- Quit
- RemoveFont
- RemoveMixChunk
- RemoveSprite
- SetClearColor
- SetFont
- SetMusicChunk
- Show
AddAnimatedImageSprite
Adds an image sprite to the framework
method : public : AddAnimatedImageSprite(file:String, clips:Vector<Rect>) ~ AnimatedImageSprite
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to image asset |
clips | Vector<Rect> | vector of rendering rectangles |
Return
Type | Description |
---|---|
AnimatedImageSprite | animated image sprite |
AddAnimatedImageSprite
Adds an image sprite to the framework
method : public : AddAnimatedImageSprite(file:String) ~ AnimatedImageSprite
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to image asset |
Return
Type | Description |
---|---|
AnimatedImageSprite | animated image sprite |
AddFont
Adds a font
method : public : AddFont(file:String, size:Int) ~ Font
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to font |
size | Int | font size |
Return
Type | Description |
---|---|
Font | font |
AddImageSprite
Adds an image sprite to the framework
method : public : AddImageSprite(file:String, colorkey:Color, render_rect:Rect) ~ ImageSprite
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to image asset |
colorkey | Color | image color key |
render_rect | Rect | bounding rectangle to render |
Return
Type | Description |
---|---|
ImageSprite | image sprite |
AddImageSprite
Adds an image sprite to the framework
method : public : AddImageSprite(file:String, colorkey:Color) ~ ImageSprite
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to image asset |
colorkey | Color | image color key, may be Nil |
Return
Type | Description |
---|---|
ImageSprite | image sprite |
AddImageSprite
Adds an image sprite to the framework
method : public : AddImageSprite(file:String) ~ ImageSprite
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to image asset |
Return
Type | Description |
---|---|
ImageSprite | image sprite |
AddMixChunk
Adds a sound mix chunk
method : public : AddMixChunk(file:String) ~ MixChunk
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to sound asset |
Return
Type | Description |
---|---|
MixChunk | mix chunk |
AddRectangle
Adds a rectangle to the framework
method : public : AddRectangle(w:Int, h:Int) ~ Rectangle
Parameters
Name | Type | Description |
---|---|---|
w | Int | rectangle width |
h | Int | rectangle height |
Return
Type | Description |
---|---|
Rectangle | rectangle |
AddTextSprite
Adds a text sprite to the framework
method : public : AddTextSprite() ~ TextSprite
Return
Type | Description |
---|---|
TextSprite | text sprite |
AddTitledImageSprite
Adds an tiled image to the framework
method : public : AddTitledImageSprite(file:String, colorkey:Color) ~ TitledImageSprite
Parameters
Name | Type | Description |
---|---|---|
file | String | file path to image asset |
colorkey | Color | image color key, may be Nil |
Return
Type | Description |
---|---|
TitledImageSprite | tiled image |
BuildFromFile
Build assets from a Json file
method : public : BuildFromFile(file:String) ~ Bool
Parameters
Name | Type | Description |
---|---|---|
file | String | path to build file |
Return
Type | Description |
---|---|
Bool | true if successful, false otherwise |
Debug
Prints debug message
function : Debug(debug_msg:String) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
debug_msg | String | message |
GetClearColor
Gets the clear color
method : public : GetClearColor() ~ Color
Return
Type | Description |
---|---|
Color | clear color |
GetColor
Get specified color
method : public : GetColor(name:String) ~ Color
Parameters
Name | Type | Description |
---|---|---|
name | String | name of color |
Return
Type | Description |
---|---|
Color | color |
GetEvent
Gets the framework event
method : public : GetEvent() ~ Event
Return
Type | Description |
---|---|
Event | framework event |
GetFont
Get specified font
method : public : GetFont(name:String) ~ Font
Parameters
Name | Type | Description |
---|---|---|
name | String | name of font |
Return
Type | Description |
---|---|
Font | font |
GetImageSprite
Get specified image sprite
method : public : GetImageSprite(name:String) ~ ImageSprite
Parameters
Name | Type | Description |
---|---|---|
name | String | name of image sprite |
Return
Type | Description |
---|---|
ImageSprite | image sprite |
GetMixChunk
Get mix chunk
method : public : GetMixChunk(name:String) ~ MixChunk
Parameters
Name | Type | Description |
---|---|---|
name | String | name of mix chunk |
Return
Type | Description |
---|---|
MixChunk | mix chunk |
GetRectangle
Get specified rectangle
method : public : GetRectangle(name:String) ~ Rectangle
Parameters
Name | Type | Description |
---|---|---|
name | String | name of rectangle |
Return
Type | Description |
---|---|
Rectangle | rectangle |
GetRenderer
Gets the framework renderer
method : public : GetRenderer() ~ Renderer
Return
Type | Description |
---|---|
Renderer | framework renderer |
GetTextSprite
Get specified text sprite
method : public : GetTextSprite(name:String) ~ TextSprite
Parameters
Name | Type | Description |
---|---|---|
name | String | name of text sprite |
Return
Type | Description |
---|---|
TextSprite | text sprite |
IsOk
Initialization status flag
method : public : IsOk() ~ Bool
Return
Type | Description |
---|---|
Bool | true if initialized, false otherwise |
New
Initializes game framework
New(screen_width:Int, screen_height:Int, title:String, fps:Int, init_flags:Int)
Parameters
Name | Type | Description |
---|---|---|
screen_width | Int | screen width |
screen_height | Int | screen height |
title | String | screen title |
fps | Int | frame per second |
init_flags | Int | initialization flags |
New
Initializes game framework
New(screen_width:Int, screen_height:Int, title:String)
Parameters
Name | Type | Description |
---|---|---|
screen_width | Int | screen width |
screen_height | Int | screen height |
title | String | screen title |
RemoveFont
Remove chunk from framework
method : public : RemoveFont(font:Font) ~ Bool
Parameters
Name | Type | Description |
---|---|---|
font | Font | chunk to remove |
Return
Type | Description |
---|---|
Bool | true if successful, false otherwise |
RemoveMixChunk
Remove chunk from framework
method : public : RemoveMixChunk(mix_chunk:MixChunk) ~ Bool
Parameters
Name | Type | Description |
---|---|---|
mix_chunk | MixChunk | chunk to remove |
Return
Type | Description |
---|---|
Bool | true if successful, false otherwise |
RemoveSprite
Remove shape from framework
method : public : RemoveSprite(shape:Shape) ~ Bool
Parameters
Name | Type | Description |
---|---|---|
shape | Shape | shape to remove |
Return
Type | Description |
---|---|
Bool | true if successful, false otherwise |
SetClearColor
Sets the clear color
method : public : SetClearColor(color:Color) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
color | Color | clear color |
SetFont
Sets the game font
method : public : SetFont(font:Font) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
font | Font | game font |