B
BlueDuckYT
Guest
I am using DnD in version 1.4. When I try to use a draw variable value or draw text nothing appears. I even tried using a change font block. What is going wrong here?
draw_text(xpos,ypos,string(variable));
Yes and Yeshave you placed your object into the room? is it marked visible in the object editor?
draw_text(0,0,"" + string(variable));
draw_text(320,240,"Ammo: " + string(player.ammo) + "/" + string(player.ammoMax));
maybe even do not use the variable, but put some fix text, just to see if text appears.Try that captainCode:draw_text(0,0,"" + string(variable));
draw_text(100,100,"ABCDEF");
Coords are good, sprite is visible. Still not there.is your background black? in this case you won't see the black text. if yes, try to change text color:
draw_set_color(c_yellow);
Do you have a sprite on this object? if yes, is the sprite shown?
edit: check the coordinate for text. is it within visible part of the room? try first with smaller values like 100,100.
is the phrase string needed? I don't want any string there, as I have the object for the icon next to the name.Try that captainCode:draw_text(0,0,"" + string(variable));
EDIT: You need the "+" when adding information in draw_text();
Example:
Code:draw_text(320,240,"Ammo: " + string(player.ammo) + "/" + string(player.ammoMax));
Yes, this will call for the variable you want to be drawnCoords are good, sprite is visible. Still not there.
is the phrase string needed? I don't want any string there, as I have the object for the icon next to the name.
Got it. It should be in the step event, right? I cannot get it to appear still.Yes, this will call for the variable you want to be drawn
define some controller object in one room and make that object persistent in object editor. that way object will not be destroyed, but will be present in every room.....
Also, how do I define a variable without resetting it every time I switch rooms?
Use Draw GUI event instead. I have had experience with such matter and I succeeded by just doing what I mentioned.It worked, but now the Sprite is gone...