- Joined
- Dec 29, 2012
- Messages
- 869
- Reaction score
- 97
- First Language
- Dutch
- Primarily Uses
Window_Base:
#-------------------------------------------------------------------------- # * Reset Font Settings #-------------------------------------------------------------------------- def reset_font_settings change_color(normal_color) p contents.disposed? # False p contents.font # #<Font:0x84c4c78> p contents.font.size # 24 p contents.font.name # "VL Gothic" contents.font.size = 10 # <<<<<< Crash: disposed bitmap contents.font.size = Font.default_size contents.font.bold = Font.default_bold contents.font.italic = Font.default_italic endWhy do I get that error when nothing seems to be disposed?
I have this code:
@bmp.font = contents.font...@bmp.dispose # <<<< outcommenting this line will make the crash disappear. But that makes no sense.So I started a fresh project and changed the following method in Window_Message:
def new_page(text, pos) contents.clear draw_face($game_message.face_name, $game_message.face_index, 0, 0) reset_font_settings pos[:x] = new_line_x pos[:y] = 0 pos[:new_x] = new_line_x pos[:height] = calc_line_height(text) clear_flags ########### MY CODE BELOW ########### a = Bitmap.new(1,1) a.font = contents.font a.dispose endAnd yes this generates the exact same error.
So wait a minute... Does disposing a bitmap also dispose fonts somehow? Even if they are used in other bitmaps? There is no font.disposed? method.
I kinda want my font to be the same as the one from the Window_Message but without the crash obviously.
And this also crashes:
a = Bitmap.new(1,1) a.font = contents.font a.font = a.font.dup a.disposeI duped it but the original one is still disposed. Almost as if the "a" bitmap now holds 2 fonts and still disposes both?
This also crashes:
a = Bitmap.new(1,1) a.font = contents.font a.font = Font.new('Arial', 24) a.disposeSo I assign another font to it instead and still it 'disposes' the other font somehow?
This does not crash:
a = Bitmap.new(1,1) #a.font = contents.font a.font = Font.new('Arial', 24) a.disposeNow isn't that weird?
#-------------------------------------------------------------------------- # * Reset Font Settings #-------------------------------------------------------------------------- def reset_font_settings change_color(normal_color) p contents.disposed? # False p contents.font # #<Font:0x84c4c78> p contents.font.size # 24 p contents.font.name # "VL Gothic" contents.font.size = 10 # <<<<<< Crash: disposed bitmap contents.font.size = Font.default_size contents.font.bold = Font.default_bold contents.font.italic = Font.default_italic endWhy do I get that error when nothing seems to be disposed?
I have this code:
@bmp.font = contents.font...@bmp.dispose # <<<< outcommenting this line will make the crash disappear. But that makes no sense.So I started a fresh project and changed the following method in Window_Message:
def new_page(text, pos) contents.clear draw_face($game_message.face_name, $game_message.face_index, 0, 0) reset_font_settings pos[:x] = new_line_x pos[:y] = 0 pos[:new_x] = new_line_x pos[:height] = calc_line_height(text) clear_flags ########### MY CODE BELOW ########### a = Bitmap.new(1,1) a.font = contents.font a.dispose endAnd yes this generates the exact same error.
So wait a minute... Does disposing a bitmap also dispose fonts somehow? Even if they are used in other bitmaps? There is no font.disposed? method.
I kinda want my font to be the same as the one from the Window_Message but without the crash obviously.
And this also crashes:
a = Bitmap.new(1,1) a.font = contents.font a.font = a.font.dup a.disposeI duped it but the original one is still disposed. Almost as if the "a" bitmap now holds 2 fonts and still disposes both?
This also crashes:
a = Bitmap.new(1,1) a.font = contents.font a.font = Font.new('Arial', 24) a.disposeSo I assign another font to it instead and still it 'disposes' the other font somehow?
This does not crash:
a = Bitmap.new(1,1) #a.font = contents.font a.font = Font.new('Arial', 24) a.disposeNow isn't that weird?
Last edited by a moderator:
