Sk8dududu
Member
I have a script that draws an energy bar. It draws the sprite based on how much of a variable "energy" I have. When I use a static image with 1 frame it works perfectly. But when I use another sprite that has multiple frames, it plays the animation, but it's completely missing a colour and I don't really understand why. It has the same yellow loading bar as the static image, just with lightning animation overtop of it. On the same layer. What could be preventing it from drawing the bar and only drawing the lightning animation?
Draw script for the bar:
Script for setting up the bar
I've tested having multiple frames for the static image to see if it would make anything invisible, it worked fine. It's gotta be something in the image editor making a colour transparent? or what? I also have a step event that increases the image_index by 0.5 every step. and it works because the lightning is animated.
Draw script for the bar:
Code:
function scr_draw_bar(xx,yy)
{
draw_healthbar(xx-(bar_width/2)-11,yy-8,xx+(bar_width/2)-11,yy+7,100*(red_energy/max_energy),c_black,c_red,c_red,0,false,false);
draw_sprite_part(spr_ui_bar_fill,index,0,-3,ceil(bar_width*(show_energy/max_energy)),15,xx-(bar_width/2)-12,yy-8);
draw_sprite(spr_ui_bar_outline,0,xx,yy);
}
Code:
function scr_setup_bar()
{
max_energy = 550;
section_size = 100;
bar_width = 188;
bar_height = 10;
energy = max_energy;
show_energy = max_energy;
red_energy = max_energy;
index = 0;
}