Text moving After Pause Button

J

Julio

Guest
Hello , so ive made a buy menu which also pauses the game but when i unpause the text in the corner moves to right and changes fonts is there anyway to fix this?

Thank you!
 

Attachments

L

L0v3

Guest
You have posted no information to figure out what the problem is. Please show us some code of how you are drawing this.
 
J

Julio

Guest
You have posted no information to figure out what the problem is. Please show us some code of how you are drawing this.
thats a misplay from me sorry! here you go the pause create screen and the draw_gui
if theres anything more you may need ill send it no problem just ask ;D
 

Attachments

L

L0v3

Guest
Your problem seems to be a element in the pause menu that updates the halign of drawing. Make sure you call draw_set_halign(), in your draw script for draw gui. Here's a script that handles all setup for text, which I recommend you use to avoid errors such as these.

Code:
///draw_setup(colour, font, halign, valign, self);

// Setups the various draw functions commonly used for drawing text in a single line of code.

//  colour             = Drawing colour to be set. Eg. c_white.
//  font               = Drawing font to be set. Eg. ft_options.
//  halign             = Drawing halign to be set. Eg. fa_left.
//  valign             = Drawing valign to be set. Eg. fa_top.
//  self               = Boolean value if self should be drawn.

//Converts arguments to locals.
var colour = argument0;
var font = argument1;
var halign = argument2;
var valign = argument3;
var self_draw = argument4;

//Checks to see if self should be drawn.
if self_draw { draw_self(); }

//Setups drawing.
draw_set_colour(colour);
draw_set_font(font);
draw_set_halign(halign);
draw_set_valign(valign);
 
J

Julio

Guest
Your problem seems to be a element in the pause menu that updates the halign of drawing. Make sure you call draw_set_halign(), in your draw script for draw gui. Here's a script that handles all setup for text, which I recommend you use to avoid errors such as these.

Code:
///draw_setup(colour, font, halign, valign, self);

// Setups the various draw functions commonly used for drawing text in a single line of code.

//  colour             = Drawing colour to be set. Eg. c_white.
//  font               = Drawing font to be set. Eg. ft_options.
//  halign             = Drawing halign to be set. Eg. fa_left.
//  valign             = Drawing valign to be set. Eg. fa_top.
//  self               = Boolean value if self should be drawn.

//Converts arguments to locals.
var colour = argument0;
var font = argument1;
var halign = argument2;
var valign = argument3;
var self_draw = argument4;

//Checks to see if self should be drawn.
if self_draw { draw_self(); }

//Setups drawing.
draw_set_colour(colour);
draw_set_font(font);
draw_set_halign(halign);
draw_set_valign(valign);
thank you so much for that! but i really dont have an idea on how to implement that into the game so it fixes itself ;/ yea.... sorry for me being so bad at coding D:'
 
L

L0v3

Guest
You create a new script, copy paste the code into it, name it draw_setup, place it in some basic engine script folder, then use it anytime you draw stuff. Here's a button example:

Code:
///Draw Event
draw_setup(c_black, ft_arial_12, fa_center, fa_middle, true);
draw_text(x, y, "Play");

Find anywhere in the code where you draw text, use this script to setup drawing.
 
J

Julio

Guest
You create a new script, copy paste the code into it, name it draw_setup, place it in some basic engine script folder, then use it anytime you draw stuff. Here's a button example:

Code:
///Draw Event
draw_setup(c_black, ft_arial_12, fa_center, fa_middle, true);
draw_text(x, y, "Play");

Find anywhere in the code where you draw text, use this script to setup drawing.
that worked thank you a lot! sorry for being so bad aswell
 
Top