class SDL::Surface

Defined in:

surface.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(surface : Pointer(LibSDL::Surface)) #

[View source]

Class Method Detail

def self.from(buffer : Bytes, width, height, format : PixelFormat) #

[View source]

Instance Method Detail

def alpha_mod #

[View source]
def alpha_mod=(alpha) #

[View source]
def blend_mode #

[View source]
def blend_mode=(blend_mode : BlendMode) #

[View source]
def blit(dst : Surface, srcrect = nil, dstrect = nil) #

Fast copy of this Surface to dst Surface.


[View source]
def blit_scaled(dst : Surface, srcrect = nil, dstrect = nil) #

Fast scaled copy of this Surface to dst Surface. Scales to the whole surface by default.


[View source]
def clip_rect #

[View source]
def clip_rect=(rect) #

[View source]
def color(r, g, b, a = nil) #

Maps an RGB(A) color for this surface.


[View source]
def color_key #

[View source]
def color_key=(rgb) #

[View source]
def color_mod #

[View source]
def color_mod=(rgb) #

[View source]
def convert(surface) #

Copy this surface into a new one that is optimized for blitting to the given surface.


[View source]
def fill(rect : Nil, r, g, b, a = nil) #

Fill the whole surface with a RGB(A) color.


[View source]
def fill(rect : SDL::Rect, r, g, b, a = nil) #

Fill a rect of the surface with a RGB(A) color.


[View source]
def fill(r, g, b, a = nil) #

Fill the whole surface with a RGB(A) color.


[View source]
def finalize #

[View source]
def flags #

[View source]
def format #

[View source]
def height #

[View source]
def lock(&) #

[View source]
def pitch #

[View source]
def save_bmp(path) #

Saves the Surface as a BMP image.


[View source]
def set_color_key(rgb, flag = 1) #

[View source]
def to_unsafe : Pointer(LibSDL::Surface) #

[View source]
def width #

[View source]