if(pokemonTexture != null)
{
PUWeb.engine().beginTextureBatch(pokemonTexture, 2048, pokemonCount, 255, 255, 255, 255);
for(int i = 0; i < 6; i++)
{
PU_Pokemon pokemon = self.getPokemon(i);
if(pokemon != null)
{
PU_Image pokemonIcon = PUWeb.resources().getPokemonIcon(pokemon.getSpeciesId());
if(pokemonIcon != null)
{
pokemonIcon.draw(204+(i*(pokemonSlot.getWidth()+2)), 8, true);
}
PU_Image hpbarImage = null;
float hpperc = ((float)pokemon.getHp() / (float)pokemon.getHpmax());
if(hpperc > 0.6f)
{
hpbarImage = PUWeb.resources().getGuiImage(GuiImages.IMG_GUI_WORLD_HPBAR_GREEN);
}
else if(hpperc > 0.2f)
{
hpbarImage = PUWeb.resources().getGuiImage(GuiImages.IMG_GUI_WORLD_HPBAR_YELLOW);
}
else
{
hpbarImage = PUWeb.resources().getGuiImage(GuiImages.IMG_GUI_WORLD_HPBAR_RED);
}
if(hpbarImage != null)
{
hpbarImage.drawRect(new PU_Rect(256+(i*(pokemonSlot.getWidth()+2)), 19, (int)Math.ceil((float)hpperc * hpbarImage.getWidth()), hpbarImage.getHeight()));
}
PU_Image expbarImage = PUWeb.resources().getGuiImage(GuiImages.IMG_GUI_WORLD_HPBAR_EXP);
if(expbarImage != null)
{
expbarImage.drawRect(new PU_Rect(256+(i*(pokemonSlot.getWidth()+2)), 29, (int)Math.ceil(((float)pokemon.getExpPerc()/100.0f) * expbarImage.getWidth()), expbarImage.getHeight()));
}
}
}
PUWeb.engine().endTextureBatch();
}