📜
RGSS Reference Manual
  • RGSS Reference Manual
  • RGSS Specifications
  • Ruby Syntax
    • Syntax and Expressions
    • Variables and Constants
    • Literals
    • Operator Expressions
    • Control Structures
    • Method Calls
    • Class and Method Definitions
  • Standard Library
    • Built-in Functions
    • Built-in Variables
    • Built-in Classes
      • Object
        • Array
        • Exception
        • FalseClass
        • Hash
        • IO
          • File
        • MatchData
        • Module
          • Class
        • NilClass
        • Numeric
          • Integer
            • Bignum
            • Fixnum
          • Float
        • Range
        • Proc
        • Regexp
        • String
        • Symbol
        • Time
        • TrueClass
    • Built-in Modules
      • Comparable
      • Enumerable
      • Errno
      • FileTest
      • GC
      • Kernel
      • Marshal
      • Math
    • Built-in Exception Classes
  • Game Library
    • RGSS Built-in Functions
    • RGSS Built-in Classes
      • Bitmap
      • Color
      • Font
      • Plane
      • Rect
      • Sprite
      • Table
      • Tilemap
      • Tone
      • Viewport
      • Window
      • RGSSError
      • RPG::Sprite
      • RPG::Weather
    • RGSS Built-in Modules
      • Audio
      • Graphics
      • Input
      • RPG
      • RPG::Cache
    • RPGXP Data Structures
      • RPG::Map
      • RPG::MapInfo
      • RPG::Event
      • RPG::Event::Page
      • RPG::Event::Page::Condition
      • RPG::Event::Page::Graphic
      • RPG::EventCommand
      • RPG::MoveRoute
      • RPG::MoveCommand
      • RPG::Actor
      • RPG::Class
      • RPG::Class::Learning
      • RPG::Skill
      • RPG::Item
      • RPG::Weapon
      • RPG::Armor
      • RPG::Enemy
      • RPG::Enemy::Action
      • RPG::Troop
      • RPG::Troop::Member
      • RPG::Troop::Page
      • RPG::Troop::Page::Condition
      • RPG::State
      • RPG::Animation
      • RPG::Animation::Frame
      • RPG::Animation::Timing
      • RPG::Tileset
      • RPG::CommonEvent
      • RPG::System
      • RPG::System::Words
      • RPG::System::TestBattler
      • RPG::AudioFile
  • Appendix
    • Regular Expression
    • sprintf Format
Powered by GitBook
On this page
  • Superclass
  • Class Methods
  • Bitmap.new(filename)
  • Bitmap.new(width, height)
  • Methods
  • dispose
  • disposed?
  • width
  • height
  • rect
  • blt(x, y, src_bitmap, src_rect[, opacity])
  • stretch_blt(dest_rect, src_bitmap, src_rect[, opacity])
  • fill_rect(x, y, width, height, color)fill_rect(rect, color)
  • clear
  • get_pixel(x, y)
  • set_pixel(x, y, color)
  • hue_change(hue)
  • draw_text(x, y, width, height, str[, align])draw_text(rect, str[, align])
  • text_size(str)
  • Property
  • font
  1. Game Library
  2. RGSS Built-in Classes

Bitmap

The bitmap class. Bitmaps are expressions of so-called graphics.

PreviousRGSS Built-in ClassesNextColor

Last updated 2 years ago

Sprites () and other objects must be used to display bitmaps on the screen.

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 with 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

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

opacity can be set from 0 to 255.

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

opacity can be set from 0 to 255.

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

clear

Clears the entire bitmap.

get_pixel(x, y)

set_pixel(x, y, 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.

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

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)

Property

font

Gets the bitmap rectangle ().

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

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

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

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

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

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

Gets the box () used when drawing a string str with the draw_text method. Does not include the angled portions of italicized text.

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

Sprite
Object
Rect
Rect
Rect
Rect
Rect
Color
Color
Color
Rect
Rect
Font