void DamageNumber::draw(Point<int16_t> viewpos) const { if (alpha > 1.0f) return; const std::pair<Charset, Charset>* charsets = getcharsets(type); Point<int16_t> drawpos = Point<int16_t>( static_cast<int16_t>(fx), static_cast<int16_t>(fy) ) + viewpos; if (miss) { charsets->second.draw('M', DrawArgument(drawpos, alpha)); } else if (restnum.size() > 0) { drawpos.shiftx(-shift); charsets->first.draw(firstnum, DrawArgument(drawpos, alpha)); drawpos.shiftx(charsets->first.getw(firstnum) - 7); for (size_t i = 0; i < restnum.length(); i++) { charsets->second.draw( restnum[i], DrawArgument(drawpos + Point<int16_t>(0, (i % 2 == 1) ? -6 : 0), alpha)); drawpos.shiftx(charsets->second.getw(restnum[i]) - 7); } } else { charsets->first.draw(firstnum, DrawArgument(drawpos, alpha)); } }
void Mob::draw(double viewx, double viewy, float alpha) const { Point<int16_t> absp = phobj.getabsolute(viewx, viewy, alpha); Point<int16_t> headpos = getheadpos(absp); effects.drawbelow(absp, alpha); if (!dead) { float interopc = opacity.get(alpha); animations.at(stance).draw(DrawArgument(absp, flip && !noflip, interopc), alpha); if (showhp) { namelabel.draw(absp); if (!dying && hppercent > 0) { hpbar.draw(headpos, hppercent); } } } effects.drawabove(absp, alpha); }
void Background::draw(double viewx, double viewy, float alpha) const { double x; if (moveobj.hmobile()) { x = moveobj.getabsx(viewx, alpha); } else { double shiftx = rx * (WOFFSET - viewx) / 100 + WOFFSET; x = moveobj.getabsx(shiftx, alpha); } double y; if (moveobj.vmobile()) { y = moveobj.getabsy(viewy, alpha); } else { double shifty = ry * (HOFFSET - viewy) / 100 + HOFFSET; y = moveobj.getabsy(shifty, alpha); } if (htile > 1) { while (x > 0) { x -= cx; } while (x < -cx) { x += cx; } } if (vtile > 1) { while (y > 0) { y -= cy; } while (y < -cy) { y += cy; } } int16_t ix = static_cast<int16_t>(std::round(x)); int16_t iy = static_cast<int16_t>(std::round(y)); int16_t tw = cx * htile; int16_t th = cy * vtile; for (int16_t tx = 0; tx < tw; tx += cx) { for (int16_t ty = 0; ty < th; ty += cy) { animation.draw(DrawArgument(Point<int16_t>(ix + tx, iy + ty), flipped, opacity / 255), alpha); } } }
void UINotice::draw(bool textfield) const { Point<int16_t> start = position; top.draw(start); start.shift_y(top.height()); centerbox.draw(start); start.shift_y(centerbox.height()); Point<int16_t> textpos = start; box.draw(DrawArgument(textpos, Point<int16_t>(0, height))); start.shift_y(box.height() * (height / box.height())); box.draw(start); start.shift_y(box.height()); question.draw(textpos + Point<int16_t>(130, -3)); if (textfield) { box2.draw(start); start.shift_y(box2.height()); } box.draw(start); start.shift_y(box.height()); bottombox.draw(start); }
void MesoDrop::draw(double viewx, double viewy, float alpha) const { if (!active || !icon) return; Point<int16_t> absp = phobj.getabsolute(viewx, viewy, alpha); icon->draw(DrawArgument(angle.get(alpha), absp, opacity.get(alpha)), alpha); }
void Mob::showeffect(Animation animation, int8_t pos, int8_t z, bool f) { if (active) { Point<int16_t> shift; switch (pos) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: break; } effects.add(animation, DrawArgument(shift, f), z); } }
void Obj::draw(Point<int16_t> viewpos, float inter) const { animation.draw(DrawArgument(pos + viewpos, flip), inter); }