Bitmap.draw_text seems to crash the client when there is a lot of text.
I pasted this code in a new project:
class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super SceneManager.clear $game_player.straighten $game_map.refresh $game_message.visible = false create_spriteset create_all_windows @menu_calling = false @str = 'Curabitur justo nisi, venenatis a hendrerit vel, tristique in eros. Maecenas cursus enim adipiscing lectus sodales, a interdum risus hendrerit. Proin laoreet lacus dui, eu sagittis erat pharetra sed. Nam sit amet elit venenatis, congue orci ultrices, placerat ipsum. Quisque laoreet facilisis mi, et tincidunt nulla rhoncus ac. Mauris fringilla non tortor et rhoncus. Nulla pharetra risus id placerat malesuada. Pellentesque et varius ante, nec viverra magna. Phasellus lacinia cursus leo, a lacinia sem adipiscing feugiat. Nam at sem nisl. Integer tempus blandit tortor, a tempus mauris varius ut. Maecenas eu elit vitae eros suscipit dignissim. Etiam consequat at tellus et placerat.' @sprite = Sprite.new @sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height) @sprite.bitmap.font.size = 22 @sprite.bitmap.draw_text(Rect.new(32, 64, Graphics.width - 64, Graphics.height - 96), @str) endendI tried increasing the size of the bitmap to roughly 6800x4800 to ensure that the paragraph fits within the rect (also increased the Rect size) but it still crashes the client. Why?
Also, draw_text does not support the newline constant \n ? Do I have to make the text an array and then draw it line by line? In other words, am I forced to extend the Sprite class with a Sprite.draw_wrapped_text(Rect, text) that does not crash and that accepts newline constants?
I pasted this code in a new project:
class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super SceneManager.clear $game_player.straighten $game_map.refresh $game_message.visible = false create_spriteset create_all_windows @menu_calling = false @str = 'Curabitur justo nisi, venenatis a hendrerit vel, tristique in eros. Maecenas cursus enim adipiscing lectus sodales, a interdum risus hendrerit. Proin laoreet lacus dui, eu sagittis erat pharetra sed. Nam sit amet elit venenatis, congue orci ultrices, placerat ipsum. Quisque laoreet facilisis mi, et tincidunt nulla rhoncus ac. Mauris fringilla non tortor et rhoncus. Nulla pharetra risus id placerat malesuada. Pellentesque et varius ante, nec viverra magna. Phasellus lacinia cursus leo, a lacinia sem adipiscing feugiat. Nam at sem nisl. Integer tempus blandit tortor, a tempus mauris varius ut. Maecenas eu elit vitae eros suscipit dignissim. Etiam consequat at tellus et placerat.' @sprite = Sprite.new @sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height) @sprite.bitmap.font.size = 22 @sprite.bitmap.draw_text(Rect.new(32, 64, Graphics.width - 64, Graphics.height - 96), @str) endendI tried increasing the size of the bitmap to roughly 6800x4800 to ensure that the paragraph fits within the rect (also increased the Rect size) but it still crashes the client. Why?
Also, draw_text does not support the newline constant \n ? Do I have to make the text an array and then draw it line by line? In other words, am I forced to extend the Sprite class with a Sprite.draw_wrapped_text(Rect, text) that does not crash and that accepts newline constants?