Kain Nobel
Member
This topic is already resolved.
Good day everybody!
I need a little help, because I'm confusing myself now @_@
Okay, what I'm trying to do is create a easy method to temporarily clone a Window's Cursor Rect graphic. First of all, I made the base method and did it based off a bitmap.fill_rect(), and this method on its own works fine.
But now, what I want to do is 'blt' the Windowskin's cursor graphic, then stretch it to the size of the real cursor, and blt it onto self.contents, but I can't even get the graphic to show up. (Note: cursor_width and cursor_height are newly defined methods for this script)
All I really need to know is, how do I go about cloning and singling out the self.windowskin's cursor graphic, and stretch it onto the Window?
I need a little help, because I'm confusing myself now @_@
Okay, what I'm trying to do is create a easy method to temporarily clone a Window's Cursor Rect graphic. First of all, I made the base method and did it based off a bitmap.fill_rect(), and this method on its own works fine.
Code:
#-----------------------------------------------------------------------------
# * Clone Cursor
#-----------------------------------------------------------------------------
def clone_cursor
row = @index / @column_max
self.top_row = row if row < self.top_row
self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1)
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, self.width-32, 96)
bitmap = Bitmap.new(self.width-32, 96)
color = Color.new(160, 160, 160, 160)
bitmap.fill_rect(2, 2, self.width-36, 96, color)
contents.blt(0, y, bitmap, src_rect, 192)
end
But now, what I want to do is 'blt' the Windowskin's cursor graphic, then stretch it to the size of the real cursor, and blt it onto self.contents, but I can't even get the graphic to show up. (Note: cursor_width and cursor_height are newly defined methods for this script)
Code:
#-----------------------------------------------------------------------------
# * Clone Cursor
#-----------------------------------------------------------------------------
def clone_cursor
row = @index / @column_max
self.top_row = row if row < self.top_row
self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1)
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, cursor_width, cursor_height)
bitmap = Bitmap.new(128, 96)
bitmap.blt(128, 64, self.windowskin, Rect.new(128, 64, 32, 32))
contents.blt(0, y, bitmap, src_rect, 192)
end
All I really need to know is, how do I go about cloning and singling out the self.windowskin's cursor graphic, and stretch it onto the Window?