Text Verschieben wenn...

  • GM 8

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Text Verschieben wenn...

    Hi,
    Ich Zeichne Text mit draw_text an eine bestimmte Position im Raum wenn ein bestimmtes Ereigniss passiert.
    Das Problem ist das wenn dieses Ereigniss öfters hintereinander auftritt das dann viel Text aufeinander gezeichnet wird und man es nichtmehr richtig lesen kann, deswegen wollte ich dass wenn der text gedrawt wird er vorher überprüft ob an dieser Stelle bereits schon ein text steht und der Alte text dann ein stück nach oben geschoben wird.
    Ich hoffe ihr versteht was ich meine und könnt mir Helfen.

    MFG DragonXZ
    Imagine taking your usual two century long nap minding your own business when suddenly some cunt wakes you up.
    You tell him to f*ck off of course but just when you finally managed to fall asleep again the same asshole comes knocking again. I'd attack that dick too.
  • mach doch einfach ein objekt wo der text dran ist !!!
    und dann im bestimmten moment den bewegen
    Ein Bug ist mehr als nur ein Bug, es ist ein... Käfer!
    Egal, wie gut du eine Mauer baust, sie fällt um.... der klügere gibt nach :D

    Willst du mit mir auf Discord Chatten/Quatschen?
    Meine Husi's Tutorial Reihe
  • Ehm ja genau das mache ich ja.
    Hab versucht den Text einfach zu verschieben wenn ein anderes Ersellt wird nur irgentwie funktioniert es nicht.


    Hier mal der Code:
    Spoiler anzeigen

    GML-Quellcode

    1. Create Event:
    2. block = false;
    3. Alarm Event for alarm 0:
    4. instance_destroy();
    5. Step Event:
    6. if (!block)
    7. {
    8. alarm[0]=60;
    9. block=true;
    10. }
    11. Draw Event:
    12. var xx,yy;
    13. xx = view_xview[0]+833;
    14. yy = view_yview[0]+493;
    15. draw_set_halign(fa_center);
    16. draw_set_valign(fa_middle);
    17. draw_set_font(font_text);
    18. draw_set_color(c_white);
    19. draw_set_alpha(1);
    20. draw_text(xx,yy,"+"+string(global.EXP_txt)+" Exp");
    Alles anzeigen


    Wenn ich nun im Step Event y-=5 oder yy-=5 einsetzte Passiert nix.
    Imagine taking your usual two century long nap minding your own business when suddenly some cunt wakes you up.
    You tell him to f*ck off of course but just when you finally managed to fall asleep again the same asshole comes knocking again. I'd attack that dick too.
  • Ah wusste ich garnicht, danke hat mir sehr geholfen :D
    Imagine taking your usual two century long nap minding your own business when suddenly some cunt wakes you up.
    You tell him to f*ck off of course but just when you finally managed to fall asleep again the same asshole comes knocking again. I'd attack that dick too.
  • Okay, nur hab ich jetzt noch ein Problem undzwar verfolgt das Objekt jetzt nicht den View des Players, wie mache ich nun die Verschiebung+ View verfolgung?


    Spoiler anzeigen

    GML-Quellcode

    1. Create Event:
    2. block = false;
    3. flue_b=false;
    4. x = view_xview[0]+833;
    5. y = view_yview[0]+493;
    6. Alarm Event for alarm 0:
    7. instance_destroy();
    8. flue_b=false;
    9. Step Event:
    10. if (!block)
    11. {
    12. alarm[0]=60;
    13. block=true;
    14. }
    15. if(instance_exists(obj_got_money)&&!flue_b)
    16. {
    17. flue_b=true;
    18. with(obj_got_money)
    19. {
    20. y-=15;
    21. }
    22. with(obj_got_exp)
    23. {
    24. y-=15;
    25. }
    26. }
    27. if(instance_exists(obj_got_exp)&&!flue_b)
    28. {
    29. flue_b=true;
    30. with(obj_got_exp)
    31. {
    32. y-=15;
    33. }
    34. with(obj_got_money)
    35. {
    36. y-=15;
    37. }
    38. }
    39. Draw Event:
    40. draw_set_halign(fa_center);
    41. draw_set_valign(fa_middle);
    42. draw_set_font(font_text);
    43. draw_set_color(c_white);
    44. draw_set_alpha(1);
    45. draw_text(x,y,"EXP +"+string(global.EXP_txt));
    Alles anzeigen
    Imagine taking your usual two century long nap minding your own business when suddenly some cunt wakes you up.
    You tell him to f*ck off of course but just when you finally managed to fall asleep again the same asshole comes knocking again. I'd attack that dick too.
  • Müsste das nicht so gehen:
    Spoiler anzeigen
    Create Event:
    ...
    x = 833;
    y = 493;
    ...
    Draw Event:
    ...
    draw_text(view_xview[0] + x,view_yview[0]+y,"EXP +"+string(global.EXP_txt));
    Einige meiner Spiele:
  • Danke, es funktioniert, lustig wie mir manchmal die einfachsten sachen nicht einfallen. :P
    Imagine taking your usual two century long nap minding your own business when suddenly some cunt wakes you up.
    You tell him to f*ck off of course but just when you finally managed to fall asleep again the same asshole comes knocking again. I'd attack that dick too.