All Bundles
Surface
Core class
Operations
New
Creates new RGB surface
New(flags:Int, width:Int, height:Int, depth:Int, Rmask:Int, Gmask:Int, Bmask:Int, Amask:Int)
Parameters
Name | Type | Description |
---|
flags | Int | the flags are unused and should be set to 0 |
width | Int | the width of the surface |
height | Int | the height of the surface |
depth | Int | the depth of the surface in bits; see Remarks for details |
Rmask | Int | the red mask for the pixels |
Gmask | Int | the green mask for the pixels |
Bmask | Int | the blue mask for the pixels |
Amask | Int | the alpha mask for the pixels |
Creates new RGB surface
New(flags:Int, width:Int, height:Int, depth:Int, format:Int)
Parameters
Name | Type | Description |
---|
flags | Int | the flags are unused and should be set to 0 |
width | Int | the width of the surface |
height | Int | the height of the surface |
depth | Int | the depth of the surface in bits; see Remarks for details |
format | Int | the PixelFormatValue for the new surface's pixel format |
Blit
Perform a fast surface copy to a destination surface
method : public : Blit(srcrect:Rect, dst:Surface, dstrect:Rect) ~ Int
Parameters
Name | Type | Description |
---|
srcrect | Rect | the SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface |
dst | Surface | the SDL_Surface structure that is the blit target |
dstrect | Rect | the SDL_Rect structure representing the rectangle that is copied into |
Return
Type | Description |
---|
Int | 0 if the blit is successful or a negative error code on failure |
BlitScaled
Scaled surface copy to a destination surface
method : public : BlitScaled(srcrect:Rect, dst:Surface, dstrect:Rect) ~ Int
Parameters
Name | Type | Description |
---|
srcrect | Rect | the SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface |
dst | Surface | the SDL_Surface structure that is the blit target |
dstrect | Rect | the SDL_Rect structure representing the rectangle that is copied into |
Return
Type | Description |
---|
Int | 0 if the blit is successful or a negative error code on failure |
Convert
Copy an existing surface into a new one that is optimized for blitting to a surface of a specified pixel format
method : public : Convert(fmt:PixelFormat, flags:Int) ~ Surface
Parameters
Name | Type | Description |
---|
fmt | PixelFormat | PixelFormat structure that the new surface is optimized for |
flags | Int | flags are unused and should be set to 0 |
Return
Type | Description |
---|
Surface | new SDL_Surface structure that is created |
ConvertFormat
Copy an existing surface to a new surface of the specified format
method : public : ConvertFormat(format:Int, flags:Int) ~ Surface
Parameters
Name | Type | Description |
---|
format | Int | one of the enumerated values in SDL_PixelFormatEnum; see Remarks for details |
flags | Int | the flags are unused and should be set to 0 |
Return
Type | Description |
---|
Surface | the new surface |
CreateTexture
Create a texture from an existing surface
method : public : CreateTexture(renderer:Renderer) ~ Texture
Parameters
Name | Type | Description |
---|
renderer | Renderer | the rendering context |
Return
Type | Description |
---|
Texture | newly created texture |
Duplicate
Creates a new surface identical to the existing surface
method : public : Duplicate() ~ Surface
Return
Type | Description |
---|
Surface | a copy of the surface, or NULL on failure |
FillRect
perform a fast fill of a rectangle with a specific color
method : public : FillRect(rect:Rect, color:Int) ~ Int
Parameters
Name | Type | Description |
---|
rect | Rect | Rect structure representing the rectangle to fill, or Nil to fill the entire surface |
color | Int | color to fill with |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
Free
Frees the event
method : public : Free() ~ Nil
GetAlphaMod
Get the additional alpha value used in blit operations
method : public : GetAlphaMod(alpha:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
alpha | IntRef | holder filled in with the current alpha value |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
GetBlendMode
get the blend mode used for blit operations
method : public : GetBlendMode(blendMode:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
blendMode | IntRef | pointer filled in with the current BlendMode |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
GetClipRect
Get the clipping rectangle for a surface
method : public : GetClipRect(rect:Rect) ~ Nil
Parameters
Name | Type | Description |
---|
rect | Rect | Rect filled in with the clipping rectangle for the surface |
GetColorKey
Get the color key (transparent pixel) for a surface
method : public : GetColorKey(key:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
key | IntRef | a holder filled in with the transparent pixel |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
GetColorMod
Get the additional color value multiplied into blit operations
method : public : GetColorMod(r:IntRef, g:IntRef, b:IntRef) ~ Int
Parameters
Name | Type | Description |
---|
r | IntRef | pointer filled in with the current red color value |
g | IntRef | pointer filled in with the current green color value |
b | IntRef | pointer filled in with the current blue color value |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
GetH
Get height
method : public : GetH() ~ Int
Return
GetPitch
Get length of a row of pixels in bytes
method : public : GetPitch() ~ Int
Return
GetPixelFormat
Get pixel format
method : public : GetPixelFormat() ~ PixelFormat
Return
GetPixels
Get raw pixels
method : public : GetPixels() ~ PixelData
Return
GetW
Get width
method : public : GetW() ~ Int
Return
IsNull
Determines if the underlying SDL C-struct is NULL
method : public : IsNull() ~ Bool
Return
Type | Description |
---|
Bool | true if NULL, false otherwise |
LoadBMP
Load a surface from a BMP file.
function : LoadBMP(file:String) ~ Surface
Parameters
Name | Type | Description |
---|
file | String | the file containing a BMP image |
Return
Type | Description |
---|
Surface | newly created texture |
Lock
Set up a surface for directly accessing the pixels
method : public : Lock() ~ Int
LowerBlit
Perform low-level surface blitting only
method : public : LowerBlit(srcrect:Rect, dst:Surface, dstrect:Rect) ~ Int
Parameters
Name | Type | Description |
---|
srcrect | Rect | the SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface |
dst | Surface | the SDL_Surface structure that is the blit target |
dstrect | Rect | the SDL_Rect structure representing the rectangle that is copied into |
Return
Type | Description |
---|
Int | 0 if the blit is successful or a negative error code on failure |
LowerBlitScaled
Perform low-level surface scaled blitting only
method : public : LowerBlitScaled(srcrect:Rect, dst:Surface, dstrect:Rect) ~ Int
Parameters
Name | Type | Description |
---|
srcrect | Rect | the SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface |
dst | Surface | the SDL_Surface structure that is the blit target |
dstrect | Rect | the SDL_Rect structure representing the rectangle that is copied into |
Return
Type | Description |
---|
Int | 0 if the blit is successful or a negative error code on failure |
Rotate90Degrees
Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
method : public : Rotate90Degrees(numClockwiseTurns:Int) ~ Surface
Parameters
Name | Type | Description |
---|
numClockwiseTurns | Int | Number of clockwise 90 degree turns to apply to the source. |
Return
Type | Description |
---|
Surface | newly modified surface |
RotoZoom
Rotates and zooms a surface and optional anti-aliasing.
method : public : RotoZoom(angle:Float, zoom:Float, smooth:Bool) ~ Surface
Parameters
Name | Type | Description |
---|
angle | Float | The angle to rotate in degrees. |
zoom | Float | The scaling factor. |
smooth | Bool | Antialiasing flag; set to true to enable. |
Return
Type | Description |
---|
Surface | newly modified surface |
RotoZoomSize
Returns the size of the resulting target surface for a RotoZoom() call.
function : RotoZoomSize(width:Int, height:Int, angle:Float, zoom:Float, dstwidth:IntRef, dstheight:IntRef) ~ Nil
Parameters
Name | Type | Description |
---|
width | Int | The source surface width. |
height | Int | The source surface height. |
angle | Float | The angle to rotate in degrees. |
zoom | Float | The scaling factor. |
dstwidth | IntRef | The calculated width of the rotozoomed destination surface. |
dstheight | IntRef | The calculated height of the rotozoomed destination surface. |
RotoZoomSizeXY
Returns the size of the resulting target surface for a RotoZoomXY() call.
function : RotoZoomSizeXY(width:Int, height:Int, angle:Float, zoomx:Float, zoomy:Float, dstwidth:IntRef, dstheight:IntRef) ~ Nil
Parameters
Name | Type | Description |
---|
width | Int | The source surface width. |
height | Int | The source surface height. |
angle | Float | The angle to rotate in degrees. |
zoomx | Float | The horizontal scaling factor. |
zoomy | Float | The vertical scaling factor. |
dstwidth | IntRef | The calculated width of the rotozoomed destination surface. |
dstheight | IntRef | The calculated height of the rotozoomed destination surface. |
RotoZoomXY
Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.
method : public : RotoZoomXY(angle:Float, zoomx:Float, zoomy:Float, smooth:Bool) ~ Surface
Parameters
Name | Type | Description |
---|
angle | Float | The angle to rotate in degrees. |
zoomx | Float | The horizontal scaling factor. |
zoomy | Float | The vertical scaling factor. |
smooth | Bool | Antialiasing flag; set to true to enable. |
Return
Type | Description |
---|
Surface | newly modified surface |
SaveBMP
save a surface to a BMP file
function : SaveBMP(surface:Surface, file:String) ~ Int
Parameters
Name | Type | Description |
---|
surface | Surface | Surface instance containing the image to be saved |
file | String | file to be saved to |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
SetAlphaMod
Set an additional alpha value used in blit operations
method : public : SetAlphaMod(alpha:Int) ~ Int
Parameters
Name | Type | Description |
---|
alpha | Int | alpha value multiplied into blit operations |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
SetBlendMode
set the blend mode used for blit operations
method : public : SetBlendMode(blendMode:BlendMode) ~ Int
Parameters
Name | Type | Description |
---|
blendMode | BlendMode | BlendMode to use for blit blending |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
SetClipRect
Set the clipping rectangle for a surface
method : public : SetClipRect(rect:Rect) ~ Bool
Parameters
Name | Type | Description |
---|
rect | Rect | Rect structure representing the clipping rectangle, or Nil to disable clipping |
Return
Type | Description |
---|
Bool | Returns true if the rectangle intersects the surface, otherwise false and blits will be completely clipped |
SetColorKey
Set the color key (transparent pixel) in a surface
method : public : SetColorKey(flag:Bool, key:Int) ~ Int
Parameters
Name | Type | Description |
---|
flag | Bool | true to enable color key, false to disable color key |
key | Int | the transparent pixel |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
SetColorMod
Set an additional color value multiplied into blit operation
method : public : SetColorMod(r:Int, g:Int, b:Int) ~ Int
Parameters
Name | Type | Description |
---|
r | Int | the red color value multiplied into blit operations |
g | Int | the green color value multiplied into blit operations |
b | Int | the blue color value multiplied into blit operations |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
SetRLE
Set the RLE acceleration hint for a surface
method : public : SetRLE(flag:Int) ~ Int
Parameters
Name | Type | Description |
---|
flag | Int | 0 to disable, non-zero to enable RLE acceleration |
Return
Type | Description |
---|
Int | 0 on success or a negative error code on failure |
Shrink
Shrink a surface by an integer ratio using averaging.
method : public : Shrink(factorx:Int, factory:Int) ~ Surface
Parameters
Name | Type | Description |
---|
factorx | Int | The horizontal shrinking ratio. |
factory | Int | The vertical shrinking ratio. |
Return
Type | Description |
---|
Surface | newly modified surface |
Unlock
Release a surface after directly accessing the pixels
method : public : Unlock() ~ Nil
Zoom
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
method : public : Zoom(zoomx:Float, zoomy:Float, smooth:Bool) ~ Surface
Parameters
Name | Type | Description |
---|
zoomx | Float | The horizontal scaling factor. |
zoomy | Float | The vertical scaling factor. |
smooth | Bool | Antialiasing flag; set to true to enable. |
Return
Type | Description |
---|
Surface | newly modified surface |
ZoomSize
Returns the size of the resulting target surface for a Zoom() call.
function : ZoomSize(width:Int, height:Int, zoomx:Float, zoomy:Float, dstwidth:IntRef, dstheight:IntRef) ~ Nil
Parameters
Name | Type | Description |
---|
width | Int | The source surface width. |
height | Int | The source surface height. |
zoomx | Float | The horizontal scaling factor. |
zoomy | Float | The vertical scaling factor. |
dstwidth | IntRef | The calculated width of the rotozoomed destination surface. |
dstheight | IntRef | The calculated height of the rotozoomed destination surface. |