Healthbar soll mit gehen.

  • GM 8

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

  • Healthbar soll mit gehen.

    Hi leute.
    Und zwar habe ich einen healthbar erstellt der soweit richtig funktioniert.
    Nur habe ich das problem das mein raum 2000 breit ist. Und ich ein view drin habe also das wenn ich kurz vor dem rand bin das bild mit geht.
    Also wenn ich jetz am anfang meinen healthbar spawne dann bleibt er in der ecke und geht nicht mit.
    Aber ich möchte es so haben das er mit geht. Also z.B an das view geankert oder so^^
    Hoffe ihr könnt mir helfen
  • Der Hilfe schrieb:

    view_xview[0..7] X-Position des Views im Raum.
    view_yview[0..7] Y-Position des Views im Raum.
    view_wview[0..7] Breite des Views im Raum.
    view_hview[0..7] Höhe des Views im Raum.
    Draw die Leiste an der view_xview[0] und view_yview[0] Position.
    MfG Henrik1235
    wupto.net/ Nicht meine Seite!
    We love Koalas.

    GM-D-Spam-o-Meter: 32%
  • Meinst du so?

    GML-Quellcode

    1. view_xview[0]
    2. view_yview[0]
    3. draw_sprite(sprite,0,x,y); //draw the back of the healthbar
    4. if hp<maxhp and hp>0 //if the health fits in the healthbar
    5. {
    6. draw_sprite_part(sprite,1,0,0,hp,sprite_get_height(sprite),x,y); //draw the front
    7. }
    8. if hp=maxhp //if the health is full
    9. {
    10. draw_sprite(sprite,1,x,y); //draw the front
    11. }
    Alles anzeigen
  • GML-Quellcode

    1. draw_sprite(sprite,0,view_xview[0],view_yview[0]); //draw the back of the healthbar
    2. if hp<maxhp and hp>0 //if the health fits in the healthbar
    3. {
    4. draw_sprite_part(sprite,1,0,0,hp,sprite_get_height(sprite),view_xview[0],view_yview[0]); //draw the front
    5. }
    6. if hp=maxhp //if the health is full
    7. {
    8. draw_sprite(sprite,1,view_xview[0],view_yview[0]); //draw the front
    9. }

    So...
    wupto.net/ Nicht meine Seite!
    We love Koalas.

    GM-D-Spam-o-Meter: 32%