• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Journal

D

deem93

Guest
Hello.
I want to add a journal to my game, akin to the one in the original Fallout
How do I go about creating one? More specifically, how do I make older entries move up, when a new one appears? Thanks.
 

MudbuG

Member
Here is one idea:

Use a ds_list.
Add lines to it when new entries are added.
When you draw the text, start from a position you keep in a variable (like top_line for example), then iterate through the list until you are at the end of the visible window.
To scroll up or down in the list, change top_line.
To keep the list from getting too big, set a maximum_lines variable, and when the list gets too big, remove lines form the top of the list (index 0) until lines are <= maximum_lines (you will also need to adjust the top_line variable when removing lines like this ... subtract one from it for each line you remove).
 
D

dannyjenn

Guest
Another idea is to use surfaces and draw_surface_part() (though this is a little trickier if you've never used surfaces before...) The advantage to surfaces is that it's less drawing to the screen, so it runs faster. (The disadvantage is it uses more RAM, and I think surfaces are more prone to incompatibility issues)
 
Top