2016-04-20 25 views

回答

1

如果你想要一個文本改變到另一個,你可以這樣做

if instance_exists(obj_cover) 
    var txt = "text 1"; 
else 
    var txt = "text 2"; 

draw_text(posx, posy, txt); 

如果你想簡單的展示文本時obj_cover被破壞,你可以做,例如這樣的:

創建對象obj_text。添加到Create事件:

text = ""; 

Draw事件:

// also here you can define color, font, align, etc 
draw_text(x, y, text); 

現在給obj_coverDestroy事件:

var obj = instance_create(posx, posy, obj_text); 
obj.text = "your text"; 

其他方式 - 您可以使用一個變量來檢查,是需要是否繪製文字。例如,Destroy事件的obj_cover

global.show_text = false; 

而且在某處其他對象:

if global.show_text 
    draw_text(posx, posy, "text"); 

等等 很多種方式成爲可能。

+0

非常感謝它的工作:D – shrouk