I'm trying to make an Tutorial room where when you collect some items for the first time , a message will appear above the player to say what it is. I have a example on the User Event 0 on the layer object.
Attachments
-
35.8 KB Views: 24
Well my question is I want the player if he collects lets a say a star object on a certain room. I want a text to show up and say "This is a star." I have an updated code here that will make more sense but It still wont work. This is on a draw event on a empty object i added into the instance.What is your problem or question?
In case, you can't draw outside of Draw events. (Technically, you can, but it won't be visible.)
var inst;What is "that"? Show us exactly what you did.
I dont think the draw text feature will work if its not on a draw event.the easiest way is to create a text object that only draws text and dissapears after a while, by setting an alarm in its create event and have the alarm destroy itself, give it a text variable in the create event with a string that it draws in its draw event
and when you pick up the star then you just create a instance of the text object and set its text to "This is a Star"
Which event is this code in? Still User 0? If so, where are you calling this event from?var inst;
inst = instance_position(x, y, oPlayer);
if(room == rm_levelT)
{
if(inst != noone){
draw_text_ext(x+10,y,"This is a star", 10, 32);
}
}
No this is on a draw event. Since i guess thats where the draw fucntions actually work?Which event is this code in? Still User 0? If so, where are you calling this event from?
You may also want to sprinkle some show_debug_messages into your code to see which parts of the code actually run, or inspect your code using the debugger to see what is happening line by line. Check whether the code you're calling is returning the results you expect (e.g. is a collision even detected?).