If you’re using draw_text_ext() string_width_ext() and string_height_ext() are the functions to use instead. Fortunately, GameMaker provides some useful functions which can enable you to get the dimensions needed for the surface: string_width() and string_height(), which give you the width and height, respectively, in pixels of a string drawn with draw_text() in the current font. Setting up a Surface for optimizing text performance is tricky because it can be hard to know in advance how large the surface needs to be to contain the text you are drawing. ![]() Using surfaces properly is not that difficult once you understand them, but is generally considered to be an “advanced” concept in GameMaker, and is less straightforward than drawing directly to the screen in the “normal” way. Surfaces are not available in the free edition of GameMaker, and not all hardware may support them. The most important of these is to use Surfaces. There are ways to improve performance when drawing text.Draw a lot of text and performance will suffer. Drawing directly to the screen (especially text) is slow.If you’re drawing in the Draw GUI Event, you’ll want to be familiar with the draw_set_gui_size() function so your Draw GUI stuff will be drawn to the proper scale if you’re using Views. Draw functions only work in Draw Events: If you try to use them anywhere else, nothing happens.Things to know about drawing stuff in GameMaker ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |