Bitmap

The bitmap class. Bitmaps represent images.

Sprites (Sprite) and other objects must be used to display bitmaps onscreen.

Superclass

Class Methods

Bitmap.new(filename)

Loads the graphic file specified in filename and creates a bitmap object.

Also automatically searches files included in RGSS-RTP and encrypted archives. File extensions may be omitted.

Bitmap.new(width, height)

Creates a bitmap object of the specified size.

Methods

dispose

Frees the bitmap. If the bitmap has already been freed, does nothing.

disposed?

Returns true if the bitmap has been freed.

width

Gets the bitmap width.

height

Gets the bitmap height.

rect

Gets the bitmap rectangle (Rect).

blt(x, y, src_bitmap, src_rect[, opacity])

Performs a block transfer from the src_bitmap box src_rect (Rect) to the specified bitmap coordinates (x, y).

opacity can be set from 0 to 255.

stretch_blt(dest_rect, src_bitmap, src_rect[, opacity])

Performs a block transfer from the src_bitmap box src_rect (Rect) to the specified bitmap box dest_rect (Rect).

opacity can be set from 0 to 255.

fill_rect(x, y, width, height, color)
fill_rect(rect, color)

Fills the bitmap box (x, y, width, height) or rect (Rect) with color (Color).

gradient_fill_rect(x, y, width, height, color1, color2[, vertical])
gradient_fill_rect(rect, color1, color2[, vertical])

Fills in this bitmap box (x, y, width, height) or rect (Rect) with a gradient from color1 (Color) to color2 (Color).

Set vertical to true to create a vertical gradient. Horizontal gradient is the default.

clear

Clears the entire bitmap.

clear_rect(x, y, width, height)
clear_rect(rect)

Clears this bitmap box or (x, y, width, height) or rect (Rect).

get_pixel(x, y)

Gets the color (Color) at the specified pixel (x, y).

set_pixel(x, y, color)

Sets the specified pixel (x, y) to color (Color).

hue_change(hue)

Changes the bitmap's hue within 360 degrees of displacement.

This process is time-consuming. Furthermore, due to conversion errors, repeated hue changes may result in color loss.

blur

Applies a blur effect to the bitmap. This process is time consuming.

radial_blur(angle, division)

Applies a radial blur to the bitmap. angle is used to specify an angle from 0 to 360. The larger the number, the greater the roundness.

division is the division number (from 2 to 100). The larger the number, the smoother it will be. This process is very time consuming.

draw_text(x, y, width, height, str[, align])
draw_text(rect, str[, align])

Draws the string str in the bitmap box (x, y, width, height) or rect (Rect).

If str is not a character string object, it will be converted to a character string using the to_s method before processing is performed.

If the text length exceeds the box's width, the text width will automatically be reduced by up to 60 percent.

Horizontal text is left-aligned by default. Set align to 1 to center the text and to 2 to right-align it. Vertical text is always centered.

As this process is time-consuming, redrawing the text with every frame is not recommended.

text_size(str)

Gets the box (Rect) used when drawing the string str with the draw_text method. Does not include the outline portion (RGSS3) and the angled portions of italicized text.

If str is not a character string object, it will be converted to a character string using the to_s method before processing is performed.

Property

font

The font (Font) used to draw a string with the draw_text method.